What’s Vulnerable › Vulnerabilities
CVE-2018-7159
- Severity: medium (CVSS 5.3 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 3.5% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2018-05-17 · updated 2026-10-08
- Weakness: CWE-115
Description
The HTTP parser in all current versions of Node.js ignores spaces in the `Content-Length` header, allowing input such as `Content-Length: 1 2` to be interpreted as having a value of `12`. The HTTP specification does not allow for spaces in the `Content-Length` value and the Node.js HTTP parser has been brought into line on this particular difference. The security risk of this flaw to Node.js users is considered to be VERY LOW as it is difficult, and may be impossible, to craft an attack that makes use of this flaw in a way that could not already be achieved by supplying an incorrect value for `Content-Length`. Vulnerabilities may exist in user-code that make incorrect assumptions about the potential accuracy of this value compared to the actual length of the data supplied. Node.js users crafting lower-level HTTP utilities are advised to re-check the length of any input supplied after parsing is complete.
Affected products
- Node.js: from 4.0.0 through 4.1.2; from 4.2.0 before 4.9.0; from 6.0.0 through 6.8.1; from 6.9.0 before 6.14.0; from 8.0.0 through 8.8.1; from 8.9.0 before 8.11.0 — fixed in 4.9.0, 6.14.0, 8.11.0, 9.10.0
How to fix
Upgrade to a fixed version: Node.js 4.9.0, 6.14.0, 8.11.0, 9.10.0. Check the vendor advisory for mitigations.
References
- https://access.redhat.com/errata/RHSA-2019:2258
- https://nodejs.org/en/blog/vulnerability/march-2018-security-releases/
- https://support.f5.com/csp/article/K27228191?utm_source=f5support&%3Butm_medium=RSS
- https://access.redhat.com/errata/RHSA-2019:2258
- https://nodejs.org/en/blog/vulnerability/march-2018-security-releases/
- https://support.f5.com/csp/article/K27228191?utm_source=f5support&%3Butm_medium=RSS
Get alerted when CVE-2018-7159 or the next vulnerability affects your stack