CVE-2022-21191 global-modules-path Command Injection vulnerability

High 7.4 Published Updated

Attackers can execute arbitrary commands via the getPath function in the global-modules-path npm library due to missing input sanitization.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2022-21191?

CVE-2022-21191 is a high-severity command injection vulnerability in global-modules-path, published on 13 Jan 2023. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Weakness: CWE-77, CWE-78

Which versions are affected by CVE-2022-21191?

2 open source packages ship an affected version, including global-modules-path. It affects 1 product.

PackageAffectedFixed in
global-modules-path npmAll versions3.0.0
global-modules-path npmAll versions3.0.0

Products include Global-Modules-Path Project Global-Modules-Path.

How do I fix CVE-2022-21191?

Upgrade global-modules-path to 3.0.0 or later.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2022-21191 being exploited?

There is no known exploitation of CVE-2022-21191 in the wild and no public exploit code.

Sources

Also known as GHSA-vvj3-85vf-fgmw.

Is CVE-2022-21191 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free