CWE Top 25, #1: Cross-site scripting
Cross-site scripting (CWE-79) · facts checked 2026-10-04
The facts
- Cross-site scripting, tracked as CWE-79, happens when a site takes input an attacker can influence and puts it into pages shown to other users without first making it safe. (MITRE)
- Cross-site scripting ranked first in MITRE's 2025 CWE Top 25 Most Dangerous Software Weaknesses, holding the same position it had in 2024. (MITRE)
- MITRE says the most common cross-site scripting attack exposes private information kept in users' cookies, such as session data. (MITRE)
- In September 2024, CISA and the FBI published a Secure by Design Alert stating that cross-site scripting flaws are preventable and have no place in software products. (CISA)
The panel
Jordan Pike AI host
MITRE says cross-site scripting, tracked as CWE-79, happens when a site takes input an attacker can influence and puts it into pages shown to other users without first making it safe. MITRE's 2025 CWE Top 25 Most Dangerous Software Weaknesses ranks it first, the same position it held in 2024.
Jordan Pike AI host
MITRE says the most common cross-site scripting attack exposes private information kept in users' cookies, such as session data. In September 2024, CISA and the FBI published a Secure by Design Alert stating that cross-site scripting flaws are preventable and have no place in software products.
Jordan Pike AI host
Who should care: anyone who builds, runs or buys a web application, so roughly everyone. Dex, walk us through how this goes from a bug in a page to a bad day.
Dex Moreno AI analyst
Start with the trust problem. Your browser trusts whatever a site puts in its pages, so if an attacker can influence something the site later shows to other people, their content rides along as if the site wrote it. The victim just has to view the page. Because MITRE says the classic payoff is session data in cookies, the foothold is often a logged-in session. With it, an attacker could act as that user, and if the user is an admin, the help desk or a finance approver, that session becomes a stepping stone to everything that account can reach.
Dex Moreno AI analyst
Honestly, a bug that turns the victim's own browser into the delivery mechanism? Eight out of ten for elegance. The target deserved better, obviously.
Jordan Pike AI host
Dex, we are not rating it out of ten.
Maya Okafor AI analyst
The bug class is simple: untrusted input crosses into output without being made safe for where it lands. The trap is that safe depends on context. What is fine in body text is dangerous inside an attribute or a script block. That is why a blocklist of bad strings is a partial fix, and attackers love partial fixes. A complete fix handles the output side, using the framework's built-in escaping by default and treating every raw-output escape hatch as a code review flag.
Maya Okafor AI analyst
Adding it to the tally of bug classes that should have died in two thousand four. It is still ranked first, so the tally is not shrinking.
Jordan Pike AI host
CISA and the FBI call these flaws preventable. So where do defenders start?
Maya Okafor AI analyst
Fix the pattern, not the one page that got reported. When you patch one instance, look at its siblings: other places that show user-influenced data, other templates, other output contexts. Check that the fix lives in a shared mechanism, not a one-off patch. And ask vendors whether they have done root-cause analysis, because a patch without one tends to come back.
Dex Moreno AI analyst
I'll push back slightly. Fixing the code is the right goal, but it is slow, and exposure comes first. Meanwhile, assume a session may already have been taken. Limit what any one session can do, require fresh sign-in for sensitive actions, and know how to invalidate sessions in bulk. Hardening that keeps session tokens away from page scripts also shrinks the prize, but it is a bridge, not the fix.
Maya Okafor AI analyst
I agree on the bridge, as long as it has an end date. Mitigations that quietly become permanent are how this bug class stays number one.
Jordan Pike AI host
So: Monday morning? Developers, make safe output the default and review every exception. Security teams, check sibling pages after any fix and make sure you can kill sessions fast. Buyers, ask your vendors how they prevent this class, since CISA says it should not be in products at all.





