High severityJavaInjectionHIGH confidence
SQL Injection Tainted Input
Untrusted request input flows into a JDBC statement executed as a raw SQL string.
Standards mapping
- OWASP Top 10
- A03:2021 - Injection
- OWASP ASVS
- V5.3.4 (L1)
Vulnerable vs. safe
Flagged by this check
stmt.executeQuery(req.getParameter("id"));Passes - the safe pattern
PreparedStatement ps = conn.prepareStatement("SELECT * FROM users WHERE id = ?");Why it matters & how to fix it
Untrusted request input flows into a JDBC statement executed as a raw SQL string. This enables SQL injection (CWE-89). Use a PreparedStatement with bound parameters ('?' placeholders and setXxx) instead of building the query with string concatenation. For Spring, use parameterized JdbcTemplate queries (query(sql, args) / NamedParameterJdbcTemplate).
References
Rule ID integsec-java-sql-injection-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 - InjectionCode Injection Tainted Input
- JavaScript / TypeScript - InjectionEval Dynamic Argument
- JavaScript / TypeScript - InjectionNoSQL Query From Request
- JavaScript / TypeScript - InjectionNoSQL Where Operator
- JavaScript / TypeScript - InjectionOS Command Injection Tainted Input
- JavaScript / TypeScript - InjectionSQL Injection String Concatenation