Recently, NSFOCUS CERT detected that Jenkins issued a security announcement and fixed an arbitrary file reading vulnerability in the Jenkins CLI (CVE-2024-23897). Since one function of its CLI command parser is enabled by default in Jenkins, the specific parser function expandAtFiles can replace the character following the file path in the @ parameter with the file content. As a result, attackers can read any file on Jenkins by using the default character code of the Jenkins controller process, and execute any code in the Jenkins controller in combination with Resource Root URL, Remember me cookie, storage XSS or CSRF.
At present, PoC has been made public. The affected users are advised to take measures for protection as soon as possible.
Jenkins is an open source project developed based on Java. It is an automated middleware for continuous integration and delivery, which can continuously and automatically build/test software projects through the built pipeline, monitor the software development process, and quickly locate and solve problems.
Jenkins has a built-in command line interface (CLI) that can be accessed from the script or shell environment.
When processing CLI commands, Jenkins uses the args4j library to parse command parameters and options on the Jenkins controller.
Reference link: https://www.jenkins.io/security/advisory/2024-01-24/
Scope of Impact
- Jenkins <= 2.441
- Jenkins LTS <= 2.426.2
- Jenkins >= 2.442
- Jenkins LTS >= 2.426.3
At present, this vulnerability has been fixed in the new officially released version. Please upgrade the version for protection as soon as possible. The official download link: https://www.jenkins.io/download
Other protective measure
If relevant users cannot upgrade temporarily, the following measures can also be taken for temporary relief:
Disable Jenkins CLI: set the Java system property hudson.cli.CLICommand.allowAtSyntax to true
Disable CLI endpoints and SSH ports. For details, see the document https://github.com/jenkinsci-cert/SECURITY-3314-3315.
This advisory is only used to describe a potential risk. NSFOCUS does not provide any commitment or promise on this advisory. NSFOCUS and the author will not bear any liability for any direct and/or indirect consequences and losses caused by transmitting and/or using this advisory. NSFOCUS reserves all the rights to modify and interpret this advisory. Please include this statement paragraph when reproducing or transferring this advisory. Do not modify this advisory, add/delete any information to/from it, or use this advisory for commercial purposes without permission from NSFOCUS.
NSFOCUS, Inc., a global network and cyber security leader, protects enterprises and carriers from advanced cyber attacks. The company’s Intelligent Hybrid Security strategy utilizes both cloud and on-premises security platforms, built on a foundation of real-time global threat intelligence, to provide multi-layered, unified and dynamic protection against advanced cyber attacks.
NSFOCUS works with Fortune Global 500 companies, including four of the world’s five largest financial institutions, organizations in insurance, retail, healthcare, critical infrastructure industries as well as government agencies. NSFOCUS has technology and channel partners in more than 60 countries, is a member of both the Microsoft Active Protections Program (MAPP), and the Cloud Security Alliance (CSA).
A wholly owned subsidiary of NSFOCUS Technologies Group Co., Ltd., the company has operations in the Americas, Europe, the Middle East and Asia Pacific.