CX SQL_Injection @ src/main/java/org/owasp/benchmark/testcode/BenchmarkTest01008.java [main]
SQL_Injection issue exists @ src/main/java/org/owasp/benchmark/testcode/BenchmarkTest01008.java in branch main
*The application's doPost method executes an SQL query with queryForRowSet, at line 70 of src\main\java\org\owasp\benchmark\testcode\BenchmarkTest01008.java. The application constructs this SQL query by embedding an untrusted string into the query without proper sanitization. The concatenated string is submitted to the database, where it is parsed and executed accordingly. An attacker would be able to inject arbitrary syntax and data into the SQL query, by crafting a malicious payload and providing it via the input getValue; this input is then read by the doPost method at line 59 of src\main\java\org\owasp\benchmark\testcode\BenchmarkTest01008.java. This input then flows through the code, into a query and to the database server - without sanitization. This may enable an SQL Injection attack. Similarity ID: 1910570104
The application's doPost method executes an SQL query with queryForRowSet, at line 70 of src\main\java\org\owasp\benchmark\testcode\BenchmarkTest01008.java. The application constructs this SQL query by embedding an untrusted string into the query without proper sanitization. The concatenated string is submitted to the database, where it is parsed and executed accordingly. An attacker would be able to inject arbitrary syntax and data into the SQL query, by crafting a malicious payload and providing it via the input getCookies; this input is then read by the doPost method at line 53 of src\main\java\org\owasp\benchmark\testcode\BenchmarkTest01008.java. This input then flows through the code, into a query and to the database server - without sanitization. This may enable an SQL Injection attack. Similarity ID: 798315543*
Severity: High
CWE:89
Vulnerability details and guidance
javax.servlet.http.Cookie[] theCookies = request.getCookies();
param = java.net.URLDecoder.decode(theCookie.getValue(), "UTF-8");