{"id":"CVE-2022-21235","aliases":["EUVD-2022-1643","GHSA-6635-c626-vj4r","GO-2022-0414","SNYK-GOLANG-GITHUBCOMMASTERMINDSVCS-2437078"],"status":"published","title":"Command Injection","description":"The package github.com/masterminds/vcs before 1.13.3 are vulnerable to Command Injection via argument injection. 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.","severity":{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.01585,"percentile":0.75789,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-77","CWE-88"],"published":"2022-04-01T14:05:33Z","modified":"2026-10-28T02:30:58Z","fixes":[{"ecosystem":"Go","package":"github.com/Masterminds/vcs","fixed_in":["1.13.2","1.13.3"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/Masterminds/vcs","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.13.2"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/Masterminds/vcs","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.13.2"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/Masterminds/vcs","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.13.3"}]}]}],"products":[{"vendor":"vcs_project","product":"vcs"}],"references":[{"url":"https://snyk.io/vuln/SNYK-GOLANG-GITHUBCOMMASTERMINDSVCS-2437078","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://github.com/Masterminds/vcs/pull/105","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/Masterminds/vcs/security/advisories/GHSA-6635-c626-vj4r","tags":["web"]},{"url":"https://github.com/Masterminds/vcs/commit/922a5122330ea8fbe56352a0172ddb6bf019cd22","tags":["web"]},{"url":"https://github.com/Masterminds/vcs/releases/tag/v1.13.2","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21235","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-6635-c626-vj4r"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21235.json","tags":["advisory"]},{"url":"https://github.com/Masterminds/vcs","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2022-21235","title":"Command Injection","description":"The package github.com/masterminds/vcs before 1.13.3 are vulnerable to Command Injection via argument injection. 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.","status":"published","published":"2022-04-01T15:55:10.738Z","modified":"2024-09-17T00:20:56.794Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"cna"}],"updated_at":"2026-11-02T14:34:29.057251Z"}],"euvd":[{"id":"EUVD-2022-1643","description":"The package github.com/masterminds/vcs before 1.13.3 are vulnerable to Command Injection via argument injection. 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.","status":"published","published":"2022-04-01T15:55:10Z","modified":"2024-09-17T00:20:56Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-03T00:29:00.142007Z"}],"ghsa":[{"id":"GHSA-6635-c626-vj4r","title":"Command Injection Vulnerability with Mercurial in VCS","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.","status":"published","published":"2022-04-01T14:05:33Z","modified":"2024-05-20T21:29:39Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-77","CWE-88"],"updated_at":"2026-11-02T14:37:50.750599Z"}],"nvd":[{"id":"CVE-2022-21235","description":"The package github.com/masterminds/vcs before 1.13.3 are vulnerable to Command Injection via argument injection. 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.","status":"published","published":"2022-04-01T16:15:07.547Z","modified":"2026-06-17T04:25:50.013Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"secondary"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"},{"version":"2.0","score":6.8,"vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-88"],"updated_at":"2026-11-02T14:07:14.706146Z"}],"osv":[{"id":"CVE-2022-21235","title":"Command Injection","description":"The package github.com/masterminds/vcs before 1.13.3 are vulnerable to Command Injection via argument injection. 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.","status":"published","published":"2022-04-01T15:55:10.738Z","modified":"2026-10-28T02:30:58.741410204Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:44:23.655778Z"},{"id":"GHSA-6635-c626-vj4r","title":"Command Injection Vulnerability with Mercurial in VCS","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.","status":"published","published":"2022-04-01T14:05:33Z","modified":"2026-09-10T03:49:28.613761378Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-77","CWE-88"],"updated_at":"2026-11-02T15:46:39.266402Z"},{"id":"GO-2022-0414","title":"Command injection in github.com/Masterminds/vcs","description":"Passing untrusted inputs to VCS functions can permit an attacker to execute arbitrary commands.\n\nThe vcs package executes version control commands with user-provided arguments. These arguments can be interpreted as command-line flags, which can be used to perform command injection.","status":"published","published":"2022-07-01T20:08:17Z","modified":"2026-03-16T03:10:58.658242Z","updated_at":"2026-11-02T15:47:00.918515Z"}]}}
