CVE-2021-21697: Agent-to-controller access control allows reading/writing most content of build directories in Jenkins
9.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.65385%
CWE
Published
5/24/2022
Updated
12/18/2023
KEV Status
No
Technology
Java
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| org.jenkins-ci.main:jenkins-core | maven | >= 2.304, <= 2.318 | 2.319 |
| org.jenkins-ci.main:jenkins-core | maven | <= 2.303.2 | 2.303.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from two key gaps:
- The FilePath API implementation lacked contextual checks to limit build directory access to only builds actively running on the requesting agent (addressed by the new RunningBuildFilePathFilter in the patch).
- The legacy path filtering system (AdminWhitelistRule) had incomplete disallowed inputs:
- Failed to canonicalize paths, enabling symlink attacks
- Allowed broad access to build directories without runtime context checks
- Did not properly validate operations like mkdirs, renameTo, and temporary file creation
The commit explicitly adds RunningBuildFilePathFilter to enforce runtime build-context checks, indicating these validations were missing in prior versions. The CWE-184 classification confirms the root cause was an incomplete allowlist/access control implementation.