---
id: CVE-2018-7166
title: >-
  In all versions of Node.js 10 prior to 10.9.0, an argument processing flaw can
  cause `Buffer.alloc()` to return uninitialized memory
summary: >-
  In all versions of Node.js 10 prior to 10.9.0, an argument processing flaw can
  cause `Buffer.alloc()` to return uninitialized memory. This method is intended
  to be safe and only return initialized, or cleared, memory. The third argument
  …
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'
cwe:
  - CWE-226
  - CWE-908
  - CWE-200
vendor: nodejs
product: node.js
affected:
  - 'node.js >= 10.0.0, < 10.9.0'
patched:
  - node.js 10.9.0
published: '2018-08-21'
updated: '2026-10-08'
sourceUpdated: '2026-10-08T22:16:48.227'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2018-7166'
references:
  - url: 'https://access.redhat.com/errata/RHSA-2018:2553'
    label: cve-request@iojs.org
  - url: 'https://nodejs.org/en/blog/vulnerability/august-2018-security-releases/'
    label: cve-request@iojs.org
  - url: 'https://access.redhat.com/errata/RHSA-2018:2553'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: 'https://nodejs.org/en/blog/vulnerability/august-2018-security-releases/'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2018/cve-2018-7166.json
  - url: 'https://access.redhat.com/security/cve/CVE-2018-7166'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=1620215'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2018-7166'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2018-7166'
  - url: 'https://access.redhat.com/errata/RHBA-2019:0772'
tags:
  - nvd
  - csaf
  - vex
  - red-hat
  - score-dispute
epss: 0.02794
epssPercentile: 0.86057
ingestedAt: '2026-10-08T23:16:47.292Z'
scores:
  nvd: 7.5
  vendor: 5.3
---

## Overview

In all versions of Node.js 10 prior to 10.9.0, an argument processing flaw can cause `Buffer.alloc()` to return uninitialized memory. This method is intended to be safe and only return initialized, or cleared, memory. The third argument specifying `encoding` can be passed as a number, this is misinterpreted by `Buffer's` internal "fill" method as the `start` to a fill operation. This flaw may be abused where `Buffer.alloc()` arguments are derived from user input to return uncleared memory blocks that may contain sensitive information.

## Affected

- `node.js >= 10.0.0, < 10.9.0`

## Remediation

Upgrade past the affected range:

- `node.js 10.9.0`

## Vendor advisories

- **RHBA-2019:0772** · 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 Server EUS (v. 7.6), Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) · released 2019-04-17 · [advisory](https://access.redhat.com/errata/RHBA-2019:0772)
- **RHSA-2018:2553** · Red Hat · fixed in: Red Hat OpenShift Application Runtimes Node.js 10 · released 2018-08-22 · [advisory](https://access.redhat.com/errata/RHSA-2018:2553)
