VariantIncomplete

CWE-158Improper Neutralization of Null Byte or NUL Character

Category: other

Description

The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes NUL characters or null bytes when they are sent to a downstream component. As data is parsed, an injected NUL character or null byte may cause the product to believe the input is terminated earlier than it actually is, or otherwise cause the input to be misinterpreted. This could then be used to inject potentially dangerous input that occurs after the null byte or otherwise bypass validation routines and other protection mechanisms.

Common consequences· 1

  • Integrity — Unexpected State

Potential mitigations· 3

  • []Developers should anticipate that null characters or null bytes will be injected/removed/manipulated in the input vectors of their product. Use an appropriate combination of denylists and allowlists to ensure only valid, expected and appropriate input is processed by the system.
  • [Implementation]
  • [Implementation]Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.

Related CAPEC attack patterns· 2

CAPEC-52CAPEC-53

References

  1. https://cwe.mitre.org/data/definitions/158.html

Exploits (incoming)2

TypeTargetConfidenceTier
AttackPatternPostfix, Null Terminate, and Backslashcapec-53100%live
AttackPatternEmbedding NULL Bytescapec-52100%live

(incoming)7

TypeTargetConfidenceTier
VulnerabilityCVE-2025-14388cve-2025-143880%live
VulnerabilityWing FTP Server Improper Neutralization of Null Byte or NUL Character Vulnerabilitycve-2025-478120%live
VulnerabilityCVE-2025-55113cve-2025-551130%live
VulnerabilityCVE-2026-33191cve-2026-331910%live
KEVEntrySophos Firewall Authentication Bypass Vulnerabilitykev-cve-2022-10400%live
KEVEntryAtlassian Bitbucket Server and Data Center Command Injection Vulnerabilitykev-cve-2022-368040%live
KEVEntryWing FTP Server Improper Neutralization of Null Byte or NUL Character Vulnerabilitykev-cve-2025-478120%live

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Improper Neutralization of Expression/Command Delimiters
CWE
Improper Neutralization of Leading Special Elements
CWE
Improper Neutralization of Multiple Leading Special Elements
CWE
Null Byte Interaction Error (Poison Null Byte)
CWE
Improper Neutralization of Trailing Special Elements
CWE
Improper Neutralization of Multiple Trailing Special Elements
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.