Security Digest · Jan 24, 2024 · Vulnerability · CI/CD
Jenkins CLI Arbitrary File Read (CVE-2024-23897)
Jenkins 2.441 / LTS 2.426.2 and earlier let unauthenticated users read controller files via CLI '@file' expansion. Fixed in 2.442, LTS 2.426.3. In KEV. Act now.
Our verdict
Act now
An unpatched Jenkins controller reachable by untrusted users leaks files and secrets that can lead to full takeover; upgrade now or disable the CLI.
Who must act: Operators of Jenkins weekly 2.441 or earlier or LTS 2.426.2 or earlier, especially controllers reachable from the internet or with anonymous read or open signup.
Who can relax: Teams already on Jenkins 2.442+ or LTS 2.426.3+ (or any current release), and users of hosted CI systems that are not Jenkins.
- Affected
- Jenkins weekly up to and including 2.441
Jenkins LTS up to and including 2.426.2 - Fixed in
- Jenkins 2.442
Jenkins LTS 2.426.3
Jenkins LTS 2.440.1 - CVSS
- 9.8 (v3.1, NVD)
- EPSS
- 100.0% (percentile 100.0)
- CISA KEV
- Yes, listed as known exploited
- Exploitation
- Exploited in the wild
- Severity
- Critical
What to do
- Check the version shown in the Jenkins web UI footer and upgrade to a current weekly or LTS release.
- If you cannot upgrade today, apply the advisory's workaround to disable CLI access; it needs no restart.
- Remove anonymous read access and disable self-signup unless you truly need them.
- Do not expose the controller directly to the internet; put it behind VPN or SSO.
- If an exposed controller was unpatched, rotate secrets stored in Jenkins (credentials, API tokens, SSH keys) and the controller's secret keys.
How to check if you are affected or compromised
- Review web or reverse-proxy logs for CLI traffic from unexpected sources, especially before patching.
- Look for unexpected admin logins, new users, new API tokens or Script Console use.
- Check build logs and job configs for injected content and look for outbound connections from the controller you cannot explain.
What happened#
On January 24, 2024, the Jenkins project published a security advisory for CVE-2024-23897. The Jenkins CLI parses commands with the args4j library, which has a feature called expandAtFiles: any argument written as @ followed by a file path is replaced with that file's contents. The feature is on by default, and Jenkins did not turn it off, so a CLI user could make the controller read arbitrary files from its own filesystem and echo them back in error messages.
The bug was found by Yaniv Nizry of Sonar, who reported it on November 13, 2023. The same advisory fixed CVE-2024-23898, a cross-site WebSocket hijacking issue in the CLI endpoint (CVSS 8.8).
Who is affected#
Jenkins weekly up to 2.441 and LTS up to 2.426.2. Fixes are in 2.442, LTS 2.426.3 and LTS 2.440.1. NVD scores CVE-2024-23897 at 9.8.
How much an attacker can read depends on permissions:
- With Overall/Read permission: entire files.
- Without it: only the first few lines; researchers found ways to read the first three lines on recent releases without plugins.
Sonar notes that unauthenticated users effectively have read permission if legacy authorization mode is on, "Allow anonymous read access" is enabled, or self-signup is enabled. That is a common configuration on internal build servers.
Do you really need to act?#
If you are still on an affected version, yes. A file read on a CI controller is rarely "just" a file read. The advisory lists follow-on attacks that become possible once binary secrets can be extracted: remote code execution via Resource Root URLs, forged "Remember me" cookies (including for admins, opening the Script Console), stored XSS in build logs, CSRF protection bypass, decrypting stored secrets, deleting items and downloading heap dumps. Reading binary keys is harder on controllers using UTF-8 as the default encoding (over 90% of reporting instances), but much easier with Windows-1252.
Exploitation is not theoretical. CISA added CVE-2024-23897 to KEV on August 19, 2024, and as of October 21, 2026 the KEV entry marks it as known to be used in ransomware campaigns.
Lower risk: a controller that is reachable only from a trusted network, with no anonymous access or signup, limits who can try. But insiders and anyone already on that network still can, so plan the upgrade regardless.
What to do now#
- Upgrade to a current Jenkins weekly or LTS release (at minimum 2.442 or LTS 2.426.3).
- If you cannot upgrade immediately, use the advisory's workaround to disable CLI access. Jenkins says it should prevent exploitation completely and does not require a restart, but treat it as temporary.
- Turn off anonymous read access and self-signup unless you need them.
- Keep the controller off the open internet; front it with VPN or SSO.
- If an exposed controller ran an affected version, rotate the credentials, API tokens and SSH keys stored in Jenkins, and review admin accounts.
How to tell if you were hit#
There is no single clean indicator. The file contents leak through ordinary CLI error responses, and Sonar's write-up shows the read working through the connect-to-node command, whose error message echoes the "node names" it was given. Review reverse-proxy and access logs for CLI traffic from unfamiliar sources during the vulnerable window. Then look for the consequences: new admin users or API tokens, Script Console use, unexpected job or build-log changes, and outbound connections from the controller.
Timeline#
- — Sonar reports the issues to the Jenkins security team.
- — Advisory and fixes released in 2.442 and LTS 2.426.3.
- — CISA adds CVE-2024-23897 to KEV.
- — Still in KEV with known ransomware use; brief updated.
Vulnerability records
- CVE-2024-23897 · KEV 2024-08-19 · 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…
- CVE-2024-23898 · Jenkins 2.217 through 2.441 (both inclusive), LTS 2.222.1 through 2.426.2 (both inclusive) does not perform origin validation of requests made through the CLI…
Sources
Original sources first: vendor and project advisories, CVE and government records, the discoverers’ write-ups. Every claim above links to one of these. See how the Security Desk works.
Original and primary sources
- Jenkins — Jenkins Security Advisory 2024-01-24 jenkins.io
- NVD — CVE-2024-23897 nvd.nist.gov
- Sonar — Excessive Expansion: Uncovering Critical Security Vulnerabilities in Jenkins sonarsource.com
- CISA — CISA Adds One Known Exploited Vulnerability to Catalog (Aug 19, 2024) cisa.gov
- CISA — Known Exploited Vulnerabilities Catalog cisa.gov