---
id: CVE-2018-7159
title: >-
  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`
summary: >-
  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 …
severity: medium
cvss: 5.3
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N'
cwe:
  - CWE-115
  - CWE-20
vendor: nodejs
product: node.js
affected:
  - 'node.js >= 4.0.0, <= 4.1.2'
  - 'node.js >= 4.2.0, < 4.9.0'
  - 'node.js >= 6.0.0, <= 6.8.1'
  - 'node.js >= 6.9.0, < 6.14.0'
  - 'node.js >= 8.0.0, <= 8.8.1'
  - 'node.js >= 8.9.0, < 8.11.0'
  - 'node.js >= 9.0.0, < 9.10.0'
patched:
  - node.js 9.10.0
published: '2018-05-17'
updated: '2026-10-08'
sourceUpdated: '2026-10-08T22:16:47.490'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2018-7159'
references:
  - url: 'https://access.redhat.com/errata/RHSA-2019:2258'
    label: cve-request@iojs.org
  - url: 'https://nodejs.org/en/blog/vulnerability/march-2018-security-releases/'
    label: cve-request@iojs.org
  - url: >-
      https://support.f5.com/csp/article/K27228191?utm_source=f5support&amp%3Butm_medium=RSS
    label: cve-request@iojs.org
  - url: 'https://access.redhat.com/errata/RHSA-2019:2258'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://nodejs.org/en/blog/vulnerability/march-2018-security-releases/'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: >-
      https://support.f5.com/csp/article/K27228191?utm_source=f5support&amp%3Butm_medium=RSS
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2018/cve-2018-7159.json
  - url: 'https://access.redhat.com/security/cve/CVE-2018-7159'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=1561981'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2018-7159'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2018-7159'
  - url: 'https://access.redhat.com/errata/RHSA-2018:2949'
tags:
  - nvd
  - csaf
  - vex
  - red-hat
epss: 0.03565
epssPercentile: 0.89047
ingestedAt: '2026-10-08T23:16:47.289Z'
---

## Overview

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

- `node.js >= 4.0.0, <= 4.1.2`
- `node.js >= 4.2.0, < 4.9.0`
- `node.js >= 6.0.0, <= 6.8.1`
- `node.js >= 6.9.0, < 6.14.0`
- `node.js >= 8.0.0, <= 8.8.1`
- `node.js >= 8.9.0, < 8.11.0`
- `node.js >= 9.0.0, < 9.10.0`

## Remediation

Upgrade past the affected range:

- `node.js 9.10.0`

## Vendor advisories

- **RHSA-2019:2258** · Red Hat · fixed in: Red Hat Enterprise Linux Client (v. 7), Red Hat Enterprise Linux Client Optional (v. 7), Red Hat Enterprise Linux ComputeNode (v. 7), Red Hat Enterprise Linux ComputeNode Optional (v. 7), Red Hat Enterprise Linux Server (v. 7), Red Hat Enterprise Linux Server Optional (v. 7), … · released 2019-08-06 · [advisory](https://access.redhat.com/errata/RHSA-2019:2258)
- **RHSA-2018:2949** · Red Hat · fixed in: Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7), Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.4), Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.5), Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) · released 2018-10-18 · [advisory](https://access.redhat.com/errata/RHSA-2018:2949)
- **Red Hat VEX** · Low · affected: Red Hat Software Collections · no fix planned: Red Hat Software Collections · updated 2026-10-09 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2018/cve-2018-7159.json)
