GHSA-64g7-mvw6-v9qj: Shelljs Improper Privilege Management Vulnerability
MODERATEGHSA-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
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.
npm install shelljs@0.8.5
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
GHSA-64g7-mvw6-v9qj Affected Shelljs Versions
1 component(s)| 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?
Which Shelljs versions are affected?
What version fixes GHSA-64g7-mvw6-v9qj?
Is shelljs affected?
What CWE is associated with GHSA-64g7-mvw6-v9qj?
How can I check npm dependencies for GHSA-64g7-mvw6-v9qj?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}