This weakness occurs when an application receives data but fails to properly handle or remove NUL characters (\0) before passing that data to another system component.
A NUL character (represented as '\0' or a zero byte) is a standard marker for the end of a string in many programming languages and systems. When an attacker injects this character into input data, the application may incorrectly interpret it as the end of the data, effectively ignoring any content that comes after it. This can trick validation checks or processing logic into seeing only a harmless first part of the input, while the dangerous payload hidden after the NUL byte gets passed through. This bypass is a classic technique for manipulating file paths, configuration strings, or command arguments. For instance, an attacker could submit a filename like "safe.txt\0malicious.php" to bypass extension filters that stop checking at the NUL, potentially leading to unauthorized file access or code execution. The core defense is to treat NUL characters as invalid data within the relevant context and to reject or sanitize inputs that contain them.
Impact: Unexpected State
Strategy: Input Validation
Strategy: Input Validation