Skip to content
cloudgrip

$ man common-weakness-enumeration

//Vulnerabilities and risk

What is CWE (Common Weakness Enumeration)?

Common Weakness Enumeration (CWE) is a catalog, maintained by MITRE, of the types of mistake that make software and hardware insecure, such as CWE-79 cross-site scripting. A CVE identifies a single bug in a specific piece of software. A CWE names the kind of flaw.

  • Vulnerabilities and risk
  • 3 min read
  • updated Nov 11, 2026

What CWE is

CWE is a reference list of security mistakes. Each entry describes one type of weakness, gives it a number and a name, and lists examples, consequences and ways to prevent it. MITRE maintains the list with input from vendors, researchers and tool makers.

A few entries appear in almost every penetration test report:

ID Name in plain words
CWE-79 Cross-site scripting
CWE-89 SQL injection
CWE-352 Cross-site request forgery
CWE-639 Access to another user's record by changing an ID
CWE-862 Missing authorization check
CWE-918 Server-side request forgery

The value is a shared vocabulary. A scanner, a pentest report and a bug bounty submission can all say "CWE-89" and mean the same root cause.

A weakness is not a vulnerability

A weakness is a kind of error. A vulnerability is one place where that error actually exists in a real product.

"SQL injection in the sort parameter of /api/reports" is a vulnerability. CWE-89 is the weakness behind it. The same weakness exists in thousands of unrelated products, and each public occurrence may receive its own CVE ID. A CVE record normally names the CWE that caused it.

This split is what makes CWE useful for engineering managers. Ten findings with ten different CVE IDs look like ten separate problems. If seven of them map to the same CWE, there is one habit to fix: a missing library, a missing lint rule or a gap in training.

How CWE is organized

Entries form a tree that runs from broad to specific. There are four levels of abstraction.

output
CWE-707  Improper Neutralization                  Pillar   (broadest)
  CWE-74   Injection                              Class
    CWE-79   Cross-site Scripting                 Base
      CWE-80   Basic XSS in script-related tags   Variant  (most specific)
  • Pillar. A theme, too abstract to describe a real bug.
  • Class. A family of weaknesses, not tied to one language or technology.
  • Base. Concrete enough that a tool can find it and a developer can fix it. Most findings should map here.
  • Variant. A base weakness tied to a particular technology or situation.

Two other entry types exist for navigation. Views are selections made for a purpose, such as the Top 25. Categories group entries that share a topic. Neither is a weakness in itself.

Choosing the right CWE for a finding

Pick the most specific entry that the evidence supports. MITRE labels every entry with mapping guidance: Allowed, Allowed-with-Review, Discouraged or Prohibited.

Broad entries are Discouraged because they tell the reader almost nothing. Two that are overused:

  • CWE-20, Improper Input Validation. Nearly any bug can be described this way. A feature that fetches a user-supplied URL and reaches internal hosts is better mapped to CWE-918.
  • CWE-284, Improper Access Control. An admin endpoint with no role check is better mapped to CWE-862.

Categories are Prohibited as mappings, since they are groupings and not weaknesses. Some findings involve a chain, where one weakness makes another reachable. In that case, record each link.

What the CWE Top 25 is

MITRE publishes a yearly list called the CWE Top 25 Most Dangerous Software Weaknesses. It ranks weaknesses using public CVE data, combining how often each one is the root cause with how severe the resulting vulnerabilities are. Cross-site scripting, SQL injection and memory safety errors such as out-of-bounds writes appear near the top year after year.

Teams use it to decide what to teach developers first and which static analysis rules to turn on. It reflects published CVEs, so it leans toward widely distributed software. The weaknesses that dominate custom web applications and APIs, mostly authorization errors, are better represented in the OWASP Top 10, whose categories each map to a set of CWEs.

Common misunderstandings

"The CWE number indicates severity." It does not. Numbers are identifiers. Severity is rated separately with CVSS.

"CWE and CVE are two names for one thing." CVE identifies an instance. CWE identifies a type.

Used consistently, CWE turns a pile of findings into a short list of root causes, which tells a secure code review program where to look next.

See what an attacker would find.

Give us a URL and two test logins. If there’s something to find, your first exploited findings land within 24 hours.

You talk to the people who build Hydra and Cerberus. No sales script.

or write to founders@cloudgrip.ai