CVE-2022-29184 Command Injection/Argument Injection in GoCD

High 8.8 Published Updated

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.

Weakness: CWE-88, CWE-77

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.

Sources

Also known as GHSA-vf5r-r7j2-cf2h.

Is CVE-2022-29184 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free