Memory Corruption Vulnerability in Node.js

nodejs Updated 02 Oct 2025

Summary

24/07/2020
N/A
Yes i
High
8.1

CVE-2020-8174: napi_get_value_string_*() allows various kinds of memory corruption in node < 10.21.0, 12.18.0, and < 14.4.0. Affects nodejs across 2 version ranges.

< 12.20.1-r0 < 23adb548a57db0c56e359265108e7fe71d8b4f73

Fixed in 12.20.1-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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Node.js is a popular JavaScript runtime built on Chrome's V8 JavaScript engine. It allows developers to build scalable and high-performance applications. However, a memory corruption vulnerability has been discovered in versions prior to 10.21.0, 12.18.0, and 14.4.0. This vulnerability, identified as CVE-2020-8174, affects the napi_get_value_string_*() function in Node.js.

Vulnerability Detail

The napi_get_value_string_*() function in Node.js is susceptible to various types of memory corruption. This vulnerability can be exploited by an attacker to execute arbitrary code or cause a denial of service. The issue arises due to improper handling of certain input values, leading to memory corruption. Attackers can potentially exploit this vulnerability to gain unauthorized access, escalate privileges, or disrupt the normal functioning of the affected Node.js application.

How To Fix

Minimum fixed version

12.20.1-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

As a temporary workaround, developers can consider implementing input validation and sanitization techniques to prevent malicious input from triggering the memory corruption vulnerability. By carefully validating and sanitizing user input, the risk of exploitation can be reduced. Here is an example of input validation in Node.js:

const userInput = req.body.userInput;

if (typeof userInput === 'string') {
  // Proceed with further processing
} else {
  // Handle invalid input
}

Conclusion

The memory corruption vulnerability in Node.js can have serious security implications. It is crucial to update to a fixed version of Node.js, preferably version 12.20.1 or later, to mitigate the risk of exploitation. Implementing input validation and sanitization techniques can provide temporary protection until the update is applied. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for nodejs →

Share this vulnerability

FAQ

This vulnerability can allow attackers to execute arbitrary code or cause a denial of service. It may lead to unauthorized access, privilege escalation, or disruption of the affected Node.js application.

Versions prior to 10.21.0, 12.18.0, and 14.4.0 are affected by this vulnerability.

At the time of this report, there are no known exploits for this vulnerability. However, it is important to update Node.js to a fixed version to prevent potential exploitation.

Yes, a patch is available in Node.js version 12.20.1 and later. It is recommended to update to the latest version to address this vulnerability.

If updating to the latest version is not feasible, consider implementing input validation and sanitization techniques to mitigate the risk of exploitation. Additionally, monitor for any security updates or patches provided by the Node.js community.

Related vulnerabilities

Recent vulnerabilities recorded for nodejs.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

12.20.1-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