PT-2022-14942 · Masterminds · Vcs

Alessio Della Libera

·

Published

2022-04-01

·

Updated

2026-03-17

·

CVE-2022-21235

CVSS v3.1

9.8

Critical

VectorAV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions github.com/masterminds/vcs versions prior to 1.13.3
Description The issue concerns command injection via argument injection. When hg is executed, argument strings are passed in a way that allows additional flags to be set, which can be used for command injection. This can occur when URLs and local file paths passed to the Mercurial (hg) APIs are specially crafted to contain commands. The vcs package uses the underlying version control system, in this case hg, and other version control systems with an implemented interface may also be vulnerable. Passing untrusted inputs to VCS functions can permit an attacker to execute arbitrary commands.
Recommendations For versions prior to 1.13.3, update to version 1.13.3 or later to resolve the issue. As a temporary workaround, consider sanitizing data passed to the vcs package APIs to ensure it does not contain commands or unexpected data, especially for user input data that is passed directly to the package APIs.

Fix

Argument Injection

Command Injection

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

CVE-2022-21235
GHSA-6635-C626-VJ4R
GO-2022-0414
SNYK-GOLANG-GITHUBCOMMASTERMINDSVCS-2437078

Affected Products

Vcs