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

Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) #300

Open
my-veracode bot opened this issue Mar 18, 2021 · 0 comments
Open
Labels
Severity: Medium A Veracode Flaw, Medium severity Veracode A Veracode identified issue

Comments

@my-veracode
Copy link

my-veracode bot commented Mar 18, 2021

Description:

This call to javax.servlet.jsp.JspWriter.print() contains a cross-site scripting (XSS) flaw. The application populates the HTTP response with untrusted input, allowing an attacker to embed malicious content, such as Javascript code, which will be executed in the context of the victim's browser. XSS vulnerabilities are commonly exploited to steal or manipulate cookies, modify presentation of content, and compromise confidential information, with new attack vectors being discovered on a regular basis. The first argument to print() contains tainted data from the variable blab_name. The tainted data originated from an earlier call to java.sql.PreparedStatement.executeQuery. The tainted data is directed into an output stream returned by javax.servlet.jsp.JspWriter.

Use contextual escaping on all untrusted data before using it to construct any portion of an HTTP response. The escaping method should be chosen based on the specific use case of the untrusted data, otherwise it may not protect fully against the attack. For example, if the data is being written to the body of an HTML page, use HTML entity escaping; if the data is being written to an attribute, use attribute escaping; etc. Both the OWASP Java Encoder library and the Microsoft AntiXSS library provide contextual escaping methods. For more details on contextual escaping, see https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.md. In addition, as a best practice, always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible.

  • Veracode issue ID: 296
  • Severity: Medium
  • Location: /WEB-INF/views/blab.jsp:57
  • Issue found on build: 11256520
  • Issue first found at: Tue, 05 Jan 2021 04:12:30 GMT
  • Scanner: Veracode Static Application Security Testing

Identifiers:

@my-veracode my-veracode bot added Severity: Medium A Veracode Flaw, Medium severity Veracode A Veracode identified issue labels Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Severity: Medium A Veracode Flaw, Medium severity Veracode A Veracode identified issue
Projects
None yet
Development

No branches or pull requests

0 participants