GDiaz136520 (Community Member) asked a question.

How to fix Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

My app scan detects that error (in the subject) and I woul like to know how to resolve it. It says that MoveNext() method is the root cause, and I wonder if any person in this forum knows how to resolve it,

Thank you very much


SakesYordi likes this.
  • SamHouston (Veracode)

    Hi @GDiaz136520 (Community Member)​ -

     

    The vulnerability "Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)" is identified by CWE ID 80. This is a common type of cross-site scripting (XSS) vulnerability that occurs when an application does not properly sanitize user input before including it in a web page. This can allow an attacker to inject malicious scripts that can then be executed by other users' browsers.

     

    To fix this vulnerability, you should:

    1. Sanitize all user input: Before displaying any user-provided content on a web page, ensure that it is properly sanitized to remove or neutralize any potentially harmful HTML or script tags.
    2. Use output encoding: When displaying user-provided data in HTML, use appropriate output encoding to ensure that special characters are treated as data rather than executable code.

     

    Additional info here:

    https://www.veracode.com/security/java/cwe-80/

     

    We also have some suggested mitigations here:

    https://community.veracode.com/s/question/0D53n00009hkFbHCAU/how-to-fix-cwe80-in-javascript-while-using-html

     

     

    Expand Post
    • GDiaz136520 (Community Member)

      Dear SamHouston,

      Thank you very much for your help.

      Really appreciate it, I will share this information with the development team.

      Best regards,

      Gerardo D

       

      Expand Post

Topics (1)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.