CVE-2021-21686
Multiple vulnerabilities allow bypassing path filtering of agent-to-controller access control in Jenkins
Description
The agent-to-controller security subsystem limits which files on the Jenkins controller can be accessed by agent processes.
Multiple vulnerabilities in the file path filtering implementation of Jenkins 2.318 and earlier, LTS 2.303.2 and earlier allow agent processes to read and write arbitrary files on the Jenkins controller file system, and obtain some information about Jenkins controller file systems.
SECURITY-2444 / CVE-2021-21686: File path filters do not canonicalize paths, allowing operations to follow symbolic links to outside allowed directories.
We expect that most of these vulnerabilities have been present since SECURITY-144 was addressed in the 2014-10-30 security advisory.
Jenkins 2.319, LTS 2.303.3 addresses these security vulnerabilities.
SECURITY-2444 / CVE-2021-21686: File path filters canonicalize paths, preventing operations from following symbolic links to outside allowed directories.
As some common operations are now newly subject to access control, it is expected that plugins sending commands from agents to the controller may start failing. Additionally, the newly introduced path canonicalization means that instances using a custom builds directory (Java system property jenkins.model.Jenkins.buildsDir) or partitioning JENKINS_HOME using symbolic links may fail access control checks. See the documentation for how to customize the configuration in case of problems.
If you are unable to immediately upgrade to Jenkins 2.319, LTS 2.303.3, you can install the Remoting Security Workaround Plugin. It will prevent all agent-to-controller file access using FilePath APIs. Because it is more restrictive than Jenkins 2.319, LTS 2.303.3, more plugins are incompatible with it. Make sure to read the plugin documentation before installing it.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.jenkins-ci.main » jenkins-core | < 2.303.3>= 2.304, < 2.319 | 2.303.3, 2.319 |
Blast radius
45% of the dependent artifacts (49) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 4,550 |
| 2 hops | 879 |
| 3 hops | 35 |
| 4 hops | 81 |
| 5 hops | 26 |
| 6 hops | 66 |
Most used dependents
- 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.plugins » ldap5 usages
- io.jenkins.jenkinsfile-runner » setup4 usages
- io.jenkins.jenkinsfile-runner » payload-dependencies4 usages
- com.synopsys.integration » jenkins-common4 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-2021-21686 | nvd.nist.gov |
| Package | jenkinsci/jenkins | github.com |
| Web | jenkinsci/jenkins commit 104c751 | github.com |
| Web | jenkinsci/jenkins commit 5a245e4 | github.com |
| Web | jenkinsci/jenkins commit 63cde2d | github.com |
| Web | security/advisory/2021-11-04 | jenkins.io |
