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
24 changes: 24 additions & 0 deletions bench/tasks/java-jwt-none-deserialize/answer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
issues:
- id: java-deserialize-objectinputstream-001
file: AuthService.java
severity: HIGH
cwe: CWE-502
vulnSlugs: [java-deserialize-objectinputstream, rce-deserialization]
location: { startLine: 9, endLine: 10, tolerance: 2 }
scanner: { mustEmitCandidate: true }
- id: java-jwt-none-001
file: AuthService.java
severity: HIGH
cwe: CWE-347
vulnSlugs: [java-jwt-none]
location: { startLine: 18, endLine: 18, tolerance: 2 }
scanner: { mustEmitCandidate: true }
decoys:
- id: java-json-parse-decoy
file: AuthService.java
line: 14
forbiddenSlugs: [java-deserialize-objectinputstream, rce-deserialization]
- id: java-jwt-hmac256-decoy
file: AuthService.java
line: 22
forbiddenSlugs: [java-jwt-none]
26 changes: 26 additions & 0 deletions bench/tasks/java-jwt-none-deserialize/source/AuthService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.example.auth;

import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;

public class AuthService {

public Object restoreSessionVulnerable(byte[] bytes) throws Exception {
var ois = new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(bytes));
return ois.readObject();
}

public Object restoreSessionSafe(String json) throws Exception {
return JsonParser.parse(json);
}

public String verifyTokenVulnerable(String token) {
return JWT.require(Algorithm.none()).build().verify(token).getSubject();
}

public String verifyTokenSafe(String token, String secret) {
return JWT.require(Algorithm.HMAC256(secret)).build().verify(token).getSubject();
}

static class JsonParser { static Object parse(String s) { return s; } }
}
7 changes: 7 additions & 0 deletions bench/tasks/java-jwt-none-deserialize/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>auth-fixture</artifactId>
<version>0.0.1</version>
</project>
9 changes: 9 additions & 0 deletions bench/tasks/java-jwt-none-deserialize/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 per CLAUDE.md project invariant. Java JWT alg=none + native ObjectInputStream.readObject deserialization."

[labels]
change_rule = "freeze"
20 changes: 20 additions & 0 deletions bench/tasks/kotlin-jdbc-runtime-exec/answer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
issues:
- id: kt-jdbc-sqli-001
file: UserDao.kt
severity: HIGH
cwe: CWE-89
vulnSlugs: [kt-jdbc-string-template-sqli, sql-injection]
location: { startLine: 12, endLine: 12, tolerance: 2 }
scanner: { mustEmitCandidate: true }
- id: kt-runtime-exec-001
file: UserDao.kt
severity: HIGH
cwe: CWE-78
vulnSlugs: [kt-runtime-exec-template, command-injection]
location: { startLine: 17, endLine: 17, tolerance: 2 }
scanner: { mustEmitCandidate: true }
decoys:
- id: kt-processbuilder-list-decoy
file: UserDao.kt
line: 22
forbiddenSlugs: [kt-runtime-exec-template, command-injection]
26 changes: 26 additions & 0 deletions bench/tasks/kotlin-jdbc-runtime-exec/source/UserDao.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.example.app

import java.sql.Connection
import java.sql.Statement
import javax.sql.DataSource

class UserDao(private val ds: DataSource) {

fun findVulnerable(name: String): String? {
val c: Connection = ds.connection
val stmt: Statement = c.createStatement()
val rs = stmt.executeQuery("SELECT email FROM users WHERE name = '$name'")
return if (rs.next()) rs.getString(1) else null
}

fun convertVulnerable(filename: String): Int {
val p = Runtime.getRuntime().exec("convert $filename out.png")
return p.waitFor()
}

fun convertSafe(filename: String): Int {
val pb = ProcessBuilder("convert", filename, "out.png")
val p = pb.start()
return p.waitFor()
}
}
7 changes: 7 additions & 0 deletions bench/tasks/kotlin-jdbc-runtime-exec/source/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
kotlin("jvm") version "1.9.0"
}

dependencies {
implementation("org.postgresql:postgresql:42.7.1")
}
9 changes: 9 additions & 0 deletions bench/tasks/kotlin-jdbc-runtime-exec/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 per CLAUDE.md project invariant. Kotlin string-template SQLi + Runtime.exec template."

[labels]
change_rule = "freeze"
13 changes: 13 additions & 0 deletions bench/tasks/swift-process-format/answer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
issues:
- id: swift-system-call-001
file: Tool.swift
severity: HIGH
cwe: CWE-78
vulnSlugs: [swift-eval-injection, command-injection]
location: { startLine: 4, endLine: 4, tolerance: 2 }
scanner: { mustEmitCandidate: true }
decoys:
- id: swift-system-literal-decoy
file: Tool.swift
line: 8
forbiddenSlugs: [swift-eval-injection]
9 changes: 9 additions & 0 deletions bench/tasks/swift-process-format/source/Tool.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Foundation

func runConvertVulnerable(_ tool: String) -> Int32 {
return system(tool)
}

func runConvertSafe() -> Int32 {
return system("/usr/bin/convert /tmp/in.png /tmp/out.png")
}
9 changes: 9 additions & 0 deletions bench/tasks/swift-process-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 = "Under-covered Phase-3 language fixture per CLAUDE.md project invariant. Swift Process() command-injection with argv built from input. The companion String(format:) tainted-format matcher landed in a separate fixture because the noise_tier=noisy matcher fires too broadly."

[labels]
change_rule = "freeze"
Loading