GitHub Advisoryadvisory · Go
GHSA-6635-c626-vj4r Command Injection Vulnerability with Mercurial in VCS
CRITICAL
Official page ↗
- Aliases
- CVE-2022-21235
- Ecosystem
- Go
- Packages
- github.com/Masterminds/vcs
- Severity
- Critical
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Weaknesses
- CWE-77, CWE-88
- Reviewed
- 2022-04-01
Affected packages
• Go github.com/Masterminds/vcs: < 1.13.2 → fixed in 1.13.2
Description
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.
Related
Alias · CVE (1)
- CVE-2022-21235 The package github.com/masterminds/vcs before 1.13.3 are vulnerable to Command Injection via argument injection. vulnerability
References
- https://github.com/Masterminds/vcs/security/advisories/GHSA-6635-c626-vj4r web
- https://nvd.nist.gov/vuln/detail/CVE-2022-21235 advisory
- https://github.com/Masterminds/vcs/pull/105 web
- https://github.com/Masterminds/vcs/commit/922a5122330ea8fbe56352a0172ddb6bf019cd22 web
- https://github.com/Masterminds/vcs package
- https://github.com/Masterminds/vcs/releases/tag/v1.13.2 web
- https://snyk.io/vuln/SNYK-GOLANG-GITHUBCOMMASTERMINDSVCS-2437078 web