CSS Sec Design
CSS Sec Design
Alert: Eliminating
Cross-Site Scripting
Vulnerabilities
Cross-site scripting vulnerabilities arise when manufacturers fail to properly validate, sanitize, or escape inputs. These
failures allow threat actors to inject malicious scripts into web applications, exploiting them to manipulate, steal, or
misuse data across different contexts. Although some developers employ input sanitization techniques to prevent XSS
vulnerabilities, this approach is not infallible and should be reinforced with additional security measures.
CISA and FBI urge CEOs and other business leaders at technology manufacturers to direct their technical leaders/teams
to review past instances of these defects and create a strategic plan to prevent them in the future.
https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html
3 Computer Security Division, Information Technology Laboratory, National Institute of Standards and Technology, U.S. Department of
Despite this finding, cross-site scripting vulnerabilities—many of which are the result of CWE-79—remain a prevalent class
of defect. 4
Adopting standard best practices, such as those mentioned above, can help manufacturers root out cross-site scripting
vulnerabilities at the source, as opposed to depending on customers to apply fixes. Automated safeguards should be
implemented to prevent software from utilizing unsafe functions, complemented by the use of static analysis tools to
identify improper handling of user input. These measures, combined with rigorous code reviews, can detect flaws before
software deployment.
Additionally, senior executives at software manufacturers must take accountability for customer security starting by
regularly testing and conducting code reviews to assess product susceptibility to exploitation. Guidance from
organizations like the Open Web Application Security Project (OWASP) and others offers proven methods and techniques
for conducting thorough testing.
Many, but not all, cross-site scripting vulnerabilities are the result of CWE-79. As such, manufacturers should identify and
document the root causes of cross-site scripting vulnerabilities and declare it a business goal to work toward eliminating
the entire class. Software manufacturers should also maintain a modern vulnerability disclosure program (VDP). Note:
CISA provides resources to assist organizations in establishing and maintaining a VDP.
4 “2023 CWE Top 25 Most Dangerous Software Weaknesses.” MITRE’s CWE Top 25, 2023.
https://cwe.mitre.org/top25/archive/2023/2023_top25_list.html
5 Common Weakness Enumeration (CWE) classification identifies classes of software/hardware weaknesses (including vulnerabilities and
defects); Common Vulnerabilities and Exposures (CVE) classification identifies and labels unique vulnerabilities in specific
software/hardware products.
• Give the security of their products the same level of care they give to cost.
• Consider the full picture: that customers, our economy, and our national security are currently bearing the brunt
of business decisions to not build security into their products.
• Be aware that fully implementing secure by design software development can reduce financial and productivity
costs as well as complexity.
• Make the appropriate investments and develop the right incentive structures that promote security as a stated
business goal.
• Lead programs to root out entire classes of vulnerability rather than addressing them on a case-by-case basis.
• Establish organizational structures that prioritize proactive measures, such as adopting standard best practices,
to root out cross-site scripting vulnerabilities at the source.
• Ensure their organization conducts reviews to detect common and well-known vulnerabilities, like cross-site
scripting, to determine their susceptibility, and implement the existing effective and documented mitigations.
o Organizations should conduct these reviews continually to root out classes of vulnerability, as some
classes of defect may change or develop over time.
o Executives should request regular updates to assess: (1) the company’s progress at identifying recurring
classes of vulnerability, (2) the company’s progress to eliminate them, and (3) the appropriate resources
needed to continue making progress.
This Secure by Design Alert is part of an ongoing series that aims to advance industry-wide best practices that eliminate
entire classes of vulnerability during the design and development phases of the product development lifecycle. Through
the Secure by Design initiative, we seek to foster a cultural shift across the industry by normalizing the development of
technology products that are secure to use out of the box. Visit cisa.gov to learn more about the principles of Secure by
Design, take the Secure by Design Pledge, and stay informed on the latest Secure by Design Alerts.
Disclaimer
The information in this report is being provided “as is” for informational purposes only. The authoring organizations do not
endorse any commercial entity, product, company, or service, including any entities, products, or services linked within
this document. Any reference to specific commercial entities, products, processes, or services by service mark,
trademark, manufacturer, or otherwise, does not constitute or imply endorsement, recommendation, or favoring by the
authoring organizations.