Improper Privilege Management in shelljs

shelljs Updated 02 Oct 2025

Summary

14/01/2022
MODERATE
Yes i
Moderate
Not published

GHSA-64g7-mvw6-v9qj: Improper Privilege Management in shelljs. Affects shelljs versions < 0.8.5. Fixed in 0.8.5. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

ShellJS is a portable Unix shell commands for Node.js that provides a simple and consistent interface for executing shell commands. It is commonly used for automating tasks and interacting with the command line. However, a vulnerability has been discovered in the shell.exec() function, which can lead to improper privilege management.

Vulnerability Detail

The vulnerability arises from the synchronous version of shell.exec(), which may expose output to other users on the same system. This can occur in multi-user Mac, Linux, or WSL environments, as well as when executing shell.exec() as the root user. Other functions in ShellJS are not affected. The impact of this vulnerability is that sensitive information may be visible to unauthorized users, potentially leading to unauthorized access or data leakage.

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

If upgrading to the latest version is not immediately feasible, a workaround is to avoid using the synchronous version of shell.exec(). Instead, you can use the asynchronous version or consider alternative approaches for executing shell commands. Here is an example of using the asynchronous version of shell.exec():

const shell = require('shelljs');

shell.exec('command', { async: true }, (code, stdout, stderr) => {
  // Handle the command output
});

Conclusion

The improper privilege management vulnerability in shelljs can lead to unauthorized access or data leakage. It is recommended to upgrade to shelljs version 0.8.5 or later to mitigate this issue. If immediate upgrade is not possible, using the asynchronous version of shell.exec() or exploring alternative approaches for executing shell commands can serve as a workaround. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for shelljs →

Share this vulnerability

FAQ

The vulnerability allows other users on the same system to potentially view sensitive information, leading to unauthorized access or data leakage.

The vulnerability affects ShellJS versions prior to 0.8.5.

There are currently no known exploits for this vulnerability.

No, this vulnerability can only be exploited by users on the same system.

No, there is no CVE assigned to this vulnerability at the moment.

Related vulnerabilities

Recent vulnerabilities recorded for shelljs.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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