Node.js OS Command Injection Vulnerability - CVE-2022-32212

nodejs Updated 02 Oct 2025

Summary

14/07/2022
N/A
Yes i
High
8.1

UBUNTU-CVE-2022-32212: A OS Command Injection vulnerability exists in Node.js versions. Affects nodejs versions < 8.10.0~dfsg-2ubuntu0.4+esm4. Fixed in 8.10.0~dfsg-2ubuntu0.4+esm4. 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 Penetration testing for web, API and mobile 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 affected versions of Node.js are vulnerable to an OS Command Injection due to insufficient validation in the IsAllowedHost check, which can lead to serious security issues.

Vulnerability Detail

A OS Command Injection vulnerability exists in Node.js versions <14.20.0, <16.20.0, <18.5.0. This vulnerability arises from an inadequate IsAllowedHost check that can be easily bypassed because the IsIPAddress function does not properly validate whether an IP address is invalid before making database requests. This flaw allows attackers to perform rebinding attacks, potentially compromising the system's integrity and confidentiality.

How To Fix

Minimum fixed version

8.10.0~dfsg-2ubuntu0.4+esm4

This is the first release that contains the fix.

sudo apt-get install --only-upgrade nodejs

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

Workaround

As a temporary measure, you can restrict access to the affected Node.js services by implementing network-level controls or using firewalls to limit incoming requests to trusted IP addresses only.

Conclusion

CVE-2022-32212 represents a significant security risk for applications using vulnerable versions of Node.js. It is crucial for developers and system administrators to update their Node.js installations to the latest patched versions to mitigate this risk. Implementing network-level controls can serve as a temporary workaround until the update is applied.

See every vulnerability recorded for nodejs →

Share this vulnerability

FAQ

CVE-2022-32212 is a vulnerability in Node.js that allows for OS Command Injection due to insufficient validation of host addresses.

Node.js versions prior to 14.20.0, 16.20.0, and 18.5.0 are affected by this vulnerability.

Exploitation of this vulnerability could allow attackers to execute arbitrary commands on the server, leading to data breaches or system compromise.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score for CVE-2022-32212 is 8.1, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for nodejs.

How To Fix

Minimum fixed version

8.10.0~dfsg-2ubuntu0.4+esm4

This is the first release that contains the fix.

sudo apt-get install --only-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