What is CWE (Common Weakness Enumeration)?
CWE (Common Weakness Enumeration) is a community-developed list, run by MITRE, of the kinds of weakness in software and hardware that can lead to vulnerabilities. Each entry has a number, such as CWE-89 for SQL injection, so a finding can name its root cause precisely rather than in a tester's own words.
Part of the roadmap: Stage 1, Foundations
Why it matters
CVE and CWE answer different questions. A CVE names one specific flaw in one product version; a CWE names the kind of mistake behind it. Thousands of CVEs share CWE-79, cross-site scripting. Your own app's bug will almost never have a CVE, but it always has a CWE, which is why pentest reports and bug bounty submissions tag findings with one, and why NIST's vulnerability database adds a CWE to each CVE record it analyses.
MITRE defines a weakness as a condition that, under certain circumstances, could contribute to the introduction of vulnerabilities. The list is updated three to four times a year; version 4.21 is current. Entries sit at different levels of detail, from broad Pillars and Classes down to Base and Variant entries, and each says whether it may be used to map a real vulnerability. Pick the most specific entry that is allowed, rather than a broad class.
MITRE also publishes the CWE Top 25 Most Dangerous Software Weaknesses. The 2025 list, built from 39,080 CVE records, ranks cross-site scripting (CWE-79) first, SQL injection (CWE-89) second and cross-site request forgery (CWE-352) third. IDOR's entry, CWE-639, is 24th.
Example: tagging a CyberGym finding with its CWE
On CyberGym, the legal practice target, the Photo Wall page shows two fields per photo, but the API behind it returns the uploader's whole user record to anyone, password hash included. To tag it, describe the mistake in one sentence, then find the entry that says the same thing:
Finding GET /rest/memories returns each uploader's full user row, without a session
Mistake the server sends fields the page never needs, to callers who should not see them
CWE CWE-213 Exposure of Sensitive Information Due to Incompatible Policies
(a child of CWE-200, Exposure of Sensitive Information to an Unauthorized Actor)
OWASP API3:2023 Broken Object Property Level Authorization
Search cwe.mitre.org by the mistake, not by the symptom, then read the entry's description and its 'Vulnerability Mapping' note. If two entries fit, choose the narrower one that is allowed for mapping. On your own app, the same habit makes a report easier to act on: a developer who sees CWE-639 knows the fix is an ownership check before reading another word.
Common mistakes
- Confusing CWE with CVE. CVE is one published flaw in a product. CWE is the type of weakness. A CVE record often lists its CWE.
- Tagging with the broadest entry. CWE-20, improper input validation, fits most bugs that start with input and tells nobody what to fix. Choose the most specific entry allowed for mapping.
- Reading the Top 25 as your app's risk list. It ranks weaknesses across many published CVEs, mostly in products, not your app.
- Naming the CWE but not the evidence. A tag classifies a finding; the request and response are what prove it.
Related terms
Go deeper
Sources
Test only sites you own or have written permission to test. To practise without one, use CyberGym, a legal, deliberately vulnerable target. Practise on CyberGym.
