Information Disclosure via Logback Configuration Injection in GoCD Agent
The GoCD Agent loads a Logback configuration file from a config directory if one exists, and that file can use property substitution to print system environment values. An attacker who can create that file could read sensitive environment variables such as cloud credentials or database connection strings from the agent's log output.
- Disclosed after 21 days
Summary
The GoCD Agent's logging mechanism (Logback) allows for property substitution and custom configuration loading. By default, the config directory might not exist in the installation path. However, if an attacker creates this directory and places a specially crafted agent-launcher-logback.xml file, the GoCD Agent prioritizes this external configuration over its internal defaults. This allows an attacker to exfiltrate sensitive system environment variables by injecting specific patterns into the log layout.
Environment
Product: GoCD Agent
Version: 25.4.0 (Latest)
OS: Windows 11 / Windows Server
Java Version: 25.0.1
Steps to Reproduce
1. Navigate to the GoCD Agent installation directory (e.g., C:\Program Files (x86)\Go Agent\).
2. Create a new directory named config if it does not exist.
3. Create a new file named agent-launcher-logback.xml inside the config directory.
4. Paste the following malicious Logback configuration into the file:
-
Run the GoCD Agent via PowerShell (Administrator): .\go-agent.bat.
-
Observe the log output. The GoCD Agent will display: "Using logback configuration from file config\agent-launcher-logback.xml".
-
Confirm that sensitive system information (Hostname, User, Java version, etc.) is successfully evaluated and printed in the console.
Impact
An attacker or a malicious insider who can modify the agent configuration can steal sensitive environment variables. In many CI/CD environments, these variables often contain:
Cloud provider credentials (AWS_ACCESS_KEY_ID, etc.)
Database connection strings
Internal API keys
System architecture details that facilitate further attacks (SSRF/RCE)
This vulnerability transforms a configuration access into a critical data exfiltration vector.
I am reporting this to help improve the security of GoCD.
Attachments

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the agent loads an external Logback configuration from a predictable config directory without restricting who can create it or what properties it may resolve.
Impact
An attacker or malicious insider with write access to the agent configuration could steal environment variables that may hold cloud credentials, database connection strings and API keys.
What the attacker needed
Write access to the agent install directory; ability to create a config folder and file; agent restarted or launched
How it was found
- Go to the GoCD Agent installation directory.
- Create a config directory if it does not exist.
- Create an agent-launcher-logback.xml file inside that config directory.
- Put a Logback configuration in the file that prints environment values in the log pattern.
- Run the GoCD Agent.
- Observe the log output showing the evaluated system values.
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 report has not been written yet. The Original tab links to the source.
Logback is a Java logging library that can read a configuration file to decide what the log output looks like. This report says the GoCD Agent will use a configuration file placed in a certain folder if that folder exists, and that file can make the log print values like the hostname or environment variables. Someone who can write that file could therefore see secrets that the agent process can access.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.