wwesleyalves / WebGoat2

Other
0 stars 0 forks source link

CX Reflected_XSS_All_Clients @ webgoat-lessons/crypto/src/main/java/org/owasp/webgoat/crypto/HashingAssignment.java [main] #33

Open wwesleyalves opened 1 year ago

wwesleyalves commented 1 year ago

Reflected_XSS_All_Clients issue exists @ webgoat-lessons/crypto/src/main/java/org/owasp/webgoat/crypto/HashingAssignment.java in branch main

*The method getMd5 embeds untrusted data in generated output with md5Hash, at line 64 of webgoat-lessons\crypto\src\main\java\org\owasp\webgoat\crypto\HashingAssignment.java. This untrusted data is embedded into the output without proper sanitization or encoding, enabling an attacker to inject malicious code into the generated web-page.The attacker would be able to alter the returned web page by simply providing modified data in the user input request, which is read by the getMd5 method at line 49 of webgoat-lessons\crypto\src\main\java\org\owasp\webgoat\crypto\HashingAssignment.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.Similarity ID: -1151450560

The method getSha256 embeds untrusted data in generated output with sha256, at line 78 of webgoat-lessons\crypto\src\main\java\org\owasp\webgoat\crypto\HashingAssignment.java. This untrusted data is embedded into the output without proper sanitization or encoding, enabling an attacker to inject malicious code into the generated web-page.The attacker would be able to alter the returned web page by simply providing modified data in the user input request, which is read by the getSha256 method at line 69 of webgoat-lessons\crypto\src\main\java\org\owasp\webgoat\crypto\HashingAssignment.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.Similarity ID: 1104571482*

Severity: High

CWE:79

Vulnerability details and guidance

Checkmarx

Training Recommended Fix

Lines: 49 69


Code (Line #49):

public String getMd5(HttpServletRequest request) throws NoSuchAlgorithmException {

Code (Line #69):

public String getSha256(HttpServletRequest request) throws NoSuchAlgorithmException {

wwesleyalves commented 1 year ago

Issue still exists.

wwesleyalves commented 1 year ago

Issue still exists.