CVE-2022-21235 Command Injection
Attackers can execute arbitrary commands via argument injection when the library invokes the Mercurial hg command.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-21235?
CVE-2022-21235 is a high-severity command injection vulnerability in github.com/Masterminds/vcs, published on 1 Apr 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
The package github.com/masterminds/vcs before 1.13.3 are vulnerable to Command Injection via argument injection. When hg is executed, argument strings are passed to hg in a way that additional flags can be set. The additional flags can be used to perform a command injection.
Weakness: CWE-88
Which versions are affected by CVE-2022-21235?
3 open source packages ship an affected version, including github.com/Masterminds/vcs. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/Masterminds/vcs Go | All versions | 1.13.2 |
github.com/Masterminds/vcs Go | All versions | 1.13.2 |
github.com/Masterminds/vcs Go | All versions | 1.13.3 |
Products include Vcs Project Vcs.
How do I fix CVE-2022-21235?
Upgrade github.com/Masterminds/vcs to a fixed version for your release line: 1.13.2 or 1.13.3.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2022-21235 being exploited?
There is no known exploitation of CVE-2022-21235 in the wild and no public exploit code.
Sources
Also known as GHSA-6635-c626-vj4r, GO-2022-0414, SNYK-GOLANG-GITHUBCOMMASTERMINDSVCS-2437078.