BaseDraft

CWE-395Use of NullPointerException Catch to Detect NULL Pointer Dereference

Category: memory

Description

Catching NullPointerException should not be used as an alternative to programmatic checks to prevent dereferencing a null pointer.

Common consequences· 1

  • Availability — DoS: Resource Consumption (CPU)

Potential mitigations· 1

  • [Architecture and Design, Implementation]Do not extensively rely on catching exceptions (especially for validating user input) to handle errors. Handling exceptions can decrease the performance of an application.

References

  1. https://cwe.mitre.org/data/definitions/395.html

(incoming)2

TypeTargetConfidenceTier
VulnerabilityCVE-2025-27466cve-2025-274660%live
VulnerabilityCVE-2025-58142cve-2025-581420%live

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Declaration of Catch for Generic Exception
CWE
NULL Pointer Dereference
CWE
Missing Handler
CWE
Return Inside Finally Block
CWE
Uncaught Exception
CWE
Unchecked Return Value to NULL Pointer Dereference
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.