CVE-2021-21669
📋 TL;DR
This vulnerability in Jenkins Generic Webhook Trigger Plugin allows attackers to perform XML External Entity (XXE) attacks by sending specially crafted XML payloads. It affects Jenkins instances with the vulnerable plugin installed, potentially allowing attackers to read arbitrary files on the Jenkins controller file system. The vulnerability is particularly dangerous because it can be exploited via webhook endpoints that accept XML data.
💻 Affected Systems
- Jenkins Generic Webhook Trigger Plugin
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution, complete system compromise, and data exfiltration from the Jenkins controller server.
Likely Case
Arbitrary file read from the Jenkins controller file system, potentially exposing sensitive configuration files, credentials, and source code.
If Mitigated
Limited impact with proper network segmentation and file system permissions, though XXE could still expose some sensitive data.
🎯 Exploit Status
Exploitation requires sending XML payloads to webhook endpoints, which are often accessible without authentication. The vulnerability is well-documented in security advisories.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.73 and later
Vendor Advisory: https://www.jenkins.io/security/advisory/2021-06-18/#SECURITY-2330
Restart Required: Yes
Instructions:
1. Update Jenkins Generic Webhook Trigger Plugin to version 1.73 or later via Jenkins Plugin Manager. 2. Restart Jenkins to apply the update. 3. Verify the plugin version in Jenkins plugin management interface.
🔧 Temporary Workarounds
Disable XML parsing in webhook configuration
allConfigure Generic Webhook Trigger to only accept JSON payloads instead of XML
Navigate to Jenkins > Manage Jenkins > Configure System > Generic Webhook Trigger section
Set 'Content Type' to 'application/json' for all webhook configurations
Restrict webhook access
allUse network controls to limit which IP addresses can access webhook endpoints
Configure firewall rules to restrict access to Jenkins webhook endpoints
Use Jenkins security matrix to restrict webhook trigger permissions
🧯 If You Can't Patch
- Disable or uninstall the Generic Webhook Trigger Plugin entirely
- Implement strict network segmentation to isolate Jenkins from untrusted networks
🔍 How to Verify
Check if Vulnerable:
Check Jenkins plugin manager for Generic Webhook Trigger Plugin version. If version is 1.72 or earlier, the system is vulnerable.
Check Version:
Navigate to Jenkins > Manage Jenkins > Manage Plugins > Installed tab, search for 'Generic Webhook Trigger'
Verify Fix Applied:
Verify plugin version is 1.73 or later in Jenkins plugin management interface.
📡 Detection & Monitoring
Log Indicators:
- Unusual XML parsing errors in Jenkins logs
- Multiple failed webhook attempts with XML payloads
- File read attempts via XXE payloads in access logs
Network Indicators:
- XML payloads containing external entity declarations sent to Jenkins webhook endpoints
- Outbound connections from Jenkins to external servers initiated by XXE payloads
SIEM Query:
source="jenkins.log" AND ("XXE" OR "External Entity" OR "DOCTYPE" OR "SYSTEM")