CWE-476: NULL Pointer Dereference

BaseStableExploit Likelihood: Medium🏆 #11 in Top 25 (2024)

The product dereferences a pointer that it expects to be valid but is NULL.

View on MITRE
1,625Related CVEs
15.34Severity Score
Back to CWE Lookup

Technical Details

Structure
Simple
Vulnerability Mapping
ALLOWED

Applicable To

Languages
CC++JavaC#Go
Platforms

🏆 CWE Top 25 Historical Ranking

2023:#12
Score: 6.59
1,587 CVEs
2024:#11↑1
Score: 15.34
1,625 CVEs
Trend:Worsening (moved down 1 ranks)

Source-backed guidance

Additional facts reviewed against primary or authoritative security sources.

Combine review and analysis around the CWE-476 trust boundary

MITRE identifies automated dynamic analysis, manual dynamic analysis, automated static analysis as applicable detection approaches. Use them to trace nullable allocations, lookups, casts, and optional values to their first dereference, especially in initialization failures and rarely executed error paths. Require a reproducible source-to-sink or policy-to-enforcement trace, record coverage gaps, and confirm suspected findings dynamically where safe; no single scanner can establish complete coverage for this weakness.

CWE-476: detection methods and operational guidanceMITRE CWE

Check every nullable pointer before its first use

Validate pointer parameters before passing them to functions such as strlen or memcpy, and check every allocation result before dereferencing it. Perform the null check before any member access or derived-pointer initialization; a check that appears after a dereference is already too late and may be removed by compiler optimization. Handle the failure path explicitly and use static analysis to find unchecked null returns and null tests that occur after use.

EXP34-C: Do not dereference null pointersCarnegie Mellon SEI

Apply lessons from CVE-2025-24177 in Apple macOS, iOS, and iPadOS

NVD maps CVE-2025-24177 to CWE-476; a remotely triggerable null-pointer dereference could cause denial of service and was addressed with improved input validation. Use the case to test malformed remote inputs, validate optional parse results before use, and ensure a rejected value cannot advance into a dereference or leave the service in a crash loop.

CVE-2025-24177 DetailNIST National Vulnerability Database

Prioritize CWE-476 using its 2025 CWE Top 25 evidence

CWE-476 ranked #13 in the 2025 CWE Top 25 with a score of 6.41. The ranking table recorded no mapped vulnerabilities in CISA KEV for this measurement window. Use the rank to prioritize systemic prevention, detection coverage, and recurring-root-cause metrics across the portfolio, while retaining asset exposure and business impact for individual finding severity decisions.

2025 CWE Top 25 Most Dangerous Software WeaknessesMITRE CWE

Exercise nullable failure paths with runtime sanitizers

Enable null-related UndefinedBehaviorSanitizer checks for supported native targets and force allocation failures, missing lookups, absent optional values, malformed inputs, and partial initialization. Assert that the program checks before the first dereference and enters a defined failure path. Keep sanitizer diagnostics symbolized in CI and supplement them with static nullability analysis for paths tests do not execute.

UndefinedBehaviorSanitizerLLVM Project

Frequently Asked Questions

What is CWE-476: NULL Pointer Dereference?+

CWE-476: NULL Pointer Dereference is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product dereferences a pointer that it expects to be valid but is NULL.

Is CWE-476 in the CWE Top 25 Most Dangerous Software Weaknesses?+

Yes. CWE-476 ranked #11 in the CWE Top 25 for 2024, associated with 1,625 CVEs that year. The CWE Top 25 highlights the most common and impactful software weaknesses based on real-world vulnerability data.

What are the security consequences of NULL Pointer Dereference?+

If exploited, CWE-476 (NULL Pointer Dereference) it can compromise Availability, Integrity and Confidentiality, leading to outcomes such as DoS: Crash, Exit, or Restart, Execute Unauthorized Code or Commands, Read Memory and Modify Memory.

How do you prevent or mitigate NULL Pointer Dereference?+

Recommended mitigations for CWE-476 include: Select a programming language that is not susceptible to these issues. Check the results of all functions that return a value and verify that the value is non-null before acting upon it. Identify all variables and data stores that receive information from external sources, and apply input validation to make sure that they are only initialized to expected values.

Which programming languages are affected by NULL Pointer Dereference?+

CWE-476 commonly affects C, C++, Java, C# and Go. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of NULL Pointer Dereference?+

MITRE documents real CVEs mapped to CWE-476, including CVE-2024-41130, CVE-2005-3274, CVE-2002-1912, CVE-2005-0772 and CVE-2009-4895. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-476 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More

Advertisement