Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions bench/tasks/java-path-traversal/answer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
issues:
- id: java-path-traversal-newfile-001
file: FileService.java
severity: HIGH
cwe: CWE-22
vulnSlugs: [java-path-traversal-newfile, path-traversal]
location: { startLine: 10, endLine: 10, tolerance: 2 }
scanner: { mustEmitCandidate: true }
- id: java-path-traversal-paths-001
file: FileService.java
severity: HIGH
cwe: CWE-22
vulnSlugs: [java-path-traversal-newfile, path-traversal]
location: { startLine: 15, endLine: 15, tolerance: 2 }
scanner: { mustEmitCandidate: true }
decoys: []
26 changes: 26 additions & 0 deletions bench/tasks/java-path-traversal/source/FileService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.example.files;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class FileService {

public byte[] readVulnerableFile(String name) throws Exception {
File f = new File(name);
return Files.readAllBytes(f.toPath());
}

public byte[] readVulnerablePaths(String path) throws Exception {
return Files.read(Paths.get(path));
}

public byte[] readSafeWhitelisted(String slug) throws Exception {
File base = new File("/var/data");
File target = new File(base, slug + ".bin").getCanonicalFile();
if (!target.toPath().startsWith(base.toPath())) {
throw new SecurityException("outside base");
}
return Files.readAllBytes(target.toPath());
}
}
9 changes: 9 additions & 0 deletions bench/tasks/java-path-traversal/task.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[provenance]
source = "handcraft"
added_at = "2026-05-14"
reviewer = "@noeljackson"
review_due = "2027-05-14"
notes = "Java new File(input) / Files.read(Paths.get(input)) path traversal pattern."

[labels]
change_rule = "freeze"
13 changes: 13 additions & 0 deletions bench/tasks/rust-cmd-arg-format/answer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
issues:
- id: rust-cmd-arg-format-001
file: src/lib.rs
severity: HIGH
cwe: CWE-78
vulnSlugs: [rust-cmd-injection, command-injection]
location: { startLine: 6, endLine: 6, tolerance: 2 }
scanner: { mustEmitCandidate: true }
decoys:
- id: rust-cmd-literal-arg-decoy
file: src/lib.rs
line: 10
forbiddenSlugs: [rust-cmd-injection]
4 changes: 4 additions & 0 deletions bench/tasks/rust-cmd-arg-format/source/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[package]
name = "fixture"
version = "0.0.1"
edition = "2021"
11 changes: 11 additions & 0 deletions bench/tasks/rust-cmd-arg-format/source/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use std::process::Command;

pub fn run_vulnerable_argv() {
let args: Vec<String> = std::env::args().collect();
let name = &args[1];
let _ = Command::new("sh").arg(format!("-c \"echo {}\"", name)).status();
}

pub fn run_safe(value: &str) {
let _ = Command::new("echo").arg(value).status();
}
9 changes: 9 additions & 0 deletions bench/tasks/rust-cmd-arg-format/task.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[provenance]
source = "handcraft"
added_at = "2026-05-14"
reviewer = "@noeljackson"
review_due = "2027-05-14"
notes = "Rust Command::new(...).arg(format!(...)) — shell-style argv built from input."

[labels]
change_rule = "freeze"
13 changes: 13 additions & 0 deletions bench/tasks/swift-ats-disabled/answer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
issues:
- id: swift-ats-arbitrary-loads-001
file: Info.plist
severity: MEDIUM
cwe: CWE-757
vulnSlugs: [swift-allow-arbitrary-loads]
location: { startLine: 9, endLine: 10, tolerance: 2 }
scanner: { mustEmitCandidate: true }
decoys:
- id: swift-ats-no-bypass-decoy
file: InfoSafe.plist
line: 6
forbiddenSlugs: [swift-allow-arbitrary-loads]
13 changes: 13 additions & 0 deletions bench/tasks/swift-ats-disabled/source/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>example</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
8 changes: 8 additions & 0 deletions bench/tasks/swift-ats-disabled/source/InfoSafe.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>example-safe</string>
</dict>
</plist>
9 changes: 9 additions & 0 deletions bench/tasks/swift-ats-disabled/task.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[provenance]
source = "handcraft"
added_at = "2026-05-14"
reviewer = "@noeljackson"
review_due = "2027-05-14"
notes = "Swift Info.plist with NSAllowsArbitraryLoads true — disables App Transport Security."

[labels]
change_rule = "freeze"
Loading