{"id":"CVE-2022-21235","aliases":["GHSA-6635-c626-vj4r","GO-2022-0414","SNYK-GOLANG-GITHUBCOMMASTERMINDSVCS-2437078"],"title":"Command Injection Vulnerability with Mercurial in VCS","summary":"Command Injection Vulnerability with Mercurial in VCS","severity":"critical","cvss":9.8,"cvssVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","vendor":"Masterminds","product":"github.com/Masterminds/vcs","ecosystem":"go","affected":["github.com/Masterminds/vcs < 1.13.2"],"patched":["github.com/Masterminds/vcs 1.13.2"],"published":"2022-04-01","updated":"2026-09-10","sourceUpdated":"2026-09-10T03:49:28.613761378Z","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-6635-c626-vj4r","references":[{"url":"https://github.com/Masterminds/vcs/security/advisories/GHSA-6635-c626-vj4r"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21235"},{"url":"https://github.com/Masterminds/vcs/pull/105"},{"url":"https://github.com/Masterminds/vcs/commit/922a5122330ea8fbe56352a0172ddb6bf019cd22"},{"url":"https://github.com/Masterminds/vcs"},{"url":"https://github.com/Masterminds/vcs/releases/tag/v1.13.2"},{"url":"https://snyk.io/vuln/SNYK-GOLANG-GITHUBCOMMASTERMINDSVCS-2437078"}],"tags":["osv","go"],"epss":0.01585,"epssPercentile":0.745,"ingestedAt":"2026-09-12T03:13:01.757Z","slug":"CVE-2022-21235","body":"## Overview\n\nURLs 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.\n\n## Affected packages\n\n- `github.com/Masterminds/vcs < 1.13.2`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `github.com/Masterminds/vcs 1.13.2`","depth":"midnight","depthScore":54,"depthScoreParts":{"impact":53.9,"likelihood":0.3,"exploitation":0,"ransomware":0},"changes":[]}