Buffer Initialization Bug in Node.js

nodejs Updated 02 Oct 2025

Summary

11/12/2017
N/A
Yes i
Low
3.1

CVE-2017-15897: Node.js had a bug in versions 8.X and 9.X which caused buffers to not be initialized when the encoding for the fill value did not match the encoding specified. Affects nodejs across 2 version ranges.

< 8.9.3-r0 >= f76ce0a75641991bfc235775a4747c978e0e281b, < 8a44289089a08b7b19fa3c4651b5f1f5d1edd71b

Fixed in 8.9.3-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Node.js is a popular JavaScript runtime built on Chrome's V8 JavaScript engine. It allows developers to build scalable network applications and is widely used for server-side and networking applications. However, Node.js versions 8.X and 9.X had a vulnerability related to buffer initialization.

Vulnerability Detail

The vulnerability (CVE-2017-15897) in Node.js versions 8.X and 9.X caused buffers to not be properly initialized when the encoding for the fill value did not match the encoding specified. This means that if the encoding was incorrect, the buffer would not be initialized to all zeros as expected. This could lead to potential security issues, as uninitialized buffers may contain sensitive data from previous usage or expose uninitialized memory.

How To Fix

Minimum fixed version

8.9.3-r0

This is the first release that contains the fix.

sudo apk add --upgrade nodejs

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating Node.js is not immediately possible, a workaround for this vulnerability is to ensure that the encoding for the fill value matches the encoding specified. For example, when using the 'Buffer.alloc' function, make sure the encoding parameter is set correctly. This will ensure that the buffer is properly initialized even if the encoding is incorrect.

Conclusion

The buffer initialization bug in Node.js versions 8.X and 9.X could lead to potential security issues. It is recommended to update Node.js to version 8.9.3-r0 or later to fix this vulnerability. If immediate update is not possible, ensure correct encoding for fill values as a workaround. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for nodejs →

Share this vulnerability

FAQ

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It allows developers to build scalable network applications and is widely used for server-side and networking applications.

Node.js versions 8.X and 9.X are affected by this vulnerability.

The uninitialized buffers could contain sensitive data from previous usage or expose uninitialized memory, potentially leading to security issues.

To fix this vulnerability, update Node.js to version 8.9.3-r0 or later. Follow the official Node.js documentation for your platform or package manager for instructions.

Yes, if updating Node.js is not immediately possible, ensure that the encoding for the fill value matches the encoding specified when using buffer functions.

Related vulnerabilities

Recent vulnerabilities recorded for nodejs.

How To Fix

Minimum fixed version

8.9.3-r0

This is the first release that contains the fix.

sudo apk add --upgrade nodejs

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback