Tuning Your Scanner to the 2024 CWE Top 25 Without Drowning in False Positives
MITRE's 2024 CWE Top 25, since followed by a 2025 edition, reshuffled several rankings. Here's how to configure your scanner around the list.
DevSecCode Team · · AppSec · 7 min read
Configure your scanner for the CWE Top 25 2024
- Enable Tier 1 rules with high confidence. Turn on rules for CWE-79 (XSS), CWE-89 (SQL Injection), CWE-78 (OS Command Injection), CWE-22 (Path Traversal), CWE-352 (CSRF), CWE-918 (SSRF), and CWE-20 (Input Validation). These have low false-positive rates with modern AST-based detection.
- Enable Tier 2 context-aware rules. Turn on CWE-601 (Open Redirect), CWE-611 (XXE), and CWE-1021 (UI Layering). These need framework-specific tuning to suppress noise. Start in observe mode, then enforce.
- Configure language-specific add-ons. For C/C++ codebases add CWE-125 and CWE-787 (out-of-bounds read/write) plus CWE-416 (use-after-free). For Go, Rust, and Java add CWE-190 (Integer Overflow) and CWE-476 (NULL Pointer Dereference). Interpreted-language stacks rarely need memory-safety CWEs.
- Enable AST taint tracking for injection CWEs. CWE-89 and CWE-78 need data-flow tracing from source to sink for credible detection. Pure regex rules produce high false-positive rates on parameterized queries. Confirm your scanner uses AST + taint, not regex alone.
- Map findings to OWASP and compliance presets. Annotate every finding with its OWASP Top 10:2025 category and any active compliance preset (HIPAA, PCI-DSS, CMMC, FedRAMP). This compresses triage time and produces multi-framework evidence from a single scan.
CWE Top 25 2024: The Rankings and What Moved
MITRE's 2024 CWE Top 25 (released November 2024) is based on NVD CVE data from 2023-2024. The methodology weights both frequency and severity, giving a more accurate picture of real-world risk than frequency alone.
The 2024 Top 10
| Rank | CWE | Weakness | Score |
|---|---|---|---|
| 1 | CWE-79 | Cross-site Scripting | 56.92 |
| 2 | CWE-787 | Out-of-bounds Write | 45.20 |
| 3 | CWE-89 | SQL Injection | 35.88 |
| 4 | CWE-352 | Cross-Site Request Forgery | 19.57 |
| 5 | CWE-22 | Path Traversal | 12.74 |
| 6 | CWE-125 | Out-of-bounds Read | 11.42 |
| 7 | CWE-78 | OS Command Injection | 11.30 |
| 8 | CWE-416 | Use After Free | 10.19 |
| 9 | CWE-862 | Missing Authorization | 10.11 |
| 10 | CWE-434 | Unrestricted Upload of Dangerous File Type | 10.03 |
Notable Changes from 2023
CWE-787 (Out-of-bounds Write) fell from first to second in 2024, with XSS taking the top spot. For application developers, this is primarily relevant in C/C++ codebases and embedded systems.
CWE-502 (Deserialization of Untrusted Data) moved from 15 to 16, but the risk has not diminished.
CWE-918 (SSRF) held at #19, unchanged from 2023. It stays a priority for cloud workloads because of metadata APIs (AWS IMDS, GCP metadata server).
Scanner Configuration Implications
For interpreted language stacks (Python, JavaScript, TypeScript, Ruby), the actionable CWEs are:
Tier 1. Configure with high confidence rules:
- CWE-79, CWE-89, CWE-78, CWE-22, CWE-352, CWE-918, CWE-20
Tier 2. Configure with context-aware rules (higher false positive rate):
- CWE-601 (Open Redirect), CWE-611 (XXE), CWE-1021 (Improper Restriction of Rendered UI Layers)
Tier 3. Requires manual review:
- CWE-284, CWE-269 (access control logic is application-specific)
For compiled language stacks (Go, Rust, Java), add:
- CWE-190 (Integer Overflow), CWE-476 (NULL Pointer Dereference), CWE-125/787 for C/C++
Taint Analysis vs. Regex for Top 25
CWE-89 and CWE-78 require taint analysis for accurate detection. Pure regex rules produce high false-positive rates on parameterized queries that look like string concatenation. AST-based taint tracking (tracing data flow from input source to sink) is the baseline requirement for credible Top 25 coverage.
How Deva Addresses CWE Top 25
Deva's rule packs use regex matching, AST parsing, and taint tracking. On Pro, the sans-top25 preset targets CWEs on the list, and every finding carries its CWE ID so you can match it.
The compliance preset for OWASP (which aligns closely with CWE Top 25) maps findings to both OWASP categories and MITRE CWE identifiers, so remediation can be tracked against both frameworks simultaneously.
Frequently asked questions
- What is the CWE Top 25?
- The CWE Top 25 is MITRE's annual ranking of the most dangerous software weaknesses, based on NVD CVE data over the prior 12-24 months. The methodology weights both frequency and severity, producing a more accurate real-world risk picture than frequency alone.
- What's the difference between OWASP Top 10 and CWE Top 25?
- OWASP Top 10 is a higher-level category list maintained by the OWASP Foundation, updated every 3-4 years. CWE Top 25 is MITRE's underlying weakness taxonomy, updated annually based on observed CVE data. The two are complementary: OWASP categories aggregate multiple CWEs, and CWE rankings inform OWASP's category reordering.
- Why do CWE-89 and CWE-78 need taint tracking?
- SQL injection and OS command injection are about data flow from a source (user input) to a sink (query or shell call), not about a single pattern at one line. Regex-only scanners produce high false-positive rates on parameterized queries that look like string concatenation. AST-based taint tracking is the baseline for credible detection.
- Does the CWE Top 25 change every year?
- Yes, but slowly. The top 5-10 entries are stable across years (XSS, SQL injection, out-of-bounds write, command injection appear consistently). Movement happens in the middle and tail of the ranking as new CVE patterns emerge or older ones decline. MITRE published the 2025 edition in December 2025.
Related glossary terms
More articles
Security-Checking Code From Claude Code, Cursor and Copilot
Coding agents write code that passes its tests and still fails security checks. Five steps to scan every change an agent makes and have it fix what it finds.
OWASP Top 10:2025 Is Live. SSRF Is Gone, Supply Chain Is #3.
OWASP published the 2025 revision of the Top 10. Three structural changes deserve real attention from anyone writing or auditing application code.