PT-2021-4993 · Jenkins · Pipeline: Shared Groovy Libraries Plugin+2

·

CVE-2021-21696

·

Published

2021-11-04

·

Updated

2024-03-06

CVSS v3.1

9.8

Critical

VectorAV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions Jenkins versions 2.318 and earlier, LTS versions 2.303.2 and earlier
Description The issue is related to the implementation of the FilePath API in the Jenkins automation server, which does not limit agent read/write access to the libs/ directory inside build directories. This allows attackers in control of agent processes to replace the code of a trusted library with a modified variant, resulting in unsandboxed code execution in the Jenkins controller process. The libs/ directory is used by the Pipeline: Shared Groovy Libraries Plugin to store copies of shared libraries.
Recommendations For Jenkins versions 2.318 and earlier, LTS versions 2.303.2 and earlier, update to Jenkins 2.319, LTS 2.303.3 to prohibit agent read/write access to the libs/ directory inside build directories. As a temporary workaround, consider installing the Remoting Security Workaround Plugin, which will prevent all agent-to-controller file access using FilePath APIs. However, note that this plugin is more restrictive and may cause incompatibility with other plugins. Restrict access to the libs/ directory to minimize the risk of exploitation.

Fix

Path traversal

Protection Mechanism Failure

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

BDU:2021-05756
BIT-JENKINS-2021-21696
CVE-2021-21696
GHSA-C5R9-RX53-Q3GF
RHSA-2021:4799
RHSA-2021:4801
RHSA-2021:4827
RHSA-2021:4829
RHSA-2021:4833
RHSA-2022:0055

Affected Products

Jenkins
Pipeline: Shared Groovy Libraries Plugin
Remoting Security Workaround Plugin