Prevelate / WebGoat.NET

OWASP WebGoat.NET
0 stars 0 forks source link

CX Reflected_XSS_All_Clients @ WebGoat/WebGoatCoins/ProductDetails.aspx.cs [master] #24

Open Prevelate opened 4 years ago

Prevelate commented 4 years ago

Reflected_XSS_All_Clients issue exists @ WebGoat/WebGoatCoins/ProductDetails.aspx.cs in branch master

Method LoadComments at line 53 of WebGoat\WebGoatCoins\ProductDetails.aspx.cs gets user input for the prodRow element. This element’s value then flows through the code without being properly sanitized or validated and is eventually displayed to the user in method LoadComments at line 53 of WebGoat\WebGoatCoins\ProductDetails.aspx.cs. This may enable a Cross-Site-Scripting attack.

Severity: High

CWE:79

Vulnerability details and guidance

Checkmarx

Lines: 64 65 68 76 77 63


Code (Line #64):

                output += "<strong>" + prodRow["productName"].ToString() + "</strong><br/>";

Code (Line #65):

                output += "<hr/>" + prodRow["productDescription"].ToString() + "<br/>";

Code (Line #68):

                hiddenFieldProductID.Value = prodRow["productCode"].ToString();

Code (Line #76):

                    comments += "<strong>Email:</strong>" + commentRow["email"] + "<span style='font-size: x-small;color: #E47911;'> (Email Address Verified!) </span><br/>";

Code (Line #77):

                    comments += "<strong>Comment:</strong><br/>" + commentRow["comment"] + "<br/><hr/>";

Code (Line #63):

                output += "<img src='./images/products/" + prodRow["productImage"] + "'/><br/>";

Prevelate commented 4 years ago

Issue still exists.