Skip to main content

CVE-2021-22921: Incorrect Permission Assignment for Critical Resource (CWE-732) in NodeJS Node

High
VulnerabilityCVE-2021-22921cvecve-2021-22921cwe-732
Published: Mon Jul 12 2021 (07/12/2021, 10:22:24 UTC)
Source: CVE
Vendor/Project: NodeJS
Product: Node

Description

Node.js before 16.4.1, 14.17.2, and 12.22.2 is vulnerable to local privilege escalation attacks under certain conditions on Windows platforms. More specifically, improper configuration of permissions in the installation directory allows an attacker to perform two different escalation attacks: PATH and DLL hijacking.

AI-Powered Analysis

AILast updated: 06/25/2025, 14:33:53 UTC

Technical Analysis

CVE-2021-22921 is a local privilege escalation vulnerability affecting Node.js versions prior to 16.4.1, 14.17.2, and 12.22.2 on Windows platforms. The root cause is an incorrect permission assignment (CWE-732) on critical resources, specifically the Node.js installation directory. Improperly configured permissions allow non-administrative users to manipulate the environment in a way that leads to privilege escalation. Two primary attack vectors are identified: PATH hijacking and DLL hijacking. In PATH hijacking, an attacker places malicious executables or scripts in directories that are searched before legitimate binaries, causing the system to execute attacker-controlled code with elevated privileges. DLL hijacking involves placing malicious DLL files in locations where the Node.js process loads libraries, tricking the system into loading attacker-supplied code. Both techniques exploit the fact that the installation directory permissions are too permissive, allowing unauthorized write or modification access. This vulnerability requires local access to the system and does not rely on remote exploitation or user interaction beyond the attacker having a foothold on the machine. The vulnerability affects a broad range of Node.js versions from 4.0 through 16.0, indicating a long-standing issue that was patched starting with the specified fixed versions. No known exploits in the wild have been reported, but the potential for privilege escalation makes this a significant risk in environments where untrusted users have local access.

Potential Impact

For European organizations, the impact of this vulnerability can be substantial, especially in enterprises and development environments that rely heavily on Node.js on Windows servers or workstations. Successful exploitation allows an attacker with local access to escalate privileges to administrative levels, potentially leading to full system compromise. This can result in unauthorized access to sensitive data, disruption of services, and the ability to deploy persistent malware or ransomware. Organizations with shared development environments, build servers, or continuous integration pipelines are particularly at risk, as attackers could leverage this vulnerability to gain control over critical infrastructure. Additionally, the vulnerability could be exploited by malicious insiders or through lateral movement after initial compromise. Given the widespread use of Node.js in European tech sectors, including finance, manufacturing, and government agencies, the risk of data breaches and operational disruption is significant if this vulnerability is not addressed.

Mitigation Recommendations

1. Immediate upgrade of Node.js installations on Windows to versions 16.4.1, 14.17.2, 12.22.2 or later to ensure the vulnerability is patched. 2. Audit and harden permissions on Node.js installation directories to restrict write and modify access to trusted administrative accounts only. 3. Implement application whitelisting and code integrity policies to prevent execution of unauthorized binaries or DLLs. 4. Use endpoint detection and response (EDR) tools to monitor for suspicious activity related to PATH or DLL hijacking attempts. 5. Restrict local user privileges and enforce the principle of least privilege to minimize the number of users who can access or modify Node.js installation paths. 6. Regularly review and update security policies for development and production environments to include checks for insecure permission configurations. 7. Educate system administrators and developers about the risks of improper directory permissions and the importance of applying security patches promptly. 8. Consider isolating critical Node.js environments using virtualization or containerization to limit the impact of potential local exploits.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
hackerone
Date Reserved
2021-01-06T00:00:00
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d983ac4522896dcbed43c

Added to database: 5/21/2025, 9:09:14 AM

Last enriched: 6/25/2025, 2:33:53 PM

Last updated: 8/6/2025, 7:44:06 AM

Views: 13

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats