CVE-2018-7159
Reported by nodejs · Published May 17, 2018
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| http-parser | Amazon Linux | 2.7.1-8.amzn2 |
| http-parser-devel | Amazon Linux | 2.7.1-8.amzn2 |
| nodejs-current | Alpine | 9.10.0-r0 |
| nodejs | Alpine | 8.11.0-r0 |
| node | DHI | 9.10.0, 8.11.0, 6.14.0, 4.9.0 |
| alpine/nodejs-25 | alpine | 9.10.0, 8.11.0, 6.14.0, 4.9.0 |
| alpine/nodejs-20 | alpine | 9.10.0, 8.11.0, 6.14.0, 4.9.0 |
| node.js | nodejs | 9.10.0, 8.11.0, 8.8.1, 6.14.0, 6.8.1, 4.9.0, 4.1.2 |
| alpine/nodejs-24 | alpine | 9.10.0, 8.11.0, 6.14.0, 4.9.0 |
Affected products
| Vendor | Product | Versions |
|---|---|---|
| The Node.js Project | Node.js | 4.x, 6.x, 8.x |
| amazon:2 | http-parser | 0 |
| amazon:2 | http-parser-devel | 0 |
| alpine | nodejs-current | 0 |
| alpine | nodejs | 0 |
| The Node.js Project | Node.js | 8.x, 4.x, 6.x |
Timeline
- Apr 16, 2018 CVE Published
- Apr 14, 2021 EPSS Score (30 in total, the first dated here)
- Jun 1, 2026 Security Advisory (65 in total, the first dated here)
- Sep 19, 2026 Coalition ESS Score
- Oct 9, 2026 Distribution Patch (61 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2018-7159
vulnetix vdb fixes CVE-2018-7159
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2018-7159/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- x_refsource_CONFIRM
- RHSA-2019:2258 vendor-advisoryx_refsource_REDHAT
- x_refsource_CONFIRM