• Hi @JRaman655537 (Community Member)​,

     

    Veracode Static Analysis reports CWE 80 (XSS) when a value from outside the application is used in a `.attr(element, value)` statement. The reason is that if `value` is potentially user-controlled, and `element` points to a DOM element that accepts JavaScript (such as `onclick`, `onerror`, `src`, etc.), an attacker could abuse this to execute arbitrary JavaScript in a victim's web browser.

     

    In your scenario, you're setting the `value` of an `option` HTML element. Since this kind of element does not accept JavaScript but is an innocuous HTML element, there is no risk of XSS here and I would recommend proposing a mitigation by design and discussing it with your organization's Security Team. For more information on how to propose a mitigation, please refer to: https://docs.veracode.com/r/improve_mitigation.

     

    Thank you,

    Florian Walter

    Expand Post

Topics (3)

No articles found
Loading

Ask the Community

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