Skip to content

Time-of-check Time-of-use (TOCTOU) Race Condition in Jenkins

Moderate severity GitHub Reviewed Published May 24, 2022 to the GitHub Advisory Database • Updated Jan 29, 2023

Package

maven org.jenkins-ci.main:jenkins-core (Maven)

Affected versions

<= 2.263.2
>= 2.264, <= 2.275

Patched versions

2.263.3
2.276

Description

Due to a time-of-check to time-of-use (TOCTOU) race condition, the file browser for workspaces, archived artifacts, and $JENKINS_HOME/userContent/ follows symbolic links to locations outside the directory being browsed in Jenkins 2.275 and LTS 2.263.2.

This allows attackers with Job/Workspace permission and the ability to control workspace contents, e.g., with Job/Configure permission or the ability to change SCM contents, to create symbolic links that allow them to access files outside workspaces using the workspace browser.

This issue is caused by an incorrectly applied fix for SECURITY-1452 / CVE-2021-21602 in the 2021-01-13 security advisory.

Jenkins 2.276, LTS 2.263.3 no longer differentiates the check and the use of symlinks in workspace browsers.

References

Published by the National Vulnerability Database Jan 26, 2021
Published to the GitHub Advisory Database May 24, 2022
Reviewed Jun 23, 2022
Last updated Jan 29, 2023

Severity

Moderate
5.3
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
High
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N

Weaknesses

CVE ID

CVE-2021-21615

GHSA ID

GHSA-qxp6-27gw-99cj

Source code

No known source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.