Skip to content

Untrusted users can modify some Pipeline libraries in Jenkins Pipeline: Deprecated Groovy Libraries Plugin

High severity GitHub Reviewed Published Apr 13, 2022 to the GitHub Advisory Database • Updated Jan 27, 2023

Package

maven org.jenkins-ci.plugins.workflow:workflow-cps-global-lib (Maven)

Affected versions

< 2.21.3
>= 544.vff04fa68714d, <= 564.ve62a

Patched versions

2.21.3
566.vd0a

Description

Multibranch Pipelines by default limit who can change the Pipeline definition from the Jenkinsfile. This is useful for SCMs like GitHub: Jenkins can build content from users without commit access, but who can submit pull requests, without granting them the ability to modify the Pipeline definition. In that case, Jenkins will just use the Pipeline definition in the pull request’s destination branch instead.

In Pipeline: Deprecated Groovy Libraries Plugin 564.ve62a_4eb_b_e039 and earlier the same protection does not apply to uses of the library step with a retriever argument pointing to a library in the current build’s repository and branch (e.g., library(…, retriever: legacySCM(scm))). This allows attackers able to submit pull requests (or equivalent), but not able to commit directly to the configured SCM, to effectively change the Pipeline behavior by changing the library behavior in their pull request, even if the Pipeline is configured to not trust them.

Pipeline: Deprecated Groovy Libraries Plugin 566.vd0a_a_3334a_555 and 2.21.3 aborts library retrieval if the library would be retrieved from the same repository and revision as the current build, and the revision being built is untrusted.

References

Published by the National Vulnerability Database Apr 12, 2022
Published to the GitHub Advisory Database Apr 13, 2022
Reviewed Dec 2, 2022
Last updated Jan 27, 2023

Severity

High
7.3
/ 10

CVSS base metrics

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

Weaknesses

CVE ID

CVE-2022-29047

GHSA ID

GHSA-hh6f-6fp5-gfpv

Source code

No known source code

Credits

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