dimihycks / WebGoat

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

CX Reflected_XSS_All_Clients @ src/main/java/org/owasp/webgoat/lessons/cryptography/HashingAssignment.java [main] #9

Closed dimihycks closed 1 year ago

dimihycks commented 1 year ago

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

*The method getMd5 embeds untrusted data in generated output with md5Hash, at line 62 of src\main\java\org\owasp\webgoat\lessons\cryptography\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 48 of src\main\java\org\owasp\webgoat\lessons\cryptography\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: 1722817758

The method getSha256 embeds untrusted data in generated output with sha256, at line 76 of src\main\java\org\owasp\webgoat\lessons\cryptography\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 67 of src\main\java\org\owasp\webgoat\lessons\cryptography\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: -1734485512*

Severity: High

CWE:79

Vulnerability details and guidance

Checkmarx

Training Recommended Fix

Lines: 48 67


Code (Line #48):

public String getMd5(HttpServletRequest request) throws NoSuchAlgorithmException {

Code (Line #67):

public String getSha256(HttpServletRequest request) throws NoSuchAlgorithmException {

dimihycks commented 1 year ago

Issue still exists.

dimihycks commented 1 year ago

Issue still exists.