-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Checkmarx (SAST): SQL_Injection
Security Issue: Read More about SQL_Injection
Checkmarx Project: YSLCx/workshop_demo
Repository URL: https://github.com/YSLCx/workshop_demo
Branch: main
Scan ID: 85f0b871-dd27-420e-95e1-91e06302f579
The application's main method executes an SQL query with executeQuery, at line 37 of /Login.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 ""password""; this input is then read by the main method at line 22 of /Login.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.
Result #1:
Severity: HIGH
State: TO_VERIFY
Status: RECURRENT
Attack Vector:
1. ""password"": /Login.java[22,49]
2. getParameter: /Login.java[22,48]
3. token: /Login.java[22,20]
4. token: /Login.java[25,95]
5. sql: /Login.java[25,20]
6. sql: /Login.java[37,59]
7. executeQuery: /Login.java[37,58]
Review result in Checkmarx One: SQL_Injection
Result #2:
Severity: HIGH
State: TO_VERIFY
Status: RECURRENT
Attack Vector:
1. ""email"": /Login.java[21,49]
2. getParameter: /Login.java[21,48]
3. email: /Login.java[21,20]
4. email: /Login.java[25,66]
5. sql: /Login.java[25,20]
6. sql: /Login.java[37,59]
7. executeQuery: /Login.java[37,58]
Review result in Checkmarx One: SQL_Injection