# GHSA-64g7-mvw6-v9qj: Improper Privilege Management in shelljs

> Local attackers can read output from synchronous shell commands in multi-user environments, exposing sensitive data.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 Jan 2022

## What is GHSA-64g7-mvw6-v9qj?

GHSA-64g7-mvw6-v9qj is a vulnerability in shelljs, published on 14 Jan 2022. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

### 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

## Which versions are affected by GHSA-64g7-mvw6-v9qj?

2 open source packages ship an affected version, including shelljs.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `shelljs` | npm | All versions | 0.8.5 |
| `shelljs` | npm | All versions | 0.8.5 |

## How do I fix GHSA-64g7-mvw6-v9qj?

Upgrade shelljs to 0.8.5 or later.

## Is GHSA-64g7-mvw6-v9qj being exploited?

There is no known exploitation of GHSA-64g7-mvw6-v9qj in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-64g7-mvw6-v9qj and fix it if it is affected.

What it is: GHSA-64g7-mvw6-v9qj is a vulnerability in shelljs, published on 14 Jan 2022. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-64g7-mvw6-v9qj in the wild and no public exploit code.

Affected packages and fixed versions:
- shelljs (npm): affected all versions; fixed in 0.8.5
- shelljs (npm): affected all versions; fixed in 0.8.5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-64g7-mvw6-v9qj/ (Markdown: https://insights.sbomify.com/GHSA-64g7-mvw6-v9qj/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-64g7-mvw6-v9qj

---
From sbomify Insights: https://insights.sbomify.com/GHSA-64g7-mvw6-v9qj/
Summaries are generated and may contain mistakes; the official description above is the record.
