CVE-2024-23897

Data Leak Vulnerability

Fixed in: version 2.442 and LTS 2.426.3

Vulnerability Overview

Jenkins CLI contains a critical data exposure flaw. The vulnerability exploits how Jenkins processes command-line arguments through the args4j library's expandAtFiles function.

Technical Details

The vulnerable code path occurs when Jenkins invokes a CLI command with arguments. The args4j library's expandAtFiles method checks whether arguments begin with the @ symbol. When this character is detected, the system treats the following text as a file path and reads its contents, expanding each line as a separate argument.

This creates a security gap: "if an attacker can control an argument, they can expand it to an arbitrary number of ones from an arbitrary file on the Jenkins instance."

Exploitation Methods

For Authenticated Users: Attackers with valid credentials can retrieve complete file contents by passing file paths as arguments to CLI commands:

N/ABASH
java -jar jenkins-cli.jar -noCertificateCheck -s https://xxx.yyy/jenkins \
  -auth abc:abc connect-node "@/etc/passwd"

For Unauthenticated Users: Without credentials or proper permissions, attackers can still extract file data line-by-line using different commands that process arguments differently. Each command may output a different line from the targeted file.

Reference

This vulnerability disclosure credits SonarSource's security research.

Disclaimer

All content published on exploit.se is intended strictly for educational and informational purposes. Research is conducted responsibly under coordinated disclosure principles.

Techniques, tools, and writeups shared on this site are meant to advance the security community's understanding of vulnerabilities and defences. They are not intended to encourage or enable unauthorised access to any system.

The author bears no responsibility for any misuse of information presented here.

Cookie Settings

This site does not use cookies, analytics, or any third-party tracking technologies.

No personal data is collected. No fingerprinting. No ads. You are not the product.


 ██╗ ██████╗ ███████╗██╗███████╗███╗   ██╗██████╗
 ██║██╔═══██╗██╔════╝██║██╔════╝████╗  ██║██╔══██╗
 ██║██║   ██║█████╗  ██║█████╗  ██╔██╗ ██║██║  ██║
 ██║██║   ██║██╔══╝  ██║██╔══╝  ██║╚██╗██║██║  ██║
 ██║╚██████╔╝██║     ██║███████╗██║ ╚████║██████╔╝
 ╚═╝ ╚═════╝ ╚═╝     ╚═╝╚══════╝╚═╝  ╚═══╝╚═════╝
You found me.
↑↑↓↓←→←→ B A  ·  click to close