CVE-2022-29184: GoCD - Command Injection
- Cve: CVE-2022-29184
- Name: GoCD - Command Injection
- Description: GoCD is a continuous delivery server. In GoCD versions prior to 22.1.0, it is possible for existing authenticated users who have permissions to edit or create pipeline materials or pipeline configuration repositories to get remote code execution capability on the GoCD server via configuring a malicious branch name which abuses Mercurial hooks/aliases to exploit a command injection weakness. An attacker would require access to an account with existing GoCD administration permissions to either create/edit (`hg`-based) configuration repositories; create/edit pipelines and their (`hg`-based) materials; or, where "pipelines-as-code" configuration repositories are used, to commit malicious configuration to such an external repository which will be automatically parsed into a pipeline configuration and (`hg`) material definition by the GoCD server. This issue is fixed in GoCD 22.1.0. As a workaround, users who do not use/rely upon Mercurial materials can uninstall/remove the `hg`/Mercurial binary from the underlying GoCD Server operating system or Docker image.
- Impact: Authenticated users with permissions can execute arbitrary code on the GoCD server, potentially leading to full system compromise.
- Remediation: Upgrade to version 22.1.0 or later. As a workaround, remove the Mercurial binary from the server if not used.
- Vulnerability type: command_injection
- Vulnerability impact: remote_code_execution
- Requirement type: admin_privileges
- Requirements: Attacker needs existing admin permissions to configure or commit malicious repositories
- Labels source: projectdiscovery
- Severity: high
- Cvss score: 8.8
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Epss score: 0.03632
- Epss percentile: 0.89739
- Assignee: [email protected]
- Published at: 2022-05-20T20:15:10Z
- Age in days: 1649
- Modified at: 2026-06-17T04:39:45Z
- Patch available: yes
- References total: 4
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2022-29184
- Nvd status: modified
- Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
- Not known: hackerone
Cwe
| Id | Name |
|---|---|
| CWE-77 | Improper Neutralization of Special Elements used in a Command |
References
Same in every row:
- Source: nvd
| Url | Tags |
|---|---|
| https://github.com/gocd/gocd/commit/37d35115db2ada2190173f9413cfe1bc6c295ecb | Patch, Third Party Advisory |
| https://www.gocd.org/releases/#22-1-0 | Release Notes, Vendor Advisory |
| https://github.com/gocd/gocd/releases/tag/22.1.0 | Release Notes, Third Party Advisory |
| https://github.com/gocd/gocd/security/advisories/GHSA-vf5r-r7j2-cf2h | Third Party Advisory |
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| thoughtworks:gocd | < 22.1.0 | no | nvd | /v1/products/thoughtworks/gocd |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| gocd/gocd | commit, fix, releases, security_advisory | yes | /v1/repositories/gocd/gocd |
Index
- Checked, none or zero: repositories, repositories high signal, packages
Exploitation
- Remote: yes
- Authentication required: yes
- Exposed hosts: 125
- Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access
- Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports