Skip to content
Path traversal Write-up Intermediate

Affected products

GoCD versions 20.6.0 through 21.2.0 expose an unauthenticated path traversal in the business-continuity plugin, allowing an attacker to read arbitrary files and the server configuration including secrets and the encryption key. This enables decryption of build secrets and registration of a rogue agent, leading to build pipeline takeover.

attackerkb.com

Published on attackerkb.com

On October 27, 2021, SonarSource published a blog post describing a pre-authenticated information disclosure vulnerability in GoCD, an open-source CI/CD server. This vulnerability is now known as CVE-2021-43287.

Rapid7, on attackerkb.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An unauthenticated attacker could read arbitrary files, leak secrets, and register a rogue agent to take over build pipelines, potentially leading to supply chain compromise.

What the attacker needed

Network access to the GoCD server; No authentication required

How it was found

  1. Set up a vulnerable GoCD server using the official Docker image.
  2. Send a request to the business-continuity plugin endpoint with a crafted path to read an arbitrary file.
  3. Request the server configuration file to obtain secrets and the encryption key.
  4. Use the leaked encryption key to decrypt secure variables.
  5. Register a rogue agent using the auto-registration key from the configuration.
  6. Observe the rogue agent executing build jobs.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

GoCD is a tool that automates building and releasing software. A flaw let anyone read files on the server without logging in, including the file that stores secret keys. With those secrets, an attacker could pretend to be a build machine and run their own code in the build process.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.