Command Injection Affecting libvcs package, versions [,0.11.1)


0.0
high
  • Exploit Maturity

    Proof of concept

  • Attack Complexity

    High

  • Confidentiality

    High

  • Integrity

    High

  • Availability

    High

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

How 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()