1395
The product does not properly handle null bytes or NUL characters when passing data between
different representations or components.
Extended Description
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.
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 436 Interpretation Conflict 1057
ChildOf 147 Improper Neutralization of Input Terminators 389
Weakness Ordinalities
Primary :
Applicable Platforms
Language : PHP (Prevalence = Undetermined)
Language : Perl (Prevalence = Undetermined)
Language : ASP.NET (Prevalence = Undetermined)
Common Consequences
Scope Impact Likelihood
Integrity Unexpected State
Potential Mitigations
Phase: Implementation
Remove null bytes from all incoming strings.
Observed Examples
Reference Description
CVE-2005-4155 NUL byte bypasses PHP regular expression check
https://www.cve.org/CVERecord?id=CVE-2005-4155
CVE-2005-3153 inserting SQL after a NUL byte bypasses allowlist regexp, enabling SQL
injection
https://www.cve.org/CVERecord?id=CVE-2005-3153
MemberOf Relationships
This MemberOf relationships table shows additional CWE Catgeories and Views that reference this
weakness as a member. This information is often useful in understanding where a weakness fits
within the context of external information sources.
CWE Version 4.14
CWE-627: Dynamic Variable Evaluation
CWE-627: Dynamic Variable Evaluation