CVE-2022-29047
Untrusted users can modify some Pipeline libraries in Jenkins Pipeline: Deprecated Groovy Libraries Plugin
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.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.jenkins-ci.plugins.workflow » workflow-cps-global-lib | < 2.21.3>= 544.vff04fa68714d, < 566.vd0a | 2.21.3, 566.vd0a |
Blast radius
32% of the dependent artifacts (28) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 676 |
| 2 hops | 2,826 |
| 3 hops | 3,708 |
| 4 hops | 22 |
| 5 hops | 6 |
Most used dependents
- org.jenkins-ci.plugins.workflow » workflow-aggregator136 usages
- org.jenkins-ci.plugins » token-macro134 usages
- org.jenkinsci.plugins » pipeline-model-definition68 usages
- org.jvnet.hudson.plugins » analysis-test22 usages
- org.jenkins-ci.plugins » docker-workflow11 usages
- io.jenkins.blueocean » blueocean-pipeline-api-impl9 usages
- org.jenkins-ci.plugins.pipeline-stage-view » pipeline-stage-view7 usages
- io.jenkins.blueocean » blueocean-events4 usages
- io.jenkins.jenkinsfile-runner » payload-dependencies4 usages
- io.jenkins.plugins » pipeline-as-yaml4 usages
- org.jenkins-ci.plugins » github-organization-folder4 usages
- io.jenkins.blueocean » blueocean3 usages
- org.jenkins-ci.plugins » gitlab-plugin3 usages
- org.jenkins-ci.plugins » pipeline-github-lib3 usages
- io.jenkins.jenkinsfile-runner » payload3 usages
Computed from the dependency graph of build 20261201.0702 (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-2022-29047 | nvd.nist.gov |
| Web | jenkinsci/workflow-cps-global-lib-plugin commit 97bf324 | github.com |
| Web | jenkinsci/workflow-cps-global-lib-plugin commit bae59b4 | github.com |
| Web | security/advisory/2022-04-12 | jenkins.io |
