CVE-2022-0144: Improper Privilege Management in shelljs

shelljs Updated 02 Oct 2025

Summary

21/01/2022
Yes i
High
7.1

CVE-2022-0144: Improper Privilege Management in shelljs. Affects shelljs versions < 0.8.5. Fixed in 0.8.5. How to fix ↓

Also tracked for

The same CVE-2022-0144 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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

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

shelljs is an npm package that provides a portable implementation of Unix shell commands for Node.js. It allows developers to execute shell commands programmatically. However, shelljs versions prior to 0.8.5 are vulnerable to Improper Privilege Management.

Vulnerability Detail

The vulnerability in shelljs arises from improper privilege management. Specifically, the 'shelljs.exec' function does not properly validate user input, which can lead to command injection attacks. An attacker could exploit this vulnerability to execute arbitrary commands with the privileges of the user running the vulnerable application. This could result in unauthorized access, data leakage, or even complete compromise of the system.

How To Fix

Minimum fixed version

0.8.5

This is the first release that contains the fix.

npm install shelljs@0.8.5

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 to the fixed version of shelljs as soon as possible.

Conclusion

In conclusion, shelljs versions prior to 0.8.5 are vulnerable to Improper Privilege Management, which could allow an attacker to execute arbitrary commands with the privileges of the user running the vulnerable application. It is highly recommended to upgrade to shelljs version 0.8.5 or later to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for shelljs →

Share this vulnerability

FAQ

shelljs is an npm package that provides a portable implementation of Unix shell commands for Node.js. It allows developers to execute shell commands programmatically.

Improper Privilege Management refers to a vulnerability where an application does not properly enforce or manage user privileges. In the case of shelljs, the 'shelljs.exec' function does not properly validate user input, which can lead to command injection attacks.

This vulnerability could allow an attacker to execute arbitrary commands with the privileges of the user running the vulnerable application. This could result in unauthorized access, data leakage, or even complete compromise of the system.

To fix this vulnerability, it is recommended to upgrade to shelljs version 0.8.5 or later. Update your package.json file to specify the updated version of shelljs as a dependency and then run the package manager to install the latest version.

There is no known workaround for this vulnerability. It is crucial to update to the fixed version of shelljs as soon as possible.

Related vulnerabilities

Recent vulnerabilities recorded for shelljs.

How To Fix

Minimum fixed version

0.8.5

This is the first release that contains the fix.

npm install shelljs@0.8.5

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