CWE-626: Null Byte Interaction Error (Poison Null Byte)
5 CVEs have CWE-626 as their primary weakness. 0 of them are in the CISA KEV catalog. The highest EPSS score among them is 2.737%.
The product does not properly handle null bytes or NUL characters when passing data between different representations or components.
A null byte (NUL character) can have different meanings across representations or languages. For example, it is a string terminator in standard C libraries, but Perl and PHP strings do not treat it as a terminator. When two representations are crossed - such as when Perl or PHP invokes underlying C functionality - this can produce an interaction error with unexpected results. Similar issues have been reported for ASP. Other interpreters written in C might also be affected. The poison null byte is frequently useful in path traversal attacks by terminating hard-coded extensions that are added to a filename. It can play a role in regular expression processing in PHP.
Child of CWE-147: Improper Neutralization of Input Terminators
Mitigations
- Implementation: Remove null bytes from all incoming strings.
Observed examples
- CVE-2005-4155: NUL byte bypasses PHP regular expression check
- CVE-2005-3153: inserting SQL after a NUL byte bypasses allowlist regexp, enabling SQL injection
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-626'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-626'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).