Safeguard
Security Guides•

Which CWE IDs match the web flaws scanners report most often?

A lookup table of CWE IDs for XSS, SQL injection, command injection, deserialization, CSRF, session and login flaws, plus how to use them in triage.

Safeguard Security Team
4 min read

Scanner reports often tag findings with CWE IDs. The common ones for web apps are CWE-79 for cross-site scripting, CWE-89 for SQL injection, CWE-78 for OS command injection, CWE-502 for deserialization, CWE-352 for CSRF, CWE-287 for improper authentication and CWE-384 for session fixation.

What a CWE is

CWE stands for Common Weakness Enumeration. It is a catalog of types of software weakness, maintained by MITRE. A CWE names the kind of mistake, such as building a query from user input. A CVE, by contrast, identifies one specific flaw in one specific product. A scanner finding in your own code usually maps to a CWE, while a flaw in a library maps to a CVE that itself points to one or more CWEs.

The lookup table

All titles below come from the MITRE CWE pages.

CWEOfficial nameTypical scanner wording
CWE-79Improper Neutralization of Input During Web Page Generation (Cross-site Scripting)Reflected, stored or DOM XSS
CWE-89Improper Neutralization of Special Elements used in an SQL Command (SQL Injection)SQL injection, blind SQL injection
CWE-78Improper Neutralization of Special Elements used in an OS Command (OS Command Injection)Command injection
CWE-502Deserialization of Untrusted DataInsecure deserialization
CWE-611Improper Restriction of XML External Entity ReferenceXXE
CWE-918Server-Side Request Forgery (SSRF)SSRF
CWE-601URL Redirection to Untrusted Site (Open Redirect)Open redirect
CWE-352Cross-Site Request Forgery (CSRF)Missing anti-CSRF protection
CWE-287Improper AuthenticationAuthentication bypass, broken authentication
CWE-384Session FixationSession ID not renewed at login
CWE-613Insufficient Session ExpirationLong or missing session timeout
CWE-307Improper Restriction of Excessive Authentication AttemptsNo lockout or throttling
CWE-521Weak Password RequirementsWeak password policy
CWE-209Generation of Error Message Containing Sensitive InformationVerbose errors, stack traces

How to use CWE IDs in triage

  1. Group by CWE. If forty findings share CWE-79, you probably have one missing output encoding pattern, not forty bugs. Fix the shared pattern.
  2. Deduplicate across tools. A static scan and a dynamic scan may report the same issue with different names. The CWE is a stable key to match them. See dedupe SAST and DAST findings with CWE.
  3. Pick the fix from the weakness, not the tool. CWE-89 points to parameterization. CWE-384 points to renewing the ID at login. CWE-209 points to a generic error handler.
  4. Track by class over time. If one class keeps returning, the gap is in a shared library, code review checklist or training, not in individual code.
  5. Map to the OWASP Top 10. OWASP's A05:2025 Injection category covers 37 CWEs and includes cross-site scripting and SQL injection. The A07:2025 Authentication Failures entry lists CWE-384 session fixation among its mapped weaknesses. Using both lets you answer a customer who asks about the Top 10.

What a CWE does not tell you

A CWE does not tell you severity in your environment, whether the code is reachable, or whether a fix exists. Two findings with the same CWE can differ widely in risk, for example XSS on a public page versus XSS in a rarely used admin page. OWASP itself notes that the very large number of cross-site scripting CVEs, more than 30,000 in its data, lowers the average impact score of the whole injection category, while SQL injection with more than 14,000 CVEs is lower in frequency but higher in impact. Use the CWE to classify, and other signals to prioritize.

Try it yourself

Click through it at your own pace, or open it full screen. Notice how findings are grouped and sorted, and which fields help you decide what to fix first.

Quick check

Is a CWE the same as a CVE?

No. A CWE is a class of weakness. A CVE is a specific vulnerability in a specific product, and it may reference a CWE.

Can one finding have more than one CWE?

Yes. Tools sometimes list a primary CWE and related ones. Pick the one that matches the fix you will make.

Safeguard's compliance and evidence automation and its free scan at gold.safeguard.sh/scan help you keep findings, fixes and records in one place.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.