Critical Memory Corruption Vulnerability in Node.js - CVE-2021-22930

nodejs Updated 02 Oct 2025

Summary

07/10/2021
N/A
Yes i
Critical
9.8

ALPINE-CVE-2021-22930: Node.js before 16.6.0, 14.17.4, and 12.22.4 is vulnerable to a use after free attack where an attacker might be able to exploit the memory corruption, to change process behavior. Affects nodejs versions < 12.22.4-r0. Fixed in 12.22.4-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 open-source runtime environment that allows developers to execute JavaScript code server-side. It is widely used for building scalable network applications. The vulnerability identified as CVE-2021-22930 affects multiple versions of Node.js, specifically versions prior to 16.6.0, 14.17.4, and 12.22.4. This vulnerability exposes applications to potential memory corruption, which can lead to severe security risks.

Vulnerability Detail

CVE-2021-22930 is a use-after-free vulnerability that occurs when memory is freed but still accessed, allowing an attacker to exploit this flaw. This can lead to unexpected behavior in the application, including the potential for arbitrary code execution, data corruption, or denial of service. The vulnerability is particularly dangerous due to its high CVSS score of 9.8, indicating critical severity.

How To Fix

Minimum fixed version

12.22.4-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 immediate upgrading is not feasible, consider implementing strict input validation and sanitization to mitigate the risk of exploitation. Additionally, running applications in a restricted environment can help limit the impact of potential attacks.

Conclusion

CVE-2021-22930 is a critical vulnerability in Node.js that poses significant risks to applications using affected versions. It is crucial to update to the latest patched versions to protect against potential exploitation. Utilizing tools like Vulert can help monitor and manage vulnerabilities effectively.

See every vulnerability recorded for nodejs →

Share this vulnerability

FAQ

CVE-2021-22930 is a critical vulnerability in Node.js that allows for memory corruption, potentially leading to arbitrary code execution.

Node.js versions prior to 16.6.0, 14.17.4, and 12.22.4 are affected by this vulnerability.

You can use Vulert, which monitors open-source vulnerabilities in your software. By uploading your manifest file like package-lock.json, you can check for vulnerabilities without needing to install any software.

The CVSS score for CVE-2021-22930 is 9.8, indicating a critical level of severity.

If immediate upgrading is not possible, implement strict input validation and run your applications in a restricted environment to mitigate risks.

Related vulnerabilities

Recent vulnerabilities recorded for nodejs.

How To Fix

Minimum fixed version

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