Command Injection Affecting libvcs package, versions [,0.11.1)
Threat Intelligence
Exploit Maturity
Proof of concept
EPSS
0.45% (76th
percentile)
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-PYTHON-LIBVCS-2421204
- published 14 Mar 2022
- disclosed 11 Mar 2022
- credit Alessio Della Libera of Snyk Research Team
Introduced: 11 Mar 2022
CVE-2022-21187 Open this link in a new tabHow to fix?
Upgrade libvcs
to version 0.11.1 or higher.
Overview
libvcs is a vcs abstraction layer.
Affected versions of this package 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.
PoC
from libvcs.shortcuts import create_repo
r = create_repo(url='--config=alias.clone=!touch ./HELLO', vcs='hg', repo_dir='./')
r.update_repo()
References
CVSS Scores
version 3.1