CWEweakness
CWE-476 NULL Pointer Dereference
Medium
Official page ↗
- Alternate terms
- NPD, null deref, NPE, nil pointer dereference
- Abstraction
- Base
- Structure
- Simple
- Status
- Stable
- Likelihood of exploit
- Medium
- Languages
- C, C#, C++, Go, Java, Python
- CWE version
- 5.0
Description
The product dereferences a pointer that it expects to be valid but is NULL.
Common consequences
• Availability: DoS: Crash, Exit, or Restart — NULL pointer dereferences usually result in the failure of the process unless exception handling (on some platforms) is available and implemented. Even when exception handling is being used, it can still be very difficult to return the software to a safe state of operation.
• Integrity, Confidentiality: Execute Unauthorized Code or Commands, Read Memory, Modify Memory — In rare circumstances, when NULL is equivalent to the 0x0 memory address and privileged code can access it, then writing or reading memory is possible, which may lead to code execution.
Potential mitigations
• [Implementation] For any pointers that could have been modified or provided from a function that can return NULL, check the pointer for NULL before use. When working with a multithreaded or otherwise asynchronous environment, ensure that proper locking APIs are used to lock before the check, and unlock when it has finished [REF-1484].
• [Requirements] Select a programming language that is not susceptible to these issues.
• [Implementation] Check the results of all functions that return a value and verify that the value is non-null before acting upon it.
• [Architecture and Design] 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.
• [Implementation] Explicitly initialize all variables and other data stores, either during declaration or just before the first usage.
Detection methods
• Automated Dynamic Analysis: This weakness can be detected using dynamic tools and techniques that interact with the software using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The software's operation may slow down, but it should not become unstable, crash, or generate incorrect results.
• Manual Dynamic Analysis: Identify error conditions that are not likely to occur during normal usage and trigger them. For example, run the program under low memory conditions, run with insufficient privileges or permissions, interrupt a transaction before it is completed, or disable connectivity to basic network services such as DNS. Monitor the software for any unexpected behavior. If you trigger an unhandled exception or similar error that was discovered and handled by the application's environment, it may still indicate unexpected conditions that were not handled by the application itself.
• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
• Automated Dynamic Analysis: Use tools that are integrated during
compilation to insert runtime error-checking mechanisms
related to memory safety errors, such as AddressSanitizer
(ASan) for C/C++ [REF-1518].
Observed examples
• CVE-2024-41130: C++ library for LLM inference has NULL pointer dereference if a read operation fails
• CVE-2005-3274: race condition causes a table to be corrupted if a timer activates while it is being modified, leading to resultant NULL dereference; also involves locking.
• CVE-2002-1912: large number of packets leads to NULL dereference
• CVE-2005-0772: packet with invalid error status value triggers NULL dereference
• CVE-2009-4895: Chain: race condition for an argument value, possibly resulting in NULL dereference
• CVE-2020-29652: ssh component for Go allows clients to cause a denial of service (nil pointer dereference) against SSH servers.
• CVE-2009-2692: Chain: Use of an unimplemented network socket operation pointing to an uninitialized handler function (CWE-456) causes a crash because of a null pointer dereference (CWE-476).
• CVE-2009-3547: Chain: race condition (CWE-362) might allow resource to be released before operating on it, leading to NULL dereference (CWE-476)
• CVE-2009-3620: Chain: some unprivileged ioctls do not verify that a structure has been initialized before invocation, leading to NULL dereference
• CVE-2009-2698: Chain: IP and UDP layers each track the same value with different mechanisms that can get out of sync, possibly resulting in a NULL dereference
• CVE-2009-0949: Chain: improper initialization of memory can lead to NULL dereference
• CVE-2008-3597: Chain: game server can access player data structures before initialization has happened leading to NULL dereference
• CVE-2020-6078: Chain: The return value of a function returning a pointer is not checked for success (CWE-252) resulting in the later use of an uninitialized variable (CWE-456) and a null pointer dereference (CWE-476)
• CVE-2008-0062: Chain: a message having an unknown message type may cause a reference to uninitialized memory resulting in a null pointer dereference (CWE-476) or dangling pointer (CWE-825), possibly crashing the system or causing heap corruption.
• CVE-2008-5183: Chain: unchecked return value can lead to NULL dereference
• CVE-2004-0079: SSL software allows remote attackers to cause a denial of service (crash) via a crafted SSL/TLS handshake that triggers a null dereference.
• CVE-2004-0365: Network monitor allows remote attackers to cause a denial of service (crash) via a malformed RADIUS packet that triggers a null dereference.
• CVE-2003-1013: Network monitor allows remote attackers to cause a denial of service (crash) via a malformed Q.931, which triggers a null dereference.
• CVE-2003-1000: Chat client allows remote attackers to cause a denial of service (crash) via a passive DCC request with an invalid ID number, which causes a null dereference.
• CVE-2004-0389: Server allows remote attackers to cause a denial of service (crash) via malformed requests that trigger a null dereference.
• CVE-2004-0119: OS allows remote attackers to cause a denial of service (crash from null dereference) or execute arbitrary code via a crafted request during authentication protocol selection.
• CVE-2004-0458: Game allows remote attackers to cause a denial of service (server crash) via a missing argument, which triggers a null pointer dereference.
• CVE-2002-0401: Network monitor allows remote attackers to cause a denial of service (crash) or execute arbitrary code via malformed packets that cause a NULL pointer dereference.
• CVE-2001-1559: Chain: System call returns wrong value (CWE-393), leading to a resultant NULL dereference (CWE-476).
Related
Observed example · CVE (24)
- CVE-2024-41130 llama.cpp provides LLM inference in C/C++. vulnerability
- CVE-2020-29652 A nil pointer dereference in the golang.org/x/crypto/ssh component through v0.0.0-20201203163018-be400aefbc4c for Go allows remote… vulnerability
- CVE-2020-6078 An exploitable denial-of-service vulnerability exists in the message-parsing functionality of Videolabs libmicrodns 0.1.0. vulnerability
- CVE-2009-4895 Race condition in the tty_fasync function in drivers/char/tty_io.c in the Linux kernel before 2.6.32.6 allows local users to cause a denial… vulnerability
- CVE-2009-3547 Multiple race conditions in fs/pipe.c in the Linux kernel before 2.6.32-rc6 allow local users to cause a denial of service (NULL pointer… vulnerability
- CVE-2009-3620 The ATI Rage 128 (aka r128) driver in the Linux kernel before 2.6.31-git11 does not properly verify Concurrent Command Engine (CCE) state… vulnerability
- CVE-2009-2698 The udp_sendmsg function in the UDP implementation in (1) net/ipv4/udp.c and (2) net/ipv6/udp.c in the Linux kernel before 2.6.19 allows… vulnerability
- CVE-2009-2692 The Linux kernel 2.6.0 through 2.6.30.4, and 2.4.4 through 2.4.37.4, does not initialize all function pointers for socket operations in… vulnerability
- CVE-2009-0949 The ippReadIO function in cups/ipp.c in cupsd in CUPS before 1.3.10 does not properly initialize memory for IPP request packets, which… vulnerability
- CVE-2008-5183 cupsd in CUPS 1.3.9 and earlier allows local users, and possibly remote attackers, to cause a denial of service (daemon crash) by adding a… vulnerability
- CVE-2008-3597 Skulltag before 0.97d2-RC6 allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) by sending a… vulnerability
- CVE-2008-0062 KDC in MIT Kerberos 5 (krb5kdc) does not set a global variable for some krb4 message types, which allows remote attackers to cause a denial… vulnerability
- CVE-2005-3274 Race condition in ip_vs_conn_flush in Linux 2.6 before 2.6.13 and 2.4 before 2.4.32-pre2, when running on SMP systems, allows local users… vulnerability
- CVE-2005-0772 VERITAS Backup Exec 9.0 through 10.0 for Windows Servers, and 9.0.4019 through 9.1.307 for Netware, allows remote attackers to cause a… vulnerability
- CVE-2004-0079 The do_change_cipher_spec function in OpenSSL 0.9.6c to 0.9.6k, and 0.9.7a to 0.9.7c, allows remote attackers to cause a denial of service… vulnerability
- CVE-2004-0458 mah-jong before 1.6.2 allows remote attackers to cause a denial of service (server crash) via a missing argument, which triggers a null… vulnerability
- CVE-2004-0119 The Negotiate Security Software Provider (SSP) interface in Windows 2000, Windows XP, and Windows Server 2003, allows remote attackers to… vulnerability
- CVE-2004-0389 RealNetworks Helix Universal Server 9.0.1 and 9.0.2 allows remote attackers to cause a denial of service (crash) via malformed requests… vulnerability
- CVE-2004-0365 The dissect_attribute_value_pairs function in packet-radius.c for Ethereal 0.8.13 to 0.10.2 allows remote attackers to cause a denial of… vulnerability
- CVE-2003-1000 xchat 2.0.6 allows remote attackers to cause a denial of service (crash) via a passive DCC request with an invalid ID number, which causes… vulnerability
- CVE-2003-1013 The Q.931 dissector in Ethereal before 0.10.0, and Tethereal, allows remote attackers to cause a denial of service (crash) via a malformed… vulnerability
- CVE-2002-1912 SkyStream EMR5000 1.16 through 1.18 does not drop packets or disable the Ethernet interface when the buffers are full, which allows remote… vulnerability
- CVE-2002-0401 SMB dissector in Ethereal 0.9.3 and earlier allows remote attackers to cause a denial of service (crash) or execute arbitrary code via… vulnerability
- CVE-2001-1559 The uipc system calls (uipc_syscalls.c) in OpenBSD 2.9 and 3.0 provide user mode return instead of versus rval kernel mode values to the… vulnerability
Child of · CWE (2)
Referenced by CVE · weakness (5,869)
- CVE-2026-111733 P-Net before 1.0.3 dereferences a NULL AR pointer when handling an implicit read request without a valid target AR UUID for a record index… vulnerability
- CVE-2026-111736 P-Net before 1.0.3 dereferences a NULL AR pointer in pf_fspm_cm_read_ind() when handling an implicit read request without a valid target AR… vulnerability
- CVE-2026-117548 A NULL pointer dereference flaw was found in 389-ds-base. vulnerability
- CVE-2026-117610 libexpat through 2.9.0 contains a NULL pointer dereference vulnerability in externalEntityInitProcessor2() in lib/xmlparse.c that… vulnerability
- CVE-2026-111107 A NULL pointer dereference vulnerability in WatchGuard Fireware OS’s management interface allows a remote, unauthenticated attacker with… vulnerability
- CVE-2026-116658 Tanium addressed a denial of service vulnerability in Enforce. vulnerability
- CVE-2026-57195 Asterisk is an open source private branch exchange and telephony toolkit. vulnerability
- CVE-2026-115921 Open Neural Network Exchange (ONNX) is an open standard for machine learning interoperability. vulnerability
- CVE-2026-116497 A NULL pointer dereference vulnerability was found in gssproxy. vulnerability
- CVE-2026-116740 libcss through 0.9.2 contains a NULL pointer dereference vulnerability in mq_parse_media_query() that allows remote attackers to crash… vulnerability
- CVE-2026-82389 In the Bluetooth Classic Hands-Free Profile Audio Gateway role, hfp_ag_create() in subsys/bluetooth/host/classic/hfp_ag.c starts an SDP… vulnerability
- CVE-2026-82946 SOEM version 2.0.0 and earlier contains a vulnerability where a malicious device can crash the master system. vulnerability
- CVE-2026-96432 A malicious or compromised HTTP/2 server withholding SETTINGS ACK can send RST_STREAM on a completed stream, planting a null pointer, and… vulnerability
- CVE-2026-116147 ImageMagick before 6.9.13-58 and 7.x before 7.1.2-33 contains a null pointer dereference in the DJVU decoder because the result of a memory… vulnerability
- CVE-2026-110491 The ONVIF service on the E3 can be rendered unresponsive by sending malformed or incomplete requests to certain operations. vulnerability
- CVE-2025-60469 A NULL pointer dereference in the gf_ac4_presentation_ch_mode function (/media_tools/av_parsers.c) of GPAC Project/MP4Box before 2.5 allows… vulnerability
- CVE-2025-60479 A NULL pointer dereference in the StatSFVec2f function (/scene_manager/scene_stats.c) of GPAC Project/MP4Box before 2.5 allows attackers to… vulnerability
- CVE-2025-60487 A segmentation violation in the gf_isom_get_esd function (/isomedia/isom_read.c) of GPAC Project/MP4Box before 2.5 allows attackers to… vulnerability
- CVE-2025-60489 A NULL pointer dereference in the dasher_insert_timeline_entry function (/filters/dasher.c) of GPAC Project/MP4Box before 2.5 allows… vulnerability
- CVE-2025-60493 A segmentation violation in the check_media_profile function (/mp4box/mp4box.c) of GPAC Project/MP4Box before 2.5 allows attackers to cause… vulnerability
- CVE-2026-105923 A malicious SVG can trigger an integer overflow which in turn triggers a null-pointer dereference in VectorImage QML Type. vulnerability
- CVE-2026-112381 Apache Traffic Server can crash with a null pointer dereference when a client POST request is torn down via half-close while a chunked… vulnerability
- CVE-2026-114046 FreeRDP 3.0.0 before 3.32.0 contains a null-pointer dereference in the smartcard emulation backend that accepts a null per-reader name in… vulnerability
- CVE-2026-20221 Multiple Cisco products are affected by a vulnerability in the generic routing encapsulation (GRE) tunnel decapsulation feature of the… vulnerability
- CVE-2026-76492 As part of Cisco's ongoing commitment to proactive security and product quality, the Cisco Expressway Series software engineering team has… vulnerability
- CVE-2026-78058 Uncontrolled resource consumption in the HTTP/2 (h2) receive path of Apache bRPC (version < 1.18.0) on all platforms allows a remote… vulnerability
- CVE-2026-79976 The MCTP-over-I2C+GPIO target binding in subsys/pmci/mctp/mctp_i2c_gpio_target.c emulates a small pseudo-register file, where the bus… vulnerability
- CVE-2026-82953 NULL pointer dereference in the RTMP protocol implementation in Apache bRPC (version < 1.18.0) on all platforms allows remote attackers to… vulnerability
- CVE-2026-90484 The MySQL client response parser in Apache bRPC dereferences a null pointer when the server peer sends a zero-payload-length response… vulnerability
- CVE-2026-96888 A BIND resolver that is configured with both a "redirect" zone and "qname-minimization strict" may abort with an assertion failure while… vulnerability
Referenced by CWE · can precede (4)
Referenced by CWE · has member (8)
- CWE-1200 Weaknesses in the 2019 CWE Top 25 Most Dangerous Software Errors view
- CWE-1337 Weaknesses in the 2021 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1350 Weaknesses in the 2020 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1387 Weaknesses in the 2022 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1425 Weaknesses in the 2023 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1430 Weaknesses in the 2024 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-1435 Weaknesses in the 2025 CWE Top 25 Most Dangerous Software Weaknesses view
- CWE-884 CWE Cross-section view
Referenced by OWASP · mapped cwe (1)
- A10:2025 Mishandling of Exceptional Conditions Top 10 2025