CVE-2024-23897

9.8 CRITICAL

📋 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

Products:
  • Jenkins
Versions: Jenkins 2.441 and earlier, Jenkins LTS 2.426.2 and earlier
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: All default installations are vulnerable. No special configuration required for exploitation.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

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

all

Block 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

all

Isolate 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

📤 Share & Export