High severityJavaSSRF & Path TraversalHIGH confidence
Path Traversal Tainted Input
Untrusted request input is used to build a filesystem path, enabling path traversal / arbitrary file access (CWE-22).
Standards mapping
- OWASP Top 10
- A01:2021 - Broken Access Control
- OWASP ASVS
- V12.3.1 (L1)
Vulnerable vs. safe
Flagged by this check
File f = new File(req.getParameter("file"));Passes - the safe pattern
File ok = new File("/var/data/report.pdf");Why it matters & how to fix it
Untrusted request input is used to build a filesystem path, enabling path traversal / arbitrary file access (CWE-22). Sequences like '../' let an attacker escape the intended directory. Canonicalize the resolved path (File.getCanonicalPath / Path.normalize) and verify it still starts with the intended base directory before opening it; reject absolute paths and separators in the input.
References
Rule ID integsec-java-path-traversal-taint - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - SSRF & Path TraversalPath Join With Request
- JavaScript / TypeScript - SSRF & Path TraversalPath Traversal Tainted Input
- JavaScript / TypeScript - SSRF & Path TraversalSSRF Outbound Request Tainted Input
- Python - SSRF & Path TraversalPath Traversal
- Python - SSRF & Path TraversalSSRF HTTP Request
- Java - SSRF & Path TraversalSSRF Tainted Input