CVE-2021-43286
GoCD Server vulnerability analysis and mitigation

Overview

An issue was discovered in ThoughtWorks GoCD before 21.3.0. An attacker with privileges to create a new pipeline on a GoCD server can abuse a command-line injection in the Git URL "Test Connection" feature to execute arbitrary code (Sonar Blog, NVD). The vulnerability was discovered and responsibly disclosed by the SonarSource R&D team and was patched in version 21.3.0, released on October 26, 2021.

Technical details

The vulnerability exists in the Git URL validation process where the variable repoUrl is user-controlled, its format is not validated, and it is concatenated into the command line. While withArg() handles quoting of the repoUrl value, it does not prevent attackers from adding unintended arguments with the prefix --. The vulnerability can be exploited through three key factors: an argument can be added without character set restriction, git ls-remote requires a positional argument with refs/heads/master always added in the call, and git ls-remote implements --upload-pack option to specify the executable path on remotes (Sonar Blog). The vulnerability has a CVSS v3.1 Base Score of 8.8 HIGH (Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) (NVD).

Impact

Successful exploitation of this vulnerability allows attackers to execute arbitrary commands on the GoCD server. This could lead to leaking API keys to external services such as Docker Hub and GitHub, stealing private source code, gaining access to production environments, and potentially overwriting files being produced as part of the build processes, which could enable supply-chain attacks (Sonar Blog).

Mitigation and workarounds

The vulnerability was addressed in GoCD version 21.3.0 with commit 6fa9fb7, which added stronger validation on user-controlled values and implemented the use of the end-of-options delimiter -- standardized by POSIX. Users are strongly recommended to upgrade to GoCD version 21.3.0 or later (Sonar Blog, GoCD Releases).

Community reactions

The GoCD Security Team was noted to be exceptionally responsive in the disclosure process, reacting quickly and working efficiently with researchers to patch the vulnerabilities. They provided a heads-up about an important Security Fix on their public Google Forum before the release (Sonar Blog).

Additional resources


SourceThis report was generated using AI

Related GoCD Server vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2024-56320CRITICAL9.4
  • GoCD ServerGoCD Server
  • cpe:2.3:a:thoughtworks:gocd
NoYesJan 03, 2025
CVE-2024-28866MEDIUM6.1
  • GoCD ServerGoCD Server
  • cpe:2.3:a:thoughtworks:gocd
NoYesMay 14, 2024
CVE-2024-56321LOW3.8
  • GoCD ServerGoCD Server
  • cpe:2.3:a:thoughtworks:gocd
NoYesJan 03, 2025
CVE-2024-56324LOW2.1
  • GoCD ServerGoCD Server
  • cpe:2.3:a:thoughtworks:gocd
NoYesJan 03, 2025
CVE-2024-56322LOW2.1
  • GoCD ServerGoCD Server
  • cpe:2.3:a:thoughtworks:gocd
NoYesJan 03, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management