CAPEC-52 Metadata
Likelihood of Attack
High
Typical Severity
High
Overview
Summary
An adversary embeds one or more null bytes in input to the target software. This attack relies on the usage of a null-valued byte as a string terminator in many environments. The goal is for certain components of the target software to stop processing the input when it encounters the null byte(s).
Prerequisites
The program does not properly handle postfix NULL terminators
Execution Flow
Step | Phase | Description | Techniques |
---|---|---|---|
1 | Explore | [Survey the application for user-controllable inputs] Using a browser, an automated tool or by inspecting the application, an adversary records all entry points to the application. |
|
2 | Experiment | [Probe entry points to locate vulnerabilities] The adversary uses the entry points gathered in the "Explore" phase as a target list and injects postfix null byte(s) to observe how the application handles them as input. The adversary is looking for areas where user input is placed in the middle of a string, and the null byte causes the application to stop processing the string at the end of the user input. |
|
3 | Exploit | [Remove data after null byte(s)] After determined entry points that are vulnerable, the adversary places a null byte(s) such that they remove data after the null byte(s) in a way that is beneficial to them. |
|
Potential Solutions / Mitigations
Properly handle the NULL characters supplied as part of user input prior to doing anything with the data.
Related Weaknesses (CWE)
CWE ID | Description |
---|---|
CWE-20 | Improper Input Validation |
CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') |
CWE-158 | Improper Neutralization of Null Byte or NUL Character |
CWE-172 | Encoding Error |
CWE-173 | Improper Handling of Alternate Encoding |
CWE-697 | Incorrect Comparison |
CWE-707 | Improper Neutralization |
Related CAPECs
CAPEC ID | Description |
---|---|
CAPEC-267 | An adversary leverages the possibility to encode potentially harmful input or content used by applications such that the applications are ineffective at validating this encoding standard. |
Taxonomy Mappings
Taxonomy: WASC
Entry ID | Entry Name |
---|---|
28 | Null Byte Injection |
Taxonomy: OWASP Attacks
Entry ID | Entry Name |
---|---|
Link | Embedding Null Code |
Stay Ahead of Attack Patterns
Understanding CAPEC patterns helps security professionals anticipate and thwart potential attacks. Leverage these insights to enhance threat modeling, strengthen your software development lifecycle, and train your security teams effectively.