CVE-2022-29184 Command Injection/Argument Injection in GoCD
Authenticated users with pipeline editing permissions can achieve remote code execution on the GoCD server by exploiting Mercurial hooks via malicious branch names.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2022-29184?
CVE-2022-29184 is a high-severity command injection vulnerability in gocd, published on 20 May 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Official 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.
Which versions are affected by CVE-2022-29184?
It affects 1 product.
Products include Thoughtworks Gocd.
How do I fix CVE-2022-29184?
No fix has been published for CVE-2022-29184 yet. Limit exposure of the affected software until one is available.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2022-29184 being exploited?
There is no known exploitation of CVE-2022-29184 in the wild and no public exploit code.
Other vulnerabilities in gocd
- CVE-2021-43290 Path traversal in n/a
- CVE-2021-44659 Server-side request forgery in n/a
- CVE-2024-56320 GoCD vulnerable to admin privilege escalation by a malicious internal/existing authenticated user
- CVE-2022-39311 Compromised agents may be able to execute remote code on GoCD Server
- CVE-2021-43286 Command injection in n/a
Sources
Also known as GHSA-vf5r-r7j2-cf2h.