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
13 changes: 13 additions & 0 deletions bench/tasks/java-xxe/answer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
issues:
- id: java-xxe-001
file: XmlService.java
severity: HIGH
cwe: CWE-611
vulnSlugs: [java-xxe, xxe, xxe-xml-parser]
location: { startLine: 11, endLine: 11, tolerance: 2 }
scanner: { mustEmitCandidate: true }
decoys:
- id: java-non-xml-greet-decoy
file: XmlService.java
line: 17
forbiddenSlugs: [java-xxe]
19 changes: 19 additions & 0 deletions bench/tasks/java-xxe/source/XmlService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.example.xml;

import java.io.InputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;

public class XmlService {

public Document parseVulnerable(InputStream in) throws Exception {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
return db.parse(in);
}

public String greet(String name) {
return "Hello, " + name;
}
}
7 changes: 7 additions & 0 deletions bench/tasks/java-xxe/source/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>xml-fixture</artifactId>
<version>0.0.1</version>
</project>
9 changes: 9 additions & 0 deletions bench/tasks/java-xxe/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 = "Under-covered Phase-2 language fixture. Java XXE: DocumentBuilderFactory.newInstance without external-entity hardening."

[labels]
change_rule = "freeze"
13 changes: 13 additions & 0 deletions bench/tasks/rust-axum-no-auth/answer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
issues:
- id: rust-axum-no-auth-001
file: src/main.rs
severity: MEDIUM
cwe: CWE-862
vulnSlugs: [rust-axum-no-auth-extractor]
location: { startLine: 18, endLine: 18, tolerance: 2 }
scanner: { mustEmitCandidate: true }
decoys:
- id: rust-helper-no-route-decoy
file: src/main.rs
line: 13
forbiddenSlugs: [rust-axum-no-auth-extractor]
7 changes: 7 additions & 0 deletions bench/tasks/rust-axum-no-auth/source/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "fixture"
version = "0.0.1"
edition = "2021"

[dependencies]
axum = "0.7"
20 changes: 20 additions & 0 deletions bench/tasks/rust-axum-no-auth/source/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use axum::{routing::post, Router, Json};
use serde::Deserialize;

#[derive(Deserialize)]
struct Item {
name: String,
}

async fn create_item(Json(_): Json<Item>) {
// No auth extractor — anyone can POST.
}

fn helper(label: &str) -> String {
format!("[{}]", label)
}

pub fn router() -> Router {
Router::new()
.route("/items", post(create_item))
}
11 changes: 11 additions & 0 deletions bench/tasks/rust-axum-no-auth/task.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
matcher_exclude = ["axum-handler", "auth-bypass"]

[provenance]
source = "handcraft"
added_at = "2026-05-14"
reviewer = "@noeljackson"
review_due = "2027-05-14"
notes = "Under-covered Phase-2 language fixture per CLAUDE.md project invariant. Axum state-changing POST route without an auth extractor in the handler signature."

[labels]
change_rule = "freeze"
13 changes: 13 additions & 0 deletions bench/tasks/swift-keychain-no-access/answer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
issues:
- id: swift-keychain-no-access-001
file: Keychain.swift
severity: MEDIUM
cwe: CWE-200
vulnSlugs: [swift-keychain-no-access-control]
location: { startLine: 10, endLine: 10, tolerance: 2 }
scanner: { mustEmitCandidate: true }
decoys:
- id: swift-non-keychain-decoy
file: Keychain.swift
line: 14
forbiddenSlugs: [swift-keychain-no-access-control]
16 changes: 16 additions & 0 deletions bench/tasks/swift-keychain-no-access/source/Keychain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Foundation
import Security

func storeTokenVulnerable(_ token: String) {
let query: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrAccount as String: "auth-token",
kSecValueData as String: token.data(using: .utf8)!,
]
SecItemAdd(query as CFDictionary, nil)
}

func formatTokenPreview(_ token: String) -> String {
let prefix = token.prefix(6)
return "token: \(prefix)…"
}
9 changes: 9 additions & 0 deletions bench/tasks/swift-keychain-no-access/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 = "Under-covered Phase-3 language fixture. Swift SecItemAdd keychain insertion without kSecAttrAccessControl — item readable without auth prompt."

[labels]
change_rule = "freeze"
Loading