CVE-2024-43044
Jenkins Remoting library arbitrary file read vulnerability
Description
Jenkins uses the Remoting library (typically agent.jar or remoting.jar) for the communication between controller and agents. This library allows agents to load classes and classloader resources from the controller, so that Java objects sent from the controller (build steps, etc.) can be executed on agents.
In addition to individual class and resource files, Remoting also allows Jenkins plugins to transmit entire jar files to agents using the Channel#preloadJar API. As of publication of this advisory, this feature is used by the following plugins distributed by the Jenkins project: bouncycastle API, Groovy, Ivy, TeamConcert
In Remoting 3256.v88a_f6e922152 and earlier, except 3206.3208.v409508a_675ff and 3248.3250.v3277a_8e88c9b_, included in Jenkins 2.470 and earlier, LTS 2.452.3 and earlier, calls to Channel#preloadJar result in the retrieval of files from the controller by the agent using ClassLoaderProxy#fetchJar. Additionally, the implementation of ClassLoaderProxy#fetchJar invoked on the controller does not restrict paths that agents could request to read from the controller file system.
This allows agent processes, code running on agents, and attackers with Agent/Connect permission to read arbitrary files from the Jenkins controller file system.
The Remoting library in Jenkins 2.471, LTS 2.452.4, LTS 2.462.1 now sends jar file contents with Channel#preloadJar requests, the only use case of ClassLoaderProxy#fetchJar in agents, so that agents do not need to request jar file contents from controllers anymore.
To retain compatibility with older versions of Remoting in combination with the plugins listed above, ClassLoaderProxy#fetchJar is retained and otherwise unused, just deprecated. Its implementation in Jenkins 2.471, LTS 2.452.4, LTS 2.462.1 was changed so that it is now limited to retrieving jar files referenced in the core classloader or any plugin classloader.
Affected Maven artifacts (2)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.jenkins-ci.main » jenkins-core | < 2.452.4>= 2.460, < 2.462.1>= 2.470, < 2.471 | 2.452.4, 2.462.1, 2.471 |
| org.jenkins-ci.main » remoting | < 3206.3208>= 3248, < 3248.3250>= 3256, < 3256.3258 | 3206.3208, 3248.3250, 3256.3258 |
Blast radius
100% of the dependent artifacts (135) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 30,769 |
| 2 hops | 3,043 |
| 3 hops | 672 |
| 4 hops | 162 |
| 5 hops | 52 |
| 6 hops | 132 |
Most used dependents
- org.jenkins-ci.main » jenkins-core1,191 usages
- org.jenkins-ci.main » jenkins-test-harness99 usages
- org.jenkins-ci.plugins » job-dsl71 usages
- org.jenkins-ci.main » jenkins-war62 usages
- org.jenkins-ci.main » jenkins-test-harness-tools37 usages
- org.jenkins-ci.plugins » config-file-provider32 usages
- io.jenkins.blueocean » blueocean-rest-impl12 usages
- org.csanchez.jenkins.plugins » kubernetes11 usages
- io.jenkins.blueocean » blueocean-pipeline-api-impl9 usages
- org.jenkins-ci.lib » xtrigger-lib9 usages
- org.jenkins-ci.plugins » ws-cleanup6 usages
- org.jenkins-ci.plugins » resource-disposer6 usages
- org.jenkins-ci.main » cli5 usages
- org.jenkins-ci.plugins » ldap5 usages
- io.jenkins.jenkinsfile-runner » setup4 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
| Advisory | NVD CVE-2024-43044 | nvd.nist.gov |
| Package | jenkinsci/remoting | github.com |
| Web | jenkinsci/jenkins commit 3f54c41 | github.com |
| Web | jenkinsci/jenkins commit 5d26b53 | github.com |
| Web | jenkinsci/jenkins commit cec49ce | github.com |
| Web | jenkinsci/remoting commit 3277a8e | github.com |
| Web | jenkinsci/remoting commit 409508a | github.com |
| Web | jenkinsci/remoting commit 858f3c9 | github.com |
| Web | security/advisory/2024-08-07 | jenkins.io |
