Skip to content
Offensive Security Glossary / CWE (Common Weakness Enumeration)

CWE: Common Weakness Enumeration

What CWE classifies, how it relates to CVE and the OWASP Top 10, and the CWE IDs that come up most in web testing.

What Is CWE (Common Weakness Enumeration)

CWE (Common Weakness Enumeration) is MITRE's community-developed catalog of the kinds of software and hardware flaws that lead to vulnerabilities, that gives each kind of security flaw a stable identifier such as CWE-79 (cross-site scripting) or CWE-89 (SQL injection). It classifies types of mistakes, not specific vulnerabilities in specific products.

A useful way to remember the difference: a CVE says "this product version has this vulnerability"; a CWE says "this is the kind of mistake that caused it." One CWE can underlie thousands of CVEs, and findings in custom applications that never get a CVE can still be classified by CWE.

How CWE Is Organized

LevelAbstractionExample
PillarHighest-level themeCWE-707 Improper Neutralization
ClassAbstract, independent of language or technologyCWE-74 Injection
BaseSpecific enough to detect and fixCWE-89 SQL Injection
VariantTied to a specific language or technologyCWE-564 SQL Injection: Hibernate

CWE IDs Common in Web and API Testing

CWEWeaknessGlossary
CWE-79Cross-site scriptingXSS
CWE-89SQL injectionSQLi
CWE-78OS command injectionRCE
CWE-94Code injectionRCE
CWE-502Deserialization of untrusted dataRCE
CWE-918Server-side request forgerySSRF
CWE-639Authorization bypass through user-controlled keyIDOR
CWE-862Missing authorizationBOLA
CWE-352Cross-site request forgery
CWE-22Path traversal

The CWE Top 25

MITRE, with CISA, publishes the CWE Top 25 Most Dangerous Software Weaknesses, ranked from analysis of real CVE records using frequency and severity. The OWASP Top 10 also maps each of its categories to CWE IDs; the 2025 edition maps 248 CWEs across its ten categories.

How CWE Is Used

  • Classifying findings from SAST, DAST and penetration tests consistently
  • Trend analysis: which weakness types recur in your code
  • Training and secure coding standards targeted at recurring CWEs
  • Mapping to frameworks such as the OWASP Top 10

Sources and Standards

Frequently Asked Questions

What does CWE stand for?

Common Weakness Enumeration.

What is the difference between CWE and CVE?

CWE classifies types of weaknesses. CVE identifies specific vulnerabilities in specific products. A CVE is typically mapped to one or more CWEs.

Who maintains CWE?

MITRE maintains CWE with community input; the CWE Top 25 is published with CISA.

What CWE is SQL injection?

CWE-89. Cross-site scripting is CWE-79 and SSRF is CWE-918.

Further Reading

Reviewed against the primary sources cited on this page. Verified 2026-12-02.

Find the Weaknesses in Your Own Code Paths

Run a free AI pentest and get findings mapped to CWE with proof of exploit.

Free AI Pen Test

No credit card. Findings include reproducible steps and exploit code.

Firecompass ranked #1 AI on HackerOne. Read more →