MITRE's Top 10 Most Dangerous Software Weaknesses: From XSS and SQL Injection to the Command-Injection and Memory Bugs Attackers Actually Exploit

The top 10 of MITRE's official 2025 CWE Top 25 explained: what each weakness is, why it is dangerous and how to stop it, plus MITRE's Top 10 list of weaknesses behind exploited vulnerabilities.
Overview
Every year MITRE, which runs the CWE (Common Weakness Enumeration) programme with sponsorship from the US Cybersecurity and Infrastructure Security Agency (CISA), publishes the CWE Top 25 Most Dangerous Software Weaknesses. It is the official ranking of the coding mistakes behind the most vulnerabilities, weighted by how severe those vulnerabilities are. The current edition is the 2025 CWE Top 25. MITRE has not published a 2026 edition, so lists circulating online under that name are not official.
This report covers the top 10 of that list: what each weakness is, why attackers love it, and how to stop it. MITRE also publishes a second list, the Top 10 KEV Weaknesses, which ranks only weaknesses behind vulnerabilities that attackers have actually exploited, as recorded in CISA's Known Exploited Vulnerabilities (KEV) catalog. We show both, because the most common bug is not always the most exploited one.
How MITRE Ranks Them
- Data: 39,080 CVE records published between 1 June 2024 and 1 June 2025.
- Score: how often a weakness appears, multiplied by the average CVSS severity of its vulnerabilities. A weakness ranks high if it is both common and severe.
- KEV column: how many of that weakness's vulnerabilities in the period are on CISA's list of vulnerabilities exploited in the wild.
- Top 10 KEV list: built from 182 exploited CVE records in the same period, ranked by how often each weakness appears and how severe those exploited vulnerabilities are.
The Top 10 at a Glance
- #1 Cross-site Scripting (CWE-79): score 60.38 · 7 exploited CVEs · unchanged
- #2 SQL Injection (CWE-89): 28.72 · 4 exploited · up 1
- #3 Cross-Site Request Forgery (CWE-352): 13.64 · 0 exploited · up 1
- #4 Missing Authorization (CWE-862): 13.28 · 0 exploited · up 5
- #5 Out-of-bounds Write (CWE-787): 12.68 · 12 exploited · down 3
- #6 Path Traversal (CWE-22): 8.99 · 10 exploited · down 1
- #7 Use After Free (CWE-416): 8.47 · 14 exploited · up 1
- #8 Out-of-bounds Read (CWE-125): 7.88 · 3 exploited · down 2
- #9 OS Command Injection (CWE-78): 7.85 · 20 exploited · down 2
- #10 Code Injection (CWE-94): 7.57 · 7 exploited · up 1
1 Cross-site Scripting (CWE-79)
- What it is: a web application puts text from a user into a page without escaping it, so the browser runs it as code.
- Why it is dangerous: the attacker's script runs inside a trusted site. It can steal session cookies, change what the user sees, capture what they type or act on their behalf. This week's Optimizely incident showed how much damage injected JavaScript can do on trusted pages.
- How to stop it: use templating that escapes output by default, encode for the right context (HTML, attribute, URL, JavaScript), sanitise any user HTML with a proven library, and deploy a strict Content Security Policy.
2 SQL Injection (CWE-89)
- What it is: user input is pasted into a database query, so it can change the query itself.
- Why it is dangerous: attackers can read or delete whole databases, bypass logins and sometimes run commands on the server. It is decades old and still ranks second.
- How to stop it: always use parameterised queries or prepared statements, never build SQL by joining strings, give the application's database account the least privilege it needs, and validate input against strict allow-lists.
3 Cross-Site Request Forgery (CWE-352)
- What it is: a malicious site makes the victim's browser send a request to another site where they are logged in, and that site cannot tell the request was not intended.
- Why it is dangerous: an attacker can change passwords, email addresses or settings, or make transfers, using the victim's own session.
- How to stop it: use anti-CSRF tokens on every state-changing request, set session cookies with
SameSite=LaxorStrict, and ask the user to confirm sensitive actions again.
4 Missing Authorization (CWE-862)
- What it is: the application checks who you are but not whether you are allowed to do the action or see the data.
- Why it is dangerous: any logged-in user, or sometimes anyone at all, can read other people's records or call admin functions just by changing a URL or an ID. It jumped five places this year.
- How to stop it: deny by default, enforce permission checks on the server for every request and object (not just in the user interface), centralise the access-control logic, and test with a second, low-privilege account.
5 Out-of-bounds Write (CWE-787)
- What it is: a program, usually written in C or C++, writes data past the end of a memory buffer.
- Why it is dangerous: this is the classic path to remote code execution in browsers, operating systems, VPN appliances and firmware. It is 12 of the exploited vulnerabilities in the period, more than any other weakness in the top 5.
- How to stop it: prefer memory-safe languages (Rust, Go, Java, C#) for new code, use safe library functions with bounds checks, turn on compiler hardening and sanitisers, and fuzz any code that parses untrusted input.
6 Path Traversal (CWE-22)
- What it is: a file name from the user, such as
../../etc/passwd, lets them reach files outside the folder the application meant to use. - Why it is dangerous: attackers can read configuration files, keys and passwords, or overwrite files to get code execution. It is a regular in attacks on file-sharing and edge appliances (10 exploited CVEs).
- How to stop it: never build file paths from raw input, map user choices to IDs instead of names, normalise the path and check it is still inside the allowed folder, and run the service with minimal file permissions.
7 Use After Free (CWE-416)
- What it is: a program keeps using memory after it has been released, which an attacker can fill with data they control.
- Why it is dangerous: it is a favourite of zero-day exploits against browsers and operating-system kernels, with 14 exploited CVEs, the second most of any weakness on MITRE's exploited list.
- How to stop it: memory-safe languages, smart pointers and clear ownership rules in C++, setting pointers to null after freeing them, and continuous fuzzing with memory sanitisers.
8 Out-of-bounds Read (CWE-125)
- What it is: a program reads past the end of a buffer.
- Why it is dangerous: it leaks memory contents such as passwords, keys and pointers, which also helps attackers defeat protections like ASLR before a second exploit. Heartbleed was this kind of bug.
- How to stop it: the same as #5: bounds checking, memory-safe languages, hardening and fuzzing of parsers.
9 OS Command Injection (CWE-78)
- What it is: user input ends up inside a shell command that the server runs.
- Why it is dangerous: it gives the attacker direct command execution on the server, often as a privileged user. It ranks ninth on the overall list but is number one on MITRE's list of exploited weaknesses, with 20 exploited CVEs. Firewalls, routers, VPNs and other network devices are hit again and again.
- How to stop it: avoid calling the shell at all and use language APIs instead. If you must run a program, pass arguments as a list with no shell, and validate input against strict allow-lists.
10 Code Injection (CWE-94)
- What it is: the application builds code (for example with
eval, template engines or expression languages) from input that attackers can control. - Why it is dangerous: the attacker's input runs as program code inside the application, which means full compromise. There are 7 exploited CVEs.
- How to stop it: never
evaluser input, use sandboxed or logic-less templates, disable dangerous expression features, and validate input against strict allow-lists.
What Attackers Actually Exploit: MITRE's Top 10 KEV Weaknesses
MITRE's separate ranking of weaknesses behind vulnerabilities confirmed as exploited in the wild looks quite different:
- #1 OS Command Injection (CWE-78): 20 exploited CVEs
- #2 Use After Free (CWE-416): 14
- #3 Out-of-bounds Write (CWE-787): 12
- #4 Missing Authentication for Critical Function (CWE-306): 11
- #5 Deserialization of Untrusted Data (CWE-502): 11
- #6 Path Traversal (CWE-22): 10
- #7 Code Injection (CWE-94): 7
- #8 Authentication Bypass Using an Alternate Path or Channel (CWE-288): 6
- #9 Heap-based Buffer Overflow (CWE-122): 6
- #10 Cross-site Scripting (CWE-79): 7
The lesson: web bugs like XSS and SQL injection are the most common, but the bugs attackers turn into real intrusions are mostly command injection, memory corruption and missing authentication. Those are concentrated in network devices, VPN gateways and internet-facing servers.
Detection
- Find these weaknesses in your code: run static analysis (SAST) and dependency scanning in your CI pipeline, and map the findings to CWE IDs so you can see which of the top 10 you have.
- Test running applications: use dynamic scanning (DAST) and penetration tests aimed at injection, access control and file-path handling.
- Track exploited CVEs: compare your asset inventory against CISA's Known Exploited Vulnerabilities catalog. Anything on it that you run should be patched first. Reef Sentinel's Threat Feed shows actively exploited CVEs as they are added.
- Watch the logs: look for
../sequences, SQL keywords, shell metacharacters (;,|, backticks,$() and script tags in request logs and web application firewall (WAF) alerts.
Recommended Actions
- Developers: make secure defaults the norm, with auto-escaping templates, parameterised queries, server-side authorisation on every request and no shell calls. Write new low-level code in memory-safe languages.
- Security teams: use the Top 10 KEV list to rank patching. Command injection, memory-corruption and authentication-bypass flaws in edge devices should jump the queue.
- Buyers and IT managers: ask vendors how they eliminate these CWE classes (secure-by-design commitments, memory-safety roadmaps, published CWE data in their advisories).
- Everyone: keep internet-facing devices patched and off the public internet where possible. Most exploited bugs on the KEV list are in exactly those systems.
Analyst Assessment
The 2025 ranking shows slow progress. Cross-site scripting and SQL injection still hold the top two places after more than twenty years, and Missing Authorization's jump to fourth reflects how many APIs check identity but not permission. The more urgent signal is in the exploited list: attackers keep winning with OS command injection, memory-safety bugs and missing authentication on internet-facing devices. Organisations that cannot fix everything should start there. Developers who want to remove whole classes of bugs, not just single instances, should invest in memory-safe languages and frameworks that make the safe option the default.
