mgonzalezcx / WebGoat

WebGoat is a deliberately insecure application
https://webgoat.github.io/WebGoat/
Other
0 stars 0 forks source link

CX Reflected_XSS_All_Clients @ webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionChallenge.java [develop] #32

Open mgonzalezcx opened 2 years ago

mgonzalezcx commented 2 years ago

Reflected_XSS_All_Clients issue exists @ webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionChallenge.java in branch develop

The application's registerNewUser embeds untrusted data in the generated output with attackResult, at line 56 of webgoat-lessons\sql-injection\src\main\java\org\owasp\webgoat\sql_injection\advanced\SqlInjectionChallenge.java. 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 simply providing modified data in the user input username_reg, which is read by the registerNewUser method at line 56 of webgoat-lessons\sql-injection\src\main\java\org\owasp\webgoat\sql_injection\advanced\SqlInjectionChallenge.java. This input then flows through the code straight to the output web page, without sanitization.  This can enable a Reflected Cross-Site Scripting (XSS) attack.

Severity: High

CWE:79

Vulnerability details and guidance

Internal Guidance

Checkmarx

Training Recommended Fix

Lines: 56


Code (Line #56):

    public AttackResult registerNewUser(@RequestParam String username_reg, @RequestParam String email_reg, @RequestParam String password_reg) throws Exception {