Prototype Pollution in Node.js

nodejs Updated 02 Oct 2025

Summary

24/02/2022
N/A
Yes i
High
8.2

CVE-2022-21824: Due to the formatting logic of the "console.table()" function it was not safe to allow user controlled input to be passed to the "properties" parameter while simultaneously passing a plain object with at least one proper... Affects nodejs across 2 version ranges.

>= 2f45ad8060e13d5ac912335096d21526f2f9602b, < 4e44cbfba6bbb87aa15564ea6856a556804f71c0 < 12.22.10-r0

Fixed in 12.22.10-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 and high-performance applications. However, Node.js is susceptible to various security vulnerabilities, including prototype pollution.

Vulnerability Detail

The vulnerability identified as CVE-2022-21824 is a prototype pollution issue in Node.js. It arises due to the unsafe usage of user-controlled input in the 'console.table()' function. When passing a plain object with at least one property as the first parameter and allowing user-controlled input in the 'properties' parameter, it becomes possible to pollute the prototype of the object. This pollution is limited and only allows assigning an empty string to numerical keys of the object prototype. The affected versions of Node.js (>= 12.22.9, >= 14.18.3, >= 16.13.2, and >= 17.3.1) use a null prototype for the object where these properties are being assigned.

How To Fix

Minimum fixed version

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

There is no known workaround for this vulnerability. It is crucial to update Node.js to the fixed versions as mentioned above.

Conclusion

The prototype pollution vulnerability in Node.js (CVE-2022-21824) can have severe implications for the security and stability of applications. It is crucial to update Node.js to the fixed versions mentioned above to mitigate the risk. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for nodejs →

Share this vulnerability

FAQ

Prototype pollution is a vulnerability that occurs when an attacker can modify the prototype of an object and introduce malicious properties or modify existing ones. This can lead to unexpected behavior and security issues in the application.

The prototype pollution vulnerability in Node.js can be exploited by an attacker to modify object prototypes and potentially manipulate the application's behavior. This can lead to security bypasses, data tampering, or denial of service attacks.

Node.js versions >= 12.22.9, >= 14.18.3, >= 16.13.2, and >= 17.3.1 are affected by this vulnerability.

No, there are no known workarounds for this vulnerability. It is essential to update Node.js to the fixed versions.

You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert analyzes the manifest file (e.g., package-lock.json) to identify and alert in real-time for open-source vulnerabilities.

Related vulnerabilities

Recent vulnerabilities recorded for nodejs.

How To Fix

Minimum fixed version

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