CVE-2024-23897: Jenkins Command Line Interface (CLI) Path Traversal Vulnerability

Published Jan 24, 2024
·
Updated

Jenkins 2.441 and earlier, LTS 2.426.2 and earlier does not disable a feature of its CLI command parser that replaces an '@' character followed by a file path in an argument with the file's contents, allowing unauthenticated attackers to read arbitrary files on the Jenkins controller file system.

Other sources

Jenkins Command Line Interface (CLI) contains a path traversal vulnerability that allows attackers limited read access to certain files, which can lead to code execution.

CISA

Jenkins has a built-in command line interface (CLI) to access Jenkins from a script or shell environment.

Jenkins uses the args4j library to parse command arguments and options on the Jenkins controller when processing CLI commands. This command parser has a feature that replaces an @ character followed by a file path in an argument with the file’s contents (expandAtFiles). This feature is enabled by default and Jenkins 2.441 and earlier, LTS 2.426.2 and earlier does not disable it.

This allows attackers to read arbitrary files on the Jenkins controller file system using the default character encoding of the Jenkins controller process.

Attackers with Overall/Read permission can read entire files.

Attackers without Overall/Read permission can read the first few lines of files. The number of lines that can be read depends on available CLI commands. As of publication of this advisory, the Jenkins security team has found ways to read the first three lines of files in recent releases of Jenkins without having any plugins installed, and has not identified any plugins that would increase this line count.

Binary files containing cryptographic keys used for various Jenkins features can also be read, with some limitations (see note on binary files below). As of publication, the Jenkins security team has confirmed the following possible attacks in addition to reading contents of all files with a known file path. All of them leverage attackers' ability to obtain cryptographic keys from binary files, and are therefore only applicable to instances where that is feasible.

GitHub

Credit

Matisse Beckandt

Affected Software

10 affected componentsFixes available
redhat/Jenkins<2.442
2.442
redhat/Jenkins LTS<2.426.3
2.426.3
maven/org.jenkins-ci.main:jenkins-core>=2.427<2.440.1
2.440.1
maven/org.jenkins-ci.main:jenkins-core=2.441
2.442
maven/org.jenkins-ci.main:jenkins-core>=1.606<=2.426.2
2.426.3
Jenkins CI/CD=2.442
Jenkins CI/CD=LTS 2.426.3
Jenkins Jenkins Command Line Interface (CLI)
Jenkins Jenkins<2.426.3
Jenkins Jenkins<2.442

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/Jenkins to a version that resolves this vulnerability.

    Fixed in 2.442
  2. Upgrade

    Upgrade redhat/Jenkins LTS to a version that resolves this vulnerability.

    Fixed in 2.426.3
  3. Upgrade

    Upgrade maven/org.jenkins-ci.main:jenkins-core to a version that resolves this vulnerability.

    Fixed in 2.440.1
  4. Upgrade

    Upgrade maven/org.jenkins-ci.main:jenkins-core to a version that resolves this vulnerability.

    Fixed in 2.442
  5. Upgrade

    Upgrade maven/org.jenkins-ci.main:jenkins-core to a version that resolves this vulnerability.

    Fixed in 2.426.3
  6. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.441
  7. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.426.2
  8. Configuration

    Disable the CLI command parser feature that expands an '@' character followed by a file path in a CLI argument into the file’s contents (expandAtFiles). This feature is enabled by default and is not disabled in Jenkins 2.441 and earlier, and in LTS 2.426.2 and earlier.

    Jenkins CLI command parser (args4j expandAtFiles) expandAtFiles = disabled

Event History

Jan 24, 2024
CVE Published
via MITRE·05:52 PM
Data Sourced
via MITRE·05:52 PM
Description
Data Sourced
via NVD·06:15 PM
DescriptionSeverityWeaknessAffected Software
Advisory Published
via GitHub·06:31 PM
Jan 28, 2024
News Published
via BleepingComputer·03:17 PM
News Published
via BleepingComputer·05:15 PM
Jan 29, 2024
News Published
via BleepingComputer·10:06 PM
Jan 30, 2024
News Published
via The Register·05:45 PM
News Published
via The Register·05:48 PM
Apr 15, 2024
Exploit Published
via ExploitDB·12:00 AM
Known Exploited
via ExploitDB·12:00 AM
Aug 19, 2024
Known Ransomware
via CISA·12:00 AM
News Published
via BleepingComputer·07:16 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-23897?

CVE-2024-23897 is considered a critical vulnerability due to its potential to allow unauthenticated attackers to read arbitrary files on the Jenkins controller.

2

How do I fix CVE-2024-23897?

To fix CVE-2024-23897, upgrade Jenkins to version 2.442 or LTS version 2.426.3 immediately.

3

Which versions of Jenkins are affected by CVE-2024-23897?

CVE-2024-23897 affects Jenkins versions 2.441 and earlier, as well as LTS version 2.426.2 and earlier.

4

What type of attack does CVE-2024-23897 enable?

CVE-2024-23897 enables unauthenticated attackers to exploit the CLI command parser to read sensitive files on the Jenkins controller.

5

Is there a workaround for CVE-2024-23897?

There is no official workaround for CVE-2024-23897; immediate upgrading is the recommended action.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203