Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Security Finding: Cross-Site Scripting (CWE-79, High Severity) in AbstractServlet.java:94 #72

Open
2 tasks
joshn-whitesource-app bot opened this issue Feb 7, 2024 · 0 comments
Labels
Mend: code security findings Code security findings detected by Mend

Comments

@joshn-whitesource-app
Copy link
Contributor

joshn-whitesource-app bot commented Feb 7, 2024

Code Security Finding

This finding was first detected on 2024-02-07 12:17am GMT and is still present in the last scan performed on 2024-02-15 10:26pm GMT:

SeverityVulnerability TypeCWEFileData Flows
HighCross-Site Scripting

CWE-79

AbstractServlet.java:94

12
Vulnerable Code

writer.write("</td>");
}
writer.write("</tr>");
writer.write("</table>");
writer.write("<hr style=\"margin-top:0px\">");
writer.write(htmlBody);

12 Data Flow/s detected
View Data Flow 1

"<input type=\"text\" name=\"number\" size=\"1\" maxlength=\"1\" value=" + strNumber + ">");

responseToClient(req, res, getMsg("title.truncationerror.page", locale), bodyHtml.toString());

responseToClient(req, res, getMsg("title.truncationerror.page", locale), bodyHtml.toString());

responseToClient(req, res, getMsg("title.truncationerror.page", locale), bodyHtml.toString());

protected void responseToClient(HttpServletRequest req, HttpServletResponse res, String htmlTitle, String htmlBody) {

View Data Flow 2

String strNumber = req.getParameter("number");

bodyHtml.append("<input type=\"text\" name=\"number\" size=\"1\" maxlength=\"1\" value=" + strNumber + ">");

bodyHtml.append("<input type=\"text\" name=\"number\" size=\"1\" maxlength=\"1\" value=" + strNumber + ">");

responseToClient(req, res, getMsg("title.roundofferror.page", locale), bodyHtml.toString());

responseToClient(req, res, getMsg("title.roundofferror.page", locale), bodyHtml.toString());

responseToClient(req, res, getMsg("title.roundofferror.page", locale), bodyHtml.toString());

protected void responseToClient(HttpServletRequest req, HttpServletResponse res, String htmlTitle, String htmlBody) {

View Data Flow 3

bodyHtml.append("<td>" + pingURL + "</td></tr>");

bodyHtml.append("<td>" + pingURL + "</td></tr>");

responseToClient(req, res, getMsg("title.netsocketleak.page", locale), bodyHtml.toString());

responseToClient(req, res, getMsg("title.netsocketleak.page", locale), bodyHtml.toString());

responseToClient(req, res, getMsg("title.netsocketleak.page", locale), bodyHtml.toString());

protected void responseToClient(HttpServletRequest req, HttpServletResponse res, String htmlTitle, String htmlBody) {

View more Data Flows

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Cross-Site Scripting Training

● Videos

   ▪ Secure Code Warrior Cross-Site Scripting Video

🏴 Suppress Finding
  • ... as False Alarm
  • ... as Acceptable Risk
@joshn-whitesource-app joshn-whitesource-app bot added the Mend: code security findings Code security findings detected by Mend label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mend: code security findings Code security findings detected by Mend
Projects
None yet
Development

No branches or pull requests

0 participants