Advisory

GHSA-6635-c626-vj4r

Also known as: CVE-2022-21235, GO-2022-0414, SNYK-GOLANG-GITHUBCOMMASTERMINDSVCS-2437078

Summary

Command Injection Vulnerability with Mercurial in VCS

Details

URLs and local file paths passed to the Mercurial (hg) APIs that are specially crafted can contain commands which are executed by Mercurial if it is installed on the host operating system. The vcs package uses the underly version control system, in this case hg, to implement the needed functionality. 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. Other version control systems with an implemented interface may also be vulnerable. The issue has been fixed in version 1.13.2. A work around is to sanitize data passed to the vcs package APIs to ensure it does not contain commands or unexpected data. This is important for user input data that is passed directly to the package APIs.

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2022-04-01 14:05 UTC
Modified
2026-09-10 03:49 UTC

Affected packages and fixes

github.com/Masterminds/vcs

Go · All systems

Affected

  • introduced 0, fixed 1.13.2 (semver)

Fixed versions

1.13.2

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences