CVE-2022-21187 Command Injection
Attackers can execute arbitrary commands via argument injection in the hg clone function of the libvcs Python library.
- 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-21187?
CVE-2022-21187 is a high-severity command injection vulnerability in libvcs, published on 14 Mar 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
The package libvcs before 0.11.1 are vulnerable to Command Injection via argument injection. When calling the update_repo function (when using hg), the url parameter is passed to the hg clone command. By injecting some hg options it was possible to get arbitrary command execution.
Weakness: CWE-88
Which versions are affected by CVE-2022-21187?
6 open source packages ship an affected version, including libvcs and vcspull. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
libvcs PyPI | All versions | 0.11.1 |
libvcs PyPI | All versions | 0.11.1 |
libvcs PyPI | All versions | 0.11.1 |
vcspull PyPI | All versions | 1.11.1 |
vcspull PyPI | All versions | 1.11.1 |
vcspull PyPI | All versions | 1.11.1 |
Products include Libvcs Project Libvcs.
How do I fix CVE-2022-21187?
Upgrade libvcs to 0.11.1 or later.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2022-21187 being exploited?
There is no known exploitation of CVE-2022-21187 in the wild and no public exploit code.
Sources
Also known as GHSA-mv2w-4jqc-6fg4, PYSEC-2022-163, PYSEC-2026-563, SNYK-PYTHON-LIBVCS-2421204.