What is CWE-158?
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.
CWE-158 is a variant-level weakness in MITRE’s Common Weakness Enumeration. Applicable platforms: Language: Not Language-Specific; Language: C; Language: C++; Technology: Not Technology-Specific.
Source: MITRE CWE (CWE-158 definition, reproduced verbatim). Counts and linkage below are Threadlinqs data.
Consequences
- Integrity — Unexpected State
Source: MITRE CWE, common consequences.
How CWE-158 is exploited in the wild
Threadlinqs maps 3 CVEs to CWE-158, published between 2009-05-29 and 2026-11-17. 2 are listed in CISA’s Known Exploited Vulnerabilities catalog, the authoritative record of exploitation in the wild, and 1 is tied to ransomware campaigns. By CVSS v3 severity the set splits into 1 critical, 1 high, 1 medium. The highest EPSS score in the set is 93.2% (CVE-2025-47812), the modelled probability of exploitation in the next 30 days. 6 tracked threats reference CWE-158 directly or through a CVE it covers; the most recent is “Microsoft Edge Logic-Bug Full Chain: UXSS, Immersive Reader File Write and protocols.json Hijack Escape Sandbox to Windows Code Execution (Pwn2Own Berlin 2026)” (2026-11-01). Affected products concentrate in Apache Software Foundation (1), Microsoft (1), Wftpserver (1).
Vulnerabilities (CVEs)
All 3 CVEs mapped to CWE-158, CISA KEV first, then by CVSS score.
- CVE-2025-47812 — CISA KEV · CVSS 10 critical · EPSS 93.2% · published 2025-07-10
- CVE-2009-1537 — CISA KEV · CVSS 8.8 high · EPSS 51.2% · published 2009-05-29
- CVE-2026-129512 — CVSS 5.3 medium · EPSS 0.4% · published 2026-11-17
Affected vendors
- Apache Software Foundation — 1 CVE
- Microsoft — 1 CVE
- Wftpserver — 1 CVE
Threat activity
6 tracked threats cite CWE-158:
- Microsoft Edge Logic-Bug Full Chain: UXSS, Immersive Reader File Write and protocols.json Hijack Escape Sandbox to Windows Code Execution (Pwn2Own Berlin 2026)HIGH
- Eclypsium InfraTrust Pulse (Oct 2026): Actively Exploited Flaws Across Network Infrastructure Appliances (NetScaler CVE-2026-88771, Ivanti CVE-2026-104935, Check Point CVE-2026-93616, Cisco, Arista VeloCloud, FortiMail, F5 BIG-IP APM, PAN-OS, PHP2Shell, Linux Copy Fail)CRITICAL
- Fortinet FortiMail critical path traversal flaw CVE-2026-104286 (FG-IR-26-175) exploited in zero-day attacksCRITICAL
- Node.js June 2026 Security Release — 12 Vulnerabilities Across 22.x/24.x/26.x Including Two High-Severity TLS Authentication Bypass and WebCrypto DoS Flaws (CVE-2026-48618, CVE-2026-48933)HIGH
- CISA KEV Catalog Adds Seven Vulnerabilities (May 20, 2026) — Microsoft Defender CVE-2026-41091 (EoP) and CVE-2026-45498 (DoS) Headline Active Exploitation BatchHIGH
- Wing FTP Server RCE Exploit Chain — Lua Code Injection via NULL Byte (CVE-2025-47812 CVSS 10.0 + CVE-2025-47813)CRITICAL
Mitigations
- General: 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 / Input Validation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected…
- Implementation / Input Validation: 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.
Source: MITRE CWE, potential mitigations.