CVE-2021-21679
📋 TL;DR
This vulnerability in Jenkins Azure AD Plugin allows attackers to bypass Cross-Site Request Forgery (CSRF) protection by crafting malicious URLs. Attackers can perform unauthorized actions on behalf of authenticated users, potentially compromising Jenkins instances. All Jenkins installations using Azure AD Plugin version 179.vf6841393099e or earlier are affected.
💻 Affected Systems
- Jenkins Azure AD Plugin
📦 What is this software?
Azure Ad by Jenkins
⚠️ Risk & Real-World Impact
Worst Case
Attackers could perform administrative actions, install malicious plugins, execute arbitrary code, steal credentials, or completely compromise the Jenkins instance and connected systems.
Likely Case
Attackers could modify job configurations, steal sensitive data from builds, or perform unauthorized actions within the Jenkins environment.
If Mitigated
With proper network segmentation and access controls, impact would be limited to the Jenkins instance itself, though data exfiltration and configuration changes could still occur.
🎯 Exploit Status
Exploitation requires the attacker to trick an authenticated user into clicking a malicious link. The vulnerability details and exploitation methods are publicly documented.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 180.vf5b_9f0c5db_2a_
Vendor Advisory: https://www.jenkins.io/security/advisory/2021-08-31/#SECURITY-2470
Restart Required: Yes
Instructions:
1. Access Jenkins Update Center. 2. Navigate to Manage Plugins > Available. 3. Search for Azure AD Plugin. 4. Install version 180.vf5b_9f0c5db_2a_ or later. 5. Restart Jenkins after installation.
🔧 Temporary Workarounds
Disable Azure AD Plugin
allTemporarily disable the vulnerable plugin until patching is possible
java -jar jenkins-cli.jar -s http://jenkins-url/ disable-plugin azure-ad
Restrict Jenkins Access
allLimit Jenkins access to trusted networks only
🧯 If You Can't Patch
- Implement strict network segmentation to isolate Jenkins from untrusted networks
- Deploy a web application firewall (WAF) with CSRF protection rules
🔍 How to Verify
Check if Vulnerable:
Check Jenkins plugin manager for Azure AD Plugin version. If version is 179.vf6841393099e or earlier, the system is vulnerable.
Check Version:
java -jar jenkins-cli.jar -s http://jenkins-url/ list-plugins | grep azure-ad
Verify Fix Applied:
Verify Azure AD Plugin version is 180.vf5b_9f0c5db_2a_ or later in Jenkins plugin manager.
📡 Detection & Monitoring
Log Indicators:
- Unusual administrative actions from non-admin users
- Multiple failed CSRF token validations
- Plugin installation/modification logs from unexpected sources
Network Indicators:
- HTTP requests to Jenkins with crafted URLs bypassing CSRF protection
- Unusual outbound connections from Jenkins server
SIEM Query:
source="jenkins" AND (event="plugin_install" OR event="config_change") AND user!="admin"