GHSA-64g7-mvw6-v9qj: Shelljs Improper Privilege Management Vulnerability

MODERATE
CWE-269
Published
Advisory Summary

GHSA-64g7-mvw6-v9qj is a MODERATE improper privilege management vulnerability (CWE-269: Improper Privilege Management) affecting Shelljs libraries in the npm ecosystem. The issue involves improper privilege management in shelljs. Remediation is available by upgrading affected packages to version 0.8.5.

GHSA-64g7-mvw6-v9qj at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-64g7-mvw6-v9qj
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-269: Improper Privilege Management
Affected Product Shelljs
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-64g7-mvw6-v9qj

To remediate this vulnerability, upgrade all affected Shelljs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

shelljs fixed: 0.8.5
npm install shelljs@0.8.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls shelljs

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-64g7-mvw6-v9qj, inspect your project dependencies using npm:

npm ls shelljs

Analyze the terminal output to locate any version of Shelljs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.5), your application is affected.

Note: The npm ls shelljs command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. In Shelljs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Output from the synchronous version of `shell.exec()` may be visible to other users on the same system. You may be affected if you execute `shell.exec()` in multi-user Mac, Linux, or WSL environments, or if you execute `shell.exec()` as the root user. Other shelljs functions (including the asynchronous version of `shell.exec()`) are not impacted. ### Patches Patched in shelljs 0.8.5 ### Workarounds Recommended action is to upgrade to 0.8.5. ### References https://huntr.dev/bounties/50996581-c08e-4eed-a90e-c0bac082679c/ ### For more information If you have any questions or comments about this advisory: * Ask at https://github.com/shelljs/shelljs/issues/1058 * Open an issue at https://github.com/shelljs/shelljs/issues/new

GHSA-64g7-mvw6-v9qj Affected Shelljs Versions

1 component(s)
Fixed Versions:
0.8.5
Product / Package Ecosystem Affected Versions Fixed Version
shelljs
npm
< 0.8.5
0.8.5

References

Frequently Asked Questions

What is GHSA-64g7-mvw6-v9qj?
GHSA-64g7-mvw6-v9qj is a security vulnerability in Shelljs involving Improper Privilege Management in shelljs under CWE-269: Improper Privilege Management.
Which Shelljs versions are affected?
Affected versions include releases prior to 0.8.5 across affected packages: shelljs.
What version fixes GHSA-64g7-mvw6-v9qj?
Upgrading to 0.8.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is shelljs affected?
Yes, shelljs is affected in releases prior to 0.8.5. Upgrade your dependency to 0.8.5 or later.
What CWE is associated with GHSA-64g7-mvw6-v9qj?
GHSA-64g7-mvw6-v9qj is classified under CWE-269: Improper Privilege Management (The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.).
How can I check npm dependencies for GHSA-64g7-mvw6-v9qj?
Run the dependency tree command: 'npm ls shelljs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-64g7-mvw6-v9qj",
  "modified" : "2022-01-14T20:50:57Z",
  "published" : "2022-01-14T21:09:50Z",
  "aliases" : [ ],
  "summary" : "Improper Privilege Management in shelljs",
  "details" : "### Impact\nOutput from the synchronous version of `shell.exec()` may be visible to other users on the same system. You may be affected if you execute `shell.exec()` in multi-user Mac, Linux, or WSL environments, or if you execute `shell.exec()` as the root user.\n\nOther shelljs functions (including the asynchronous version of `shell.exec()`) are not impacted.\n\n### Patches\nPatched in shelljs 0.8.5\n\n### Workarounds\nRecommended action is to upgrade to 0.8.5.\n\n### References\nhttps://huntr.dev/bounties/50996581-c08e-4eed-a90e-c0bac082679c/\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Ask at https://github.com/shelljs/shelljs/issues/1058\n* Open an issue at https://github.com/shelljs/shelljs/issues/new\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "shelljs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/shelljs/shelljs/security/advisories/GHSA-64g7-mvw6-v9qj"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/shelljs/shelljs"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/50996581-c08e-4eed-a90e-c0bac082679c"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-269" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-14T20:50:57Z",
    "nvd_published_at" : null
  }
}