Checkmarx-jharris / JavaVulnerableLab

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

CX Reflected_XSS_All_Clients @ src/main/webapp/vulnerability/SendMessage.jsp [master] #85

Open jharriscx opened 3 years ago

jharriscx commented 3 years ago

Reflected_XSS_All_Clients issue exists @ src/main/webapp/vulnerability/SendMessage.jsp in branch master

The application's out.print embeds untrusted data in the generated output with print, at line 11 of src\main\webapp\vulnerability\SendMessage.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 simply providing modified data in the user input ""status"", which is read by the out.print method at line 11 of src\main\webapp\vulnerability\SendMessage.jsp. 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

Checkmarx

Training Recommended Fix

Lines: 18 11


Code (Line #18):

<tr><td>Recipient: </td><td><input type="text" name="recipient" value="<% if(request.getParameter("recipient")!=null){ out.print(request.getParameter("recipient")); } %>"/></td></tr>

Code (Line #11):

       out.print(request.getParameter("status")); //Displaying any error message

jharriscx commented 3 years ago

Issue still exists.

jharriscx commented 3 years ago

Issue still exists.