dimihycks / WebGoat

WebGoat is a deliberately insecure application
https://owasp.org/www-project-webgoat/
Other
0 stars 0 forks source link

CX Second_Order_SQL_Injection @ src/main/java/org/owasp/webgoat/container/users/UserService.java [main] #3

Closed dimihycks closed 1 year ago

dimihycks commented 1 year ago

Second_Order_SQL_Injection issue exists @ src/main/java/org/owasp/webgoat/container/users/UserService.java in branch main

The application's createLessonsForUser method executes an SQL query with BinaryExpr, at line 52 of src\main\java\org\owasp\webgoat\container\users\UserService.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.The attacker may be able to write arbitrary data to the database, which is then retrieved by the application with webGoatUser in addUser method at line 42 of src\main\java\org\owasp\webgoat\container\users\UserService.java. This data then flows through the code, until it is used directly in the SQL query without sanitization, and then submitted to the database server for execution.This may enable a Second-Order SQL Injection attack.Similarity ID: -1373965491

Severity: High

CWE:89

Vulnerability details and guidance

Checkmarx

Training Recommended Fix

Lines: 42


Code (Line #42):

var webGoatUser = userRepository.save(new WebGoatUser(username, password));

dimihycks commented 1 year ago

Issue still exists.

dimihycks commented 1 year ago

Issue still exists.