jharrisDeFy / JavaVulnerableLab

GNU General Public License v2.0
0 stars 0 forks source link

CX Stored_XSS @ src/main/webapp/vulnerability/UserDetails.jsp [refs/heads/master] #60

Closed jharrisDeFy closed 3 years ago

jharrisDeFy commented 3 years ago

Stored_XSS issue exists @ src/main/webapp/vulnerability/UserDetails.jsp in branch refs/heads/master

The application's out.print embeds untrusted data in the generated output with print, at line 16 of src\main\webapp\vulnerability\UserDetails.jsp. This untrusted data is embedded straight into the output without proper sanitization or encoding, enabling an attacker to inject malicious code into the output. The attacker would be able to alter the returned web page by saving malicious data in a data-store ahead of time. The attacker's modified data is then read from the database by the rs=stmt.executeQuery method with rs, at line 13 of src\main\webapp\vulnerability\UserDetails.jsp. This untrusted data then flows through the code straight to the output web page, without sanitization.  This can enable a Stored Cross-Site Scripting (XSS) attack.

Severity: High

CWE:79

Vulnerability details and guidance

Checkmarx

Training Recommended Fix

Lines: 13


Code (Line #13):

             rs=stmt.executeQuery("select * from users where username='"+username+"'");

jharrisDeFy commented 3 years ago

Issue still exists.