Jenkins Security Advisory 2022-04-12

This advisory announces vulnerabilities in the following Jenkins deliverables:

Descriptions

Stored XSS vulnerabilities in multiple plugins providing additional parameter types

SECURITY-2617 / CVE-2022-29036 (Credentials), CVE-2022-29037 (CVS), CVE-2022-29038 (Extended Choice Parameter), CVE-2022-29039 (Gerrit Trigger), CVE-2022-29040 (Git Parameter), CVE-2022-29041 (Jira), CVE-2022-29042 (Job Generator), CVE-2022-29043 (Mask Passwords), CVE-2022-29044 (Node and Label Parameter), CVE-2022-29045 (promoted builds), CVE-2022-29046 (Subversion)
Severity (CVSS): High
Affected plugins: credentials , cvs , extended-choice-parameter , gerrit-trigger , git-parameter , jira , jobgenerator , mask-passwords , nodelabelparameter , promoted-builds , subversion
Description:

Multiple plugins do not escape the name and description of the parameter types they provide:

  • Credentials Plugin 1111.v35a_307992395 and earlier (SECURITY-2690 / CVE-2022-29036)

  • CVS Plugin 2.19 and earlier (SECURITY-2700 / CVE-2022-29037)

  • Extended Choice Parameter Plugin 346.vd87693c5a_86c and earlier (SECURITY-2704 / CVE-2022-29038)

  • Gerrit Trigger Plugin 2.35.2 and earlier (SECURITY-2703 / CVE-2022-29039)

  • Git Parameter Plugin 0.9.15 and earlier (SECURITY-2699 / CVE-2022-29040)

  • Jira Plugin 3.7 and earlier (SECURITY-2691 / CVE-2022-29041)

  • Job Generator 1.22 and earlier (SECURITY-2263 / CVE-2022-29042)

  • Mask Passwords Plugin 3.0 and earlier (SECURITY-2701 / CVE-2022-29043)

  • Node and Label parameter Plugin 1.10.3 and earlier (SECURITY-2702 / CVE-2022-29044)

  • promoted builds Plugin 873.v6149db_d64130 and earlier (SECURITY-2692 / CVE-2022-29045)

  • Subversion Plugin 2.15.3 and earlier (SECURITY-2698 / CVE-2022-29046)

This results in stored cross-site scripting (XSS) vulnerabilities exploitable by attackers with Item/Configure permission.

Exploitation of these vulnerabilities requires that parameters are listed on another page, like the "Build With Parameters" and "Parameters" pages provided by Jenkins (core), and that those pages are not hardened to prevent exploitation. Jenkins (core) has prevented exploitation of vulnerabilities of this kind on the "Build With Parameters" and "Parameters" pages since 2.44 and LTS 2.32.2 as part of the SECURITY-353 / CVE-2017-2601 fix. Additionally, the following plugins have been updated to list parameters in a way that prevents exploitation by default.

Older releases of these plugins allow exploitation of the vulnerabilities listed above.

As of publication of this advisory, the following plugins have not yet been updated to list parameters in a way that prevents exploitation of these vulnerabilities:

These are not vulnerabilities in these plugins. Only plugins defining parameter types can be considered to be vulnerable to this issue.

Some plugins both define parameter types and implement a page listing parameters, so they can appear in multiple lists and may have both a security fix and a security hardening applied.

The following plugins have been updated to escape the name and description of the parameter types they provide in the versions specified:

  • Credentials Plugin 1112.vc87b_7a_3597f6, 1087.1089.v2f1b_9a_b_040e4, 1074.1076.v39c30cecb_0e2, and 2.6.1.1

  • CVS Plugin 2.19.1

  • Gerrit Trigger Plugin 2.35.3

  • Git Parameter Plugin 0.9.16

  • Jira Plugin 3.7.1 and 3.6.1

  • Mask Passwords Plugin 3.1

  • Node and Label parameter Plugin 1.10.3.1

  • promoted builds Plugin 876.v99d29788b_36b_ and 3.10.1

  • Subversion Plugin 2.15.4

As of publication of this advisory, there is no fix available for the following plugins:

  • Extended Choice Parameter Plugin (SECURITY-2704 / CVE-2022-29038)

  • Job Generator (SECURITY-2263 / CVE-2022-29042)

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

SECURITY-1951 / CVE-2022-29047
Severity (CVSS): High
Affected plugin: workflow-cps-global-lib
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.

CSRF vulnerability in Subversion Plugin

SECURITY-2075 / CVE-2022-29048
Severity (CVSS): Medium
Affected plugin: subversion
Description:

Subversion Plugin 2.15.3 and earlier does not require POST requests for several form validation methods, resulting in cross-site request forgery (CSRF) vulnerabilities.

These vulnerabilities allow attackers to connect to an attacker-specified URL.

Subversion Plugin 2.15.4 requires POST requests for the affected form validation methods.

Promotion names in promoted builds Plugin are not validated when using Job DSL

SECURITY-2655 / CVE-2022-29049
Severity (CVSS): High
Affected plugin: promoted-builds
Description:

promoted builds Plugin provides dedicated support for defining promotions using Job DSL Plugin.

promoted builds Plugin 873.v6149db_d64130 and earlier does not validate the names of promotions defined in Job DSL. This allows attackers with Job/Configure permission to create a promotion with an unsafe name. As a result, the promotion name could be used for cross-site scripting (XSS) or to replace other config.xml files.

promoted builds Plugin 876.v99d29788b_36b_ and 3.10.1 validates the name of promotions.

CSRF vulnerability and missing permission checks in Publish Over FTP Plugin

SECURITY-2321 / CVE-2022-29050 (CSRF), CVE-2022-29051 (missing permission check)
Severity (CVSS): Medium
Affected plugin: publish-over-ftp
Description:

Publish Over FTP Plugin 1.16 and earlier does not perform permission checks in methods implementing form validation.

This allows attackers with Overall/Read permission to connect to an FTP server using attacker-specified credentials.

Additionally, these form validation methods do not require POST requests, resulting in a cross-site request forgery (CSRF) vulnerability.

Publish Over FTP Plugin 1.17 requires POST requests and appropriate permissions for the affected form validation methods.

Private key stored in plain text by Google Compute Engine Plugin

SECURITY-2045 / CVE-2022-29052
Severity (CVSS): Medium
Affected plugin: google-compute-engine
Description:

Google Compute Engine Plugin 4.3.8 and earlier stores private keys unencrypted in cloud agent config.xml files on the Jenkins controller as part of its configuration.

These private keys can be viewed by users with Agent/Extended Read permission or access to the Jenkins controller file system.

Google Compute Engine Plugin 4.3.9 stores private keys encrypted.

Severity

Affected Versions

  • Credentials Plugin up to and including 1111.v35a_307992395
  • CVS Plugin up to and including 2.19
  • Extended Choice Parameter Plugin up to and including 346.vd87693c5a_86c
  • Gerrit Trigger Plugin up to and including 2.35.2
  • Git Parameter Plugin up to and including 0.9.15
  • Google Compute Engine Plugin up to and including 4.3.8
  • Jira Plugin up to and including 3.7
  • Job Generator Plugin up to and including 1.22
  • Mask Passwords Plugin up to and including 3.0
  • Node and Label parameter Plugin up to and including 1.10.3
  • Pipeline: Deprecated Groovy Libraries Plugin up to and including 564.ve62a_4eb_b_e039
  • promoted builds Plugin up to and including 873.v6149db_d64130
  • Publish Over FTP Plugin up to and including 1.16
  • Subversion Plugin up to and including 2.15.3

Fix

  • Credentials Plugin should be updated to version 1112.vc87b_7a_3597f6, 1087.1089.v2f1b_9a_b_040e4, 1074.1076.v39c30cecb_0e2, or 2.6.1.1
  • CVS Plugin should be updated to version 2.19.1
  • Gerrit Trigger Plugin should be updated to version 2.35.3
  • Git Parameter Plugin should be updated to version 0.9.16
  • Google Compute Engine Plugin should be updated to version 4.3.9
  • Jira Plugin should be updated to version 3.7.1 or 3.6.1
  • Mask Passwords Plugin should be updated to version 3.1
  • Node and Label parameter Plugin should be updated to version 1.10.3.1
  • Pipeline: Deprecated Groovy Libraries Plugin should be updated to version 566.vd0a_a_3334a_555 or 2.21.3
  • promoted builds Plugin should be updated to version 876.v99d29788b_36b_ or 3.10.1
  • Publish Over FTP Plugin should be updated to version 1.17
  • Subversion Plugin should be updated to version 2.15.4

These versions include fixes to the vulnerabilities described above. All prior versions are considered to be affected by these vulnerabilities unless otherwise indicated.

As of publication of this advisory, no fixes are available for the following plugins:

  • Extended Choice Parameter Plugin
  • Job Generator Plugin

Learn why we announce these issues.

Credit

The Jenkins project would like to thank the reporters for discovering and reporting these vulnerabilities:

  • Daniel Beck, CloudBees, Inc. for SECURITY-2045
  • James Nord, CloudBees, Inc. and Daniel Beck, CloudBees, Inc. for SECURITY-2075
  • James Nord, CloudBees, Inc. and Jesse Glick, CloudBees, Inc. for SECURITY-1951
  • Kevin Guerroudj, CloudBees, Inc. and Wadeck Follonier, CloudBees, Inc. for SECURITY-2655
  • Kevin Guerroudj, CloudBees, Inc., Wadeck Follonier, CloudBees, Inc., and Daniel Beck, CloudBees, Inc. for SECURITY-2617
  • Kevin Guerroudj, Justin Philip, Marc Heyries for SECURITY-2321