CVE-2021-43290
📋 TL;DR
This vulnerability allows an attacker who has compromised a GoCD agent to upload malicious files to a GoCD server directory. While they can control the filename, the directory location is restricted. This affects all GoCD installations before version 21.3.0.
💻 Affected Systems
- ThoughtWorks GoCD
📦 What is this software?
Gocd by Thoughtworks
⚠️ Risk & Real-World Impact
Worst Case
Full server compromise leading to arbitrary code execution, data exfiltration, and lateral movement within the infrastructure.
Likely Case
Server compromise allowing attackers to execute arbitrary code, manipulate pipelines, and access sensitive configuration data.
If Mitigated
Limited impact if proper network segmentation and agent security controls are in place, preventing initial agent compromise.
🎯 Exploit Status
Exploitation requires initial compromise of a GoCD agent. The vulnerability chain is well-documented in public research.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 21.3.0 and later
Vendor Advisory: https://www.gocd.org/releases/#21-3-0
Restart Required: Yes
Instructions:
1. Backup your GoCD configuration and data. 2. Download GoCD 21.3.0 or later from official sources. 3. Stop the GoCD server. 4. Install the new version following platform-specific instructions. 5. Restart the GoCD server. 6. Verify all agents are upgraded to compatible versions.
🔧 Temporary Workarounds
Network Segmentation
allIsolate GoCD agents from sensitive server directories using network controls
Agent Security Hardening
allImplement strict access controls and monitoring on GoCD agents to prevent initial compromise
🧯 If You Can't Patch
- Implement strict network segmentation between GoCD agents and servers
- Enhance monitoring and logging on all GoCD agents for signs of compromise
🔍 How to Verify
Check if Vulnerable:
Check GoCD server version. If version is below 21.3.0, the system is vulnerable.
Check Version:
gocd-server --version or check server administration interface
Verify Fix Applied:
Verify GoCD server version is 21.3.0 or higher and check that file upload restrictions are properly enforced.
📡 Detection & Monitoring
Log Indicators:
- Unauthorized file upload attempts from agents
- Unusual agent behavior or connections
- File system modifications in GoCD server directories
Network Indicators:
- Unusual traffic patterns between agents and server
- File transfer attempts to restricted server directories
SIEM Query:
source="gocd" AND (event="file_upload" OR event="agent_compromise")
🔗 References
- https://blog.sonarsource.com/gocd-vulnerability-chain
- https://github.com/gocd/gocd/commit/4c4bb4780eb0d3fc4cacfc4cfcc0b07e2eaf0595
- https://github.com/gocd/gocd/commit/c22e0428164af25d3e91baabd3f538a41cadc82f
- https://www.gocd.org/releases/#21-3-0
- https://blog.sonarsource.com/gocd-vulnerability-chain
- https://github.com/gocd/gocd/commit/4c4bb4780eb0d3fc4cacfc4cfcc0b07e2eaf0595
- https://github.com/gocd/gocd/commit/c22e0428164af25d3e91baabd3f538a41cadc82f
- https://www.gocd.org/releases/#21-3-0