CVE-2024-23897
📋 TL;DR
This vulnerability in Jenkins allows unauthenticated attackers to read arbitrary files on the Jenkins controller file system by exploiting a CLI command parser feature that replaces '@' characters followed by file paths with file contents. All Jenkins instances version 2.441 and earlier, and LTS 2.426.2 and earlier are affected. This can lead to sensitive information disclosure including credentials, configuration files, and source code.
💻 Affected Systems
- Jenkins
📦 What is this software?
Jenkins by Jenkins
Jenkins by Jenkins
⚠️ Risk & Real-World Impact
Worst Case
Attackers gain access to sensitive files like SSH keys, database credentials, configuration files, and source code, potentially leading to complete system compromise and lateral movement.
Likely Case
Unauthenticated attackers read arbitrary files from the Jenkins controller, exposing credentials, configuration data, and potentially enabling further attacks.
If Mitigated
With proper network segmentation and access controls, impact is limited to file disclosure on the Jenkins controller only.
🎯 Exploit Status
Multiple public exploit scripts and scanners are available. Exploitation requires network access to Jenkins CLI endpoint.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Jenkins 2.442, Jenkins LTS 2.426.3
Vendor Advisory: https://www.jenkins.io/security/advisory/2024-01-24/#SECURITY-3314
Restart Required: Yes
Instructions:
1. Backup your Jenkins instance. 2. Upgrade to Jenkins 2.442 or Jenkins LTS 2.426.3. 3. Restart Jenkins service. 4. Verify the upgrade completed successfully.
🔧 Temporary Workarounds
Disable CLI access
allBlock access to Jenkins CLI endpoints to prevent exploitation
Configure firewall rules to block access to Jenkins CLI port (default 33848/TCP)
Use network ACLs to restrict access to Jenkins controller
Network segmentation
allIsolate Jenkins controller from untrusted networks
Place Jenkins behind reverse proxy with strict access controls
Implement network segmentation to limit Jenkins controller exposure
🧯 If You Can't Patch
- Implement strict network access controls to limit Jenkins controller exposure
- Monitor for suspicious file access patterns and CLI usage
🔍 How to Verify
Check if Vulnerable:
Check Jenkins version via web interface (Manage Jenkins -> About Jenkins) or via CLI command 'java -jar jenkins-cli.jar -s http://jenkins-url/ version'
Check Version:
java -jar jenkins-cli.jar -s http://jenkins-url/ version
Verify Fix Applied:
Verify Jenkins version is 2.442 or higher, or LTS 2.426.3 or higher. Test CLI '@' file expansion feature is disabled.
📡 Detection & Monitoring
Log Indicators:
- Unusual CLI command patterns with '@' characters
- Multiple failed authentication attempts followed by CLI access
- File read operations from unexpected sources
Network Indicators:
- Traffic to Jenkins CLI port (default 33848) from untrusted sources
- Unusual patterns of CLI command execution
SIEM Query:
source="jenkins.log" AND ("@/" OR "@C:" OR "CLI command") AND NOT user="authenticated_user"
🔗 References
- http://packetstormsecurity.com/files/176839/Jenkins-2.441-LTS-2.426.3-CVE-2024-23897-Scanner.html
- http://packetstormsecurity.com/files/176840/Jenkins-2.441-LTS-2.426.3-Arbitrary-File-Read.html
- http://www.openwall.com/lists/oss-security/2024/01/24/6
- https://www.jenkins.io/security/advisory/2024-01-24/#SECURITY-3314
- https://www.sonarsource.com/blog/excessive-expansion-uncovering-critical-security-vulnerabilities-in-jenkins/
- http://packetstormsecurity.com/files/176839/Jenkins-2.441-LTS-2.426.3-CVE-2024-23897-Scanner.html
- http://packetstormsecurity.com/files/176840/Jenkins-2.441-LTS-2.426.3-Arbitrary-File-Read.html
- http://www.openwall.com/lists/oss-security/2024/01/24/6
- https://www.jenkins.io/security/advisory/2024-01-24/#SECURITY-3314
- https://www.sonarsource.com/blog/excessive-expansion-uncovering-critical-security-vulnerabilities-in-jenkins/
- https://www.vicarius.io/vsociety/posts/the-anatomy-of-a-jenkins-vulnerability-cve-2024-23897-revealed-1
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-23897