Skip to content
OpenAdvisories

Weakness (CWE)

CWE-170: Improper Null Termination

Base Incomplete

The product does not terminate or incorrectly terminates a string or array with a null character or equivalent terminator.

How to prevent it (5 mitigations)
  1. Requirements

    Use a language that is not susceptible to these issues. However, be careful of null byte interaction errors (CWE-626) with lower-level constructs that may be written in a language that is susceptible.

  2. Implementation

    Ensure that all string functions used are understood fully as to how they append null characters. Also, be wary of off-by-one errors when appending nulls to the end of strings.

  3. Implementation

    If performance constraints permit, special code can be added that validates null-termination of string buffers, this is a rather naive and error-prone solution.

  4. Implementation

    Switch to bounded string manipulation functions. Inspect buffer lengths involved in the buffer overrun trace reported with the defect.

  5. Implementation

    Add code that fills buffers with nulls (however, the length of buffers still needs to be inspected, to ensure that the non null-terminated string is not written at the physical end of the buffer).

Source: MITRE CWE-170

66 results · Feed

  • Medium 4.8

    Irontec sngrep through 1.9.0 Out-of-Bounds Stack Read via sip_check_packet

    Irontec sngrep through 1.9.0 contains an out-of-bounds stack read vulnerability in sip_check_packet and sip_validate_packet caused by an off-by-one length check on 10240-byte SIP payloads. Remote attackers can send a crafted UDP or TCP SIP packet or supply a …

  • Medium 6.5

    Asterisk: Buffer over-read in Asterisk PJSIP MWI body parser

    Asterisk is an open source private branch exchange and telephony toolkit. Prior to Asterisk 20.20.1, 21.12.3, 22.10.1, 23.4.1 and Certified Asterisk 20.7-cert11, 22.8-cert3, an authenticated attacker may crash Asterisk through a buffer over-read in the `PJSIP…

  • Low 3.7

    Mod_qos: missing nul termination in json value escaping permits out-of-bounds reads

    A flaw was found in mod_qos. An unauthenticated remote attacker could cause a Denial of Service (DoS) by sending a specially crafted JSON request when JSON body filtering is enabled. Due to improper string termination during the processing of percent-encoded …

  • Medium 5.5

    Windows Modern Device Management (MDM) Information Disclosure Vulnerability

    Use of uninitialized resource in Windows Modern Device Management (MDM) allows an authorized attacker to disclose information locally.

  • High 7.8

    Windows Program Compatibility Assistant Service Elevation of Privilege Vulnerability

    Improper null termination in Windows Program Compatibility Assistant Service allows an authorized attacker to elevate privileges locally.

  • Medium 5.5

    Windows USB Print Driver Information Disclosure Vulnerability

    Out-of-bounds read in Windows USB Print Driver allows an authorized attacker to disclose information locally.

  • Low 3.3

    radare2: Missing string termination causes heap out-of-bounds read in radare2 bplist parser

    radare2 is a UNIX-like reverse engineering framework and command-line toolset. Prior to 6.2.0, radare2's binary property-list Unicode parser was vulnerable because the binary-property-list Unicode parser underallocated an uninitialized UTF-8 destination and d…

  • Medium 4.3

    VLC media player 3.0.0 through 3.0.23 information disclosure vulnerability

    Certain VLC media player builds in versions 3.0.0 through 3.0.23 contain a memory-safety vulnerability reachable when processing media from an attacker-controlled network source. Exploitation requires user interaction and may disclose a limited, layout-depend…

  • Medium 5.5

    Microsoft Office Word Information Disclosure Vulnerability

    Improper null termination in Microsoft Office Word allows an unauthorized attacker to disclose information locally.

  • High 7.5

    Windows Remote Desktop Protocol Information Disclosure Vulnerability

    Improper null termination in Windows Remote Desktop Protocol allows an unauthorized attacker to disclose information over a network.

  • High 7.5

    Wazuh: Pre-auth stack-buffer-overflow in compare_wazuh_versions reachable from wazuh-authd (TCP/1515) via crafted enrollment V: field

    Wazuh is a free and open source platform used for threat prevention, detection, and response. From 4.5.0 until 4.14.6 and 5.0.0-beta2, compare_wazuh_versions() in src/shared/version_op.c copies the attacker-controlled enrollment V: field into a 10-byte stack …

  • High 7.8

    dma-fence: Make dma_fence_dedup_array() robust against 0-count input

    In the Linux kernel, the following vulnerability has been resolved: dma-fence: Make dma_fence_dedup_array() robust against 0-count input dma_fence_dedup_array() returns 1 when called with num_fences == 0: the for-loop body never executes, j stays at 0, and th…

  • High 8.4

    RDMA/core: Prefer NLA_NUL_STRING

    In the Linux kernel, the following vulnerability has been resolved: RDMA/core: Prefer NLA_NUL_STRING These attributes are evaluated as c-string (passed to strcmp), but NLA_STRING doesn't check for the presence of a \0 terminator. Either this needs to switch t…

  • Medium 5.9

    h2o is vulnerable to heap overrun

    h2o is an HTTP server with support for HTTP/1.x, HTTP/2 and HTTP/3. Prior to commit 8dc37cb, when h2o receives a ClientHello message over TLS or QUIC and it contains a zero-length SNI extension, the h2o server runs over the zero-length hostname while trying t…

  • Low 3.9

    Buffer Overflow in TUBITAK BILGEM's Pardus Pen

    Improper null termination vulnerability in TUBITAK BILGEM Software Technologies Research Institute Pardus Pen allows Overflow Buffers. This issue affects Pardus Pen: from <=4.1.5 before 4.2.1.

  • High 8.8

    Stack Buffer Overflow in rxi/microtar raw_to_header() via non-null-terminated TAR name field

    A stack-based buffer overflow exists in the raw_to_header function in src/microtar.c in rxi microtar 0.1.0. The function copies the 100-byte name and linkname fields of a TAR header with strcpy without guaranteeing null termination of the source.

  • Critical 9.8

    Out-of-bounds read/write in HTTP WebSocket upgrade via non-null-terminated Sec-WebSocket-Key

    A remote, unauthenticated attacker can trigger memory corruption in Zephyr's HTTP server WebSocket upgrade path by sending a crafted Sec-WebSocket-Key header. The HTTP/1 header parser copies the header into a fixed-size buffer using a bounded copy that does n…

  • Critical 9.8

    Crypt::OpenSSL::PKCS12 versions through 1.94 for Perl truncates passwords with embedded NULLs

    Crypt::OpenSSL::PKCS12 versions through 1.94 for Perl truncates passwords with embedded NULLs. Password parameters in PKCS12.xs are declared char *, which routes through Perl's default typemap to SvPV_nolen. The Perl length is discarded. The C code (or OpenSS…

  • High 7.1

    Gnutls: gnutls: authentication bypass via nul character in username

    A flaw was found in gnutls. Servers configured with RSA-PSK (Rivest–Shamir–Adleman – Pre-Shared Key) wrongfully matched usernames containing a NUL character with truncated usernames. A remote attacker could exploit this by sending a specially crafted username…

  • High 8.8

    Sandboxie-Plus NamedPipeServer OpenHandler stack overflow via unterminated server field

    Sandboxie-Plus is an open source sandbox-based isolation software for Windows. In versions 1.17.2 and earlier, NamedPipeServer::OpenHandler copies the server field from NAMED_PIPE_OPEN_REQ into a fixed WCHAR pipename[160] stack buffer using wcscat without ver…

  • High 7.3

    Sandboxie-Plus ProcessServer boxname stack buffer overflows via unterminated wide string copy

    Sandboxie-Plus is an open source sandbox-based isolation software for Windows. In versions 1.17.2 and earlier, several ProcessServer handlers (KillAllHandler, SuspendAllHandler, and RunSandboxedHandler) copy a WCHAR boxname[34] field from request structures i…

  • Medium 5.3

    Apache HTTP Server: mod_proxy_ajp: Heap Buffer Over-Read Due to Missing Null-Termination Check (ajp_msg_get_string)

    Improper Null Termination, Out-of-bounds Read vulnerability in Apache HTTP Server. This issue affects Apache HTTP Server: through 2.4.66. Users are recommended to upgrade to version 2.4.67, which fixes the issue.

  • High 7.1

    netfilter: x_tables: ensure names are nul-terminated

    In the Linux kernel, the following vulnerability has been resolved: netfilter: x_tables: ensure names are nul-terminated Reject names that lack a \0 character before feeding them to functions that expect c-strings. Fixes tag is the most recent commit that nee…

  • Low 3.5

    libgphoto2 missing null termination in ptp_unpack_Canon_FE() filename buffer in ptp-pack.c

    libgphoto2 is a camera access and control library. In versions up to and including 2.5.33, a missing null terminator exists in ptp_unpack_Canon_FE() in camlibs/ptp2/ptp-pack.c (line 1377). The function copies a filename into a 13-byte buffer using strncpy wit…

  • Low 2.9

    jq: Embedded-NUL Truncation in CLI JSON Input Path Causes Prefix-Only Validation of Malformed Input

    jq is a command-line JSON processor. Commits before 6374ae0bcdfe33a18eb0ae6db28493b1f34a0a5b contain a vulnerability where CLI input parsing allows validation bypass via embedded NUL bytes. When reading JSON from files or stdin, jq uses strlen() to determine …

  • Low 2.8

    Gimp: gimp: application crash (dos) via crafted psd file due to heap-buffer-overflow

    A flaw was found in GIMP. Heap-buffer-overflow vulnerability exists in the fread_pascal_string function when processing a specially crafted PSD (Photoshop Document) file. This occurs because the buffer allocated for a Pascal string is not properly null-termin…

  • Medium 4.0

    mackron / miniaudio Out-of-Bounds Read in BEXT Coding History Parsing

    miniaudio version 0.11.25 and earlier (fixed in commits 1df46ae and 1df46ae) contain a heap out-of-bounds read vulnerability in the WAV BEXT metadata parser that allows attackers to trigger memory access violations by processing crafted WAV files. Attackers c…

  • Low 2.9

    Golioth Firmware SDK < 0.22.0 Blockwise Transfer Path Out-of-Bounds Read

    Golioth Firmware SDK version 0.19.1 prior to 0.22.0, fixed in commit 0e788217, contain an out-of-bounds read due to improper null termination of a blockwise transfer path. blockwise_transfer_init() accepts a path whose length equals CONFIG_GOLIOTH_COAP_MAX_PA…

  • High 7.1

    iccDEV has HBO in CIccTagTextDescription::Release()

    iccDEV provides a set of libraries and tools for working with ICC color management profiles. In versions up to and including 2.3.1.4, heap-buffer-overflow read occurs during CIccTagTextDescription::Release() when strlen() reads past a heap buffer while parsin…

  • High 8.5
    CVE-2025-67733 Public exploit

    Valkey Affected by RESP Protocol Injection via Lua error_reply

    Valkey is a distributed key-value database. Prior to versions 9.0.2, 8.1.6, 8.0.7, and 7.2.12, a malicious user can use scripting commands to inject arbitrary information into the response stream for the given client, potentially corrupting or returning tampe…

  • Medium 6.1

    iccDEV has a heap-buffer-overflow in icXmlParseTextString()

    iccDEV provides a set of libraries and tools that allow for the interaction, manipulation, and application of ICC color management profiles. Prior to version 2.3.1.2, a heap buffer over-read when the strlen() function attempts to read a non-null-terminated bu…

  • Medium 6.1

    iccDEV has Out-of-bounds Read, Heap-based Buffer Overflow and Improper Null Termination

    iccDEV provides a set of libraries and tools for working with ICC color management profiles. Versions 2.3.1.1 and below are vulnerable to Out-of-bounds Read, Heap-based Buffer Overflow and Improper Null Termination through its CIccTagText::Read function. This…

  • High 7.1
    CVE-2025-2026 Public exploit

    The NPort 6100-G2/6200-G2 Series is affected by a high-severity vulnerability (CVE-2025-2026) that allows remote attack…

  • Critical 9.8

    An issue was discovered in DriveLock 24.1 before 24.1.6, 24.2 before 24.2.7, and 25.1 before 25.1.5. An unprivileged us…

  • Medium 5.0

    Envoy’s TLS certificate matcher for `match_typed_subject_alt_names` may incorrectly treat certificates containing an embedded null byte

    Envoy is a high-performance edge/middle/service proxy. In 1.33.12, 1.34.10, 1.35.6, 1.36.2, and earlier, Envoy’s mTLS certificate matcher for match_typed_subject_alt_names may incorrectly treat certificates containing an embedded null byte (\0) inside an OTHE…

  • Medium 6.9

    Wazuh vulnerable to Heap-based Buffer Over-read in w_expression_match

    Wazuh is a free and open source platform used for threat prevention, detection, and response. Prior to 4.12.0, a buffer over-read occurs in w_expression_match() when strlen() is called on str_test, because the corresponding buffer is not being properly NULL t…

  • Medium 5.5

    python-ldap Vulnerable to Improper Encoding or Escaping of Output and Improper Null Termination

    python-ldap is a lightweight directory access protocol (LDAP) client API for Python. In versions prior to 3.4.5, ldap.dn.escape_dn_chars() escapes \x00 incorrectly by emitting a backslash followed by a literal NUL byte instead of the RFC-4514 hex form \00. An…

  • Medium 5.3

    Improper Null Termination in libfluid_msg library

    Improper Null Termination vulnerability in Open Networking Foundation (ONF) libfluid (libfluid_msg module). This vulnerability is associated with program routine fluid_msg::of10::Port:unpack. This issue affects libfluid: 0.1.0.

  • High 7.6

    Microsoft SQL Server Information Disclosure Vulnerability

    Microsoft SQL Server Information Disclosure Vulnerability

  • High 8.4

    Multiple vulnerabilities in libnv

    A missing null-termination character in the last element of an nvlist array string can lead to writing outside the allocated buffer.