CWEweakness
CWE-395 Use of NullPointerException Catch to Detect NULL Pointer Dereference
- Abstraction
- Variant
- Structure
- Simple
- Status
- Draft
- Languages
- Java
- CWE version
- 5.0
Description
Catching NullPointerException should not be used as an alternative to programmatic checks to prevent dereferencing a null pointer.
Common consequences
• Availability: DoS: Resource Consumption (CPU)
• Other: Quality Degradation
Potential mitigations
• [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.
Detection methods
• Automated Static Analysis - Binary or Bytecode: According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
• Bytecode Weakness Analysis - including disassembler + source code weakness analysis
• Binary Weakness Analysis - including disassembler + source code weakness analysis
• Dynamic Analysis with Manual Results Interpretation: According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
• Framework-based Fuzzer
• Manual Static Analysis - Source Code: According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
• Manual Source Code Review (not inspections)
• Automated Static Analysis - Source Code: According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
• Source code Weakness Analyzer
• Context-configured Source Code Weakness Analyzer
• Architecture or Design Review: According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
• Formal Methods / Correct-By-Construction
Cost effective for partial coverage:
• Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.)
Related
Child of · CWE (2)
Referenced by CVE · weakness (17)
- CVE-2025-15514 Ollama 0.11.5-rc0 through current version 0.13.5 contain a null pointer dereference vulnerability in the multi-modal model image processing… vulnerability
- CVE-2025-27466 [This CNA information record relates to multiple CVEs; the text explains which aspects/vulnerabilities correspond to which CVE.] There are… vulnerability
- CVE-2025-58142 [This CNA information record relates to multiple CVEs; the text explains which aspects/vulnerabilities correspond to which CVE.] There are… vulnerability
- CVE-2024-28030 NULL pointer dereference in some Intel(R) VPL software before version 24.1.4 may allow an authenticated user to potentially enable denial… vulnerability
- CVE-2024-36275 NULL pointer dereference in some Intel(R) Optane(TM) PMem Management software versions before CR_MGMT_02.00.00.4040, CR_MGMT_03.00.00.0499… vulnerability
- CVE-2023-23904 NULL pointer dereference in the UEFI firmware for some Intel(R) Processors may allow a privileged user to potentially enable escalation of… vulnerability
- CVE-2023-41082 Null pointer dereference for some Intel(R) CST software before version 2.1.10300 may allow an authenticated user to potentially enable… vulnerability
- CVE-2023-48727 NULL pointer dereference in some Intel(R) oneVPL software before version 23.3.5 may allow an authenticated user to potentially enable… vulnerability
- CVE-2024-27658 D-Link DIR-823G A1V1.0.2B05 was discovered to contain Null-pointer dereferences in sub_4484A8(). vulnerability
- CVE-2024-27659 D-Link DIR-823G A1V1.0.2B05 was discovered to contain Null-pointer dereferences in sub_42AF30(). vulnerability
- CVE-2024-27661 D-Link DIR-823G A1V1.0.2B05 was discovered to contain Null-pointer dereferences in sub_4484A8(). vulnerability
- CVE-2024-27662 D-Link DIR-823G A1V1.0.2B05 was discovered to contain a Null-pointer dereferences in sub_4110f4(). vulnerability
- CVE-2022-42879 NULL pointer dereference in some Intel(R) Arc(TM) Control software before version 1.73.5335.2 may allow an authenticated user to… vulnerability
- CVE-2023-25071 NULL pointer dereference in some Intel(R) Arc(TM) & Iris(R) Xe Graphics - WHQL - Windows Drviers before version 31.0.101.4255 may allow… vulnerability
- CVE-2022-29508 Null pointer dereference in the Intel(R) VROC software before version 7.7.6.1003 may allow an authenticated user to potentially enable… vulnerability
- CVE-2022-42878 Null pointer dereference for some Intel(R) Trace Analyzer and Collector software before version 2021.8.0 published Dec 2022 may allow an… vulnerability
- CVE-2022-2832 A flaw was found in Blender 3.3.0. vulnerability