
===================================================================                                   CERT-Renater

                        Note d'Information No. 2023/VULN249

_____________________________________________________________________

DATE                : 18/08/2023

HARDWARE PLATFORM(S): /

OPERATING SYSTEM(S): Systems running Jenkins products.

====================================================================https://www.jenkins.io/security/advisory/2023-08-16/
https://www.jenkins.io/security/advisory/2023-07-26/
_____________________________________________________________________


  Jenkins Security Advisory 2023-08-16

This advisory announces vulnerabilities in the following Jenkins
deliverables:

     Blue Ocean Plugin
     Config File Provider Plugin
     Delphix Plugin
     Docker Swarm Plugin
     Favorite View Plugin
     Flaky Test Handler Plugin
     Folders Plugin
     Fortify Plugin
     Gogs Plugin
     Maven Artifact ChoiceListProvider (Nexus) Plugin
     NodeJS Plugin
     Shortcut Job Plugin
     Tuleap Authentication Plugin


Descriptions

CSRF vulnerability in Folders Plugin may approve unsandboxed
scripts
SECURITY-3106 / CVE-2023-40336
Severity (CVSS): High
Affected plugin: cloudbees-folder
Description:

Folders Plugin 6.846.v23698686f0f6 and earlier does not require
POST requests for an HTTP endpoint, resulting in a cross-site
request forgery (CSRF) vulnerability.

This vulnerability allows attackers to copy an item, which could
potentially automatically approve unsandboxed scripts and allow
the execution of unsafe scripts.
	An improvement added in Script Security Plugin
1265.va_fb_290b_4b_d34 and 1251.1253.v4e638b_e3b_221 prevents
automatic approval of unsandboxed scripts when administrators
copy jobs, significantly reducing the impact of this vulnerability.

Folders Plugin 6.848.ve3b_fd7839a_81 requires POST requests for
the affected HTTP endpoint.


CSRF vulnerability in Folders Plugin
SECURITY-3105 / CVE-2023-40337
Severity (CVSS): Medium
Affected plugin: cloudbees-folder
Description:

Folders Plugin 6.846.v23698686f0f6 and earlier does not require
POST requests for an HTTP endpoint, resulting in a cross-site
request forgery (CSRF) vulnerability.

This vulnerability allows attackers to copy a view inside a
folder.

Folders Plugin 6.848.ve3b_fd7839a_81 requires POST requests
for the affected HTTP endpoint.


Information disclosure in Folders Plugin
SECURITY-3109 / CVE-2023-40338
Severity (CVSS): Medium
Affected plugin: cloudbees-folder
Description:

Folders Plugin displays an error message when attempting to
access the Scan Organization Folder Log if no logs are
available.

In Folders Plugin 6.846.v23698686f0f6 and earlier, this error
message includes the absolute path of a log file, exposing
information about the Jenkins controller file system.

Folders Plugin 6.848.ve3b_fd7839a_81 does not display the
absolute path of a log file in the error message.


Improper masking of credentials in Config File Provider
Plugin
SECURITY-3090 / CVE-2023-40339
Severity (CVSS): Medium
Affected plugin: config-file-provider
Description:

Config File Provider Plugin 952.va_544a_6234b_46 and
earlier does not mask (i.e., replace with asterisks)
credentials specified in configuration files when they’re
written to the build log.

Config File Provider Plugin 953.v0432a_802e4d2 masks
credentials configured in configuration files if they
appear in the build log.


Improper masking of credentials in NodeJS Plugin
SECURITY-3196 / CVE-2023-40340
Severity (CVSS): Medium
Affected plugin: nodejs
Description:

NodeJS Plugin integrates with Config File Provider Plugin
to specify custom NPM settings, including credentials for
authentication, in a Npm config file.

NodeJS Plugin 1.6.0 and earlier does not properly mask
(i.e., replace with asterisks) credentials specified in
the Npm config file in Pipeline build logs.

NodeJS Plugin 1.6.0.1 masks credentials specified in the
Npm config file in Pipeline build logs.


CSRF vulnerability in Blue Ocean Plugin allows capturing
credentials
SECURITY-3116 / CVE-2023-40341
Severity (CVSS): Medium
Affected plugin: blueocean
Description:

Blue Ocean Plugin 1.27.5 and earlier does not require POST
requests for an HTTP endpoint, resulting in a cross-site
request forgery (CSRF) vulnerability.

This vulnerability allows attackers to connect to an
attacker-specified URL, capturing GitHub credentials associated
with an attacker-specified job.

This issue is due to an incomplete fix of SECURITY-2502.

Blue Ocean Plugin 1.27.5.1 uses the configured SCM URL,
instead of a user-specified URL provided as a parameter
to the HTTP endpoint.


CSRF vulnerability and missing permission checks in Fortify
Plugin allow capturing credentials
SECURITY-3115 / CVE-2023-4301 (CSRF), CVE-2023-4302 (missing
permission check)
Severity (CVSS): Medium
Affected plugin: fortify
Description:

Fortify Plugin 22.1.38 and earlier does not perform permission
checks in several HTTP endpoints.

This allows attackers with Overall/Read permission to connect
to an attacker-specified URL using attacker-specified credentials
IDs obtained through another method, capturing credentials
stored in Jenkins.

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

Fortify Plugin 22.2.39 requires POST requests and the appropriate
permissions for the affected HTTP endpoints.


HTML injection vulnerability in Fortify Plugin
SECURITY-3140 / CVE-2023-4303
Severity (CVSS): Medium
Affected plugin: fortify
Description:

Fortify Plugin 22.1.38 and earlier does not escape the error
message for a form validation method. This results in an HTML
injection vulnerability.
	Since Jenkins 2.275 and LTS 2.263.2, a security
hardening for form validation responses prevents JavaScript
execution, so no scripts can be injected.

Fortify Plugin 22.2.39 removes HTML tags from the error message.


Stored XSS vulnerability in Flaky Test Handler Plugin
SECURITY-3223 / CVE-2023-40342
Severity (CVSS): High
Affected plugin: flaky-test-handler
Description:

Flaky Test Handler Plugin 1.2.2 and earlier does not escape JUnit
test contents when showing them on the Jenkins UI.

This results in a stored cross-site scripting (XSS) vulnerability
exploitable by attackers able to control JUnit report file contents.

Flaky Test Handler Plugin 1.2.3 escapes JUnit test contents when
showing them on the Jenkins UI.


Non-constant time token comparison in Tuleap Authentication Plugin
SECURITY-3229 / CVE-2023-40343
Severity (CVSS): Low
Affected plugin: tuleap-oauth
Description:

Tuleap Authentication Plugin 1.1.20 and earlier does not use a
constant-time comparison when checking whether two authentication
tokens are equal.

This could potentially allow attackers to use statistical methods
to obtain a valid authentication token.

Tuleap Authentication Plugin 1.1.21 uses a constant-time comparison
when validating authentication tokens.


Missing permission check in Delphix Plugin allows enumerating
credentials IDs
SECURITY-3214 (1) / CVE-2023-40344
Severity (CVSS): Medium
Affected plugin: delphix
Description:

Delphix Plugin 3.0.2 and earlier does not perform a permission
check in an HTTP endpoint.

This allows attackers with Overall/Read permission to enumerate
credentials IDs of credentials stored in Jenkins. Those can be
used as part of an attack to capture the credentials using
another vulnerability.

An enumeration of credentials IDs in Delphix Plugin 3.0.3
requires the appropriate permissions.


Exposure of system-scoped credentials in Delphix Plugin
SECURITY-3214 (2) / CVE-2023-40345
Severity (CVSS): Medium
Affected plugin: delphix
Description:

Delphix Plugin 3.0.2 and earlier does not set the appropriate
context for credentials lookup, allowing the use of System-scoped
credentials otherwise reserved for the global configuration.

This allows attackers with Overall/Read permission to access
and capture credentials they are not entitled to.

Delphix Plugin 3.0.3 defines the appropriate context for
credentials lookup.

Stored XSS vulnerability in Shortcut Job Plugin
SECURITY-3071 / CVE-2023-40346
Severity (CVSS): High
Affected plugin: shortcut-job
Description:

Shortcut Job Plugin 0.4 and earlier does not escape the
shortcut redirection URL.

This results in a stored cross-site scripting (XSS)
vulnerability exploitable by attackers able to configure
shortcut jobs.

Shortcut Job Plugin 0.5 escapes the shortcut redirection
URL.


Exposure of system-scoped credentials in Maven Artifact
ChoiceListProvider (Nexus) Plugin
SECURITY-3153 / CVE-2023-40347
Severity (CVSS): Medium
Affected plugin: maven-artifact-choicelistprovider
Description:

Maven Artifact ChoiceListProvider (Nexus) Plugin 1.14
and earlier does not set the appropriate context for
credentials lookup, allowing the use of System-scoped
credentials otherwise reserved for the global configuration.

This allows attackers with Item/Configure permission to
access and capture credentials they are not entitled to.

As of publication of this advisory, there is no fix.
Learn why we announce this.


Unsafe default behavior and information disclosure in Gogs
Plugin webhook
SECURITY-2894 / CVE-2023-40348 (information disclosure),
CVE-2023-40349 (insecure default)
Severity (CVSS): Medium
Affected plugin: gogs-webhook
Description:

Gogs Plugin provides a webhook endpoint at /gogs-webhook that
can be used to trigger builds of jobs. In Gogs Plugin 1.0.15
and earlier, an option to specify a Gogs secret for this
webhook is provided, but not enabled by default.

This allows unauthenticated attackers to trigger builds of
jobs corresponding to the attacker-specified job name.

Additionally, the output of the webhook endpoint includes
whether a job corresponding to the attacker-specified job
name exists, even if the attacker has no permission to
access it.

As of publication of this advisory, there is no fix. Learn
why we announce this.


Stored XSS vulnerability in Docker Swarm Plugin
SECURITY-2811 / CVE-2023-40350
Severity (CVSS): High
Affected plugin: docker-swarm
Description:

Docker Swarm Plugin processes Docker responses to generate
the Docker Swarm Dashboard view.

Docker Swarm Plugin 1.11 and earlier does not escape values
returned from Docker before inserting them into the Docker
Swarm Dashboard view. This results in a stored cross-site
scripting (XSS) vulnerability exploitable by attackers able
to control responses from Docker.

As of publication of this advisory, there is no fix. Learn
why we announce this.


CSRF vulnerability in Favorite View Plugin
SECURITY-3201 / CVE-2023-40351
Severity (CVSS): Medium
Affected plugin: favorite-view
Description:

Favorite View Plugin 5.v77a_37f62782d and earlier does not
require POST requests for an HTTP endpoint, resulting in a
cross-site request forgery (CSRF) vulnerability.

This vulnerability allows attackers to add or remove views
from another user’s favorite views tab bar.

As of publication of this advisory, there is no fix. Learn
why we announce this.


Severity

     SECURITY-2811: High
     SECURITY-2894: Medium
     SECURITY-3071: High
     SECURITY-3090: Medium
     SECURITY-3105: Medium
     SECURITY-3106: High
     SECURITY-3109: Medium
     SECURITY-3115: Medium
     SECURITY-3116: Medium
     SECURITY-3140: Medium
     SECURITY-3153: Medium
     SECURITY-3196: Medium
     SECURITY-3201: Medium
     SECURITY-3214 (1): Medium
     SECURITY-3214 (2): Medium
     SECURITY-3223: High
     SECURITY-3229: Low

Affected Versions

     Blue Ocean Plugin up to and including 1.27.5
     Config File Provider Plugin up to and including
952.va_544a_6234b_46
     Delphix Plugin up to and including 3.0.2
     Docker Swarm Plugin up to and including 1.11
     Favorite View Plugin up to and including 5.v77a_37f62782d
     Flaky Test Handler Plugin up to and including 1.2.2
     Folders Plugin up to and including 6.846.v23698686f0f6
     Fortify Plugin up to and including 22.1.38
     Gogs Plugin up to and including 1.0.15
     Maven Artifact ChoiceListProvider (Nexus) Plugin up
to and including 1.14
     NodeJS Plugin up to and including 1.6.0
     Shortcut Job Plugin up to and including 0.4
     Tuleap Authentication Plugin up to and including 1.1.20

Fix

     Blue Ocean Plugin should be updated to version 1.27.5.1
     Config File Provider Plugin should be updated to
version 953.v0432a_802e4d2
     Delphix Plugin should be updated to version 3.0.3
     Flaky Test Handler Plugin should be updated to version 1.2.3
     Folders Plugin should be updated to version 6.848.ve3b_fd7839a_81
     Fortify Plugin should be updated to version 22.2.39
     NodeJS Plugin should be updated to version 1.6.0.1
     Shortcut Job Plugin should be updated to version 0.5
     Tuleap Authentication Plugin should be updated to version 1.1.21

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:

     Docker Swarm Plugin
     Favorite View Plugin
     Gogs Plugin
     Maven Artifact ChoiceListProvider (Nexus) Plugin

Learn why we announce these issues.


Credit

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

     Alvaro Muñoz (@pwntester), GitHub Security Lab for
SECURITY-3116, SECURITY-3153
     Andrea Chiera, CloudBees, Inc. for SECURITY-3201,
SECURITY-3223
     Daniel Beck, CloudBees, Inc. for SECURITY-3214 (1),
SECURITY-3214 (2)
     James Nord, CloudBees, Inc. for SECURITY-3090,
SECURITY-3196
     Kevin Guerroudj, CloudBees, Inc. for SECURITY-3071,
SECURITY-3105, SECURITY-3106, SECURITY-3109, SECURITY-3140
     Kevin Guerroudj, CloudBees, Inc. and Valdes Che Zogou,
CloudBees, Inc. for SECURITY-2811
     Kevin Guerroudj, CloudBees, Inc. and Yaroslav Afenkin,
CloudBees, Inc. for SECURITY-3229
     Kevin Guerroudj, CloudBees, Inc. and, independently,
Alvaro Muñoz (@pwntester), GitHub Security Lab for SECURITY-3115
     anhnm99 for SECURITY-2894

_____________________________________________________________________

  Jenkins Security Advisory 2023-07-26

This advisory announces vulnerabilities in the following Jenkins
deliverables:

     Jenkins (core)
     Bazaar Plugin
     Chef Identity Plugin
     GitLab Authentication Plugin
     Gradle Plugin
     Qualys Web App Scanning Connector Plugin
     ServiceNow DevOps Plugin

Descriptions
Stored XSS vulnerability
SECURITY-3188 / CVE-2023-39151
Severity (CVSS): High
Description:

Jenkins applies formatting to the console output of builds,
transforming plain URLs into hyperlinks.

Jenkins 2.415 and earlier, LTS 2.401.2 and earlier does not
sanitize or properly encode URLs of these hyperlinks in build
logs.

This results in a stored cross-site scripting (XSS)
vulnerability exploitable by attackers able to control build
log contents.

Jenkins 2.416, LTS 2.401.3 encodes URLs of affected hyperlink
annotations in build logs.


Incorrect control flow in Gradle Plugin breaks credentials
masking in the build log
SECURITY-3208 / CVE-2023-39152
Severity (CVSS): Medium
Affected plugin: gradle
Description:

Gradle Plugin 2.8 improperly invokes APIs available only on
the controller from an agent when setting up build log
annotations, causing an exception.

As a result, credentials may not be masked (i.e., replaced
with asterisks) in the build log in some circumstances.

Gradle Plugin 2.8.1 improves the control flow and handles the
exception, so that credentials masking is not affected.
	An improvement in Pipeline: API 1232.v1679fa_2f0f76
prevents issues like this from affecting credentials masking
in the future. As of the publication of this advisory, the
Jenkins security team is not aware of other plugins with a
similar issue.


CSRF vulnerability in GitLab Authentication Plugin
SECURITY-2696 / CVE-2023-39153
Severity (CVSS): Medium
Affected plugin: gitlab-oauth
Description:

GitLab Authentication Plugin 1.17.1 and earlier does not
implement a state parameter in its OAuth flow, a unique
and non-guessable value associated with each authentication
request.

This vulnerability allows attackers to trick users into
logging in to the attacker’s account.

GitLab Authentication Plugin 1.18 implements a state
parameter in its OAuth flow.


CSRF vulnerability and missing permission check in
ServiceNow DevOps Plugin allow capturing credentials
SECURITY-3129 / CVE-2023-3414 (CSRF), CVE-2023-3442 (missing
permission check)
Severity (CVSS): Medium
Affected plugin: servicenow-devops
Description:

ServiceNow DevOps Plugin 1.38.0 and earlier does not
perform a permission check in a method implementing form
validation.

This allows attackers with Overall/Read permission to
connect to an attacker-specified URL using attacker-specified
credentials IDs obtained through another method, capturing
credentials stored in Jenkins.

Additionally, this form validation method does not require
POST requests, resulting in a cross-site request forgery
(CSRF) vulnerability.

ServiceNow DevOps Plugin 1.38.1 requires POST requests
and Overall/Administer permission for the affected form
validation method.


Incorrect permission checks in Qualys Web App Scanning
Connector Plugin allow capturing credentials
SECURITY-3012 / CVE-2023-39154
Severity (CVSS): Medium
Affected plugin: qualys-was
Description:

Qualys Web App Scanning Connector Plugin 2.0.10 and
earlier does not correctly perform permission checks
in several HTTP endpoints.

This allows attackers with global Item/Configure
permission to connect to an attacker-specified URL
using attacker-specified credentials IDs obtained
through another method, capturing credentials stored
in Jenkins.

Qualys Web App Scanning Connector Plugin 2.0.11
requires the appropriate permissions for the affected
HTTP endpoints.


Secret displayed without masking by Chef Identity Plugin
SECURITY-3192 / CVE-2023-39155
Severity (CVSS): Low
Affected plugin: chef-identity
Description:

Chef Identity Plugin stores the user.pem key in its global
configuration file io.chef.jenkins.ChefIdentityBuildWrapper.xml
on the Jenkins controller as part of its configuration.

While this key is stored encrypted on disk, in Chef Identity
Plugin 2.0.3 and earlier the global configuration form does
not mask the user.pem key form field, increasing the potential
for attackers to observe and capture it.

As of publication of this advisory, there is no fix. Learn why
we announce this.


CSRF vulnerability in Bazaar Plugin
SECURITY-3095 / CVE-2023-39156
Severity (CVSS): Medium
Affected plugin: bazaar
Description:

Bazaar Plugin 1.22 and earlier does not require POST requests for
an HTTP endpoint, resulting in a cross-site request forgery
(CSRF) vulnerability.

This vulnerability allows attackers to delete previously
created Bazaar SCM tags.

As of publication of this advisory, there is no fix. Learn
why we announce this.


Severity

     SECURITY-2696: Medium
     SECURITY-3012: Medium
     SECURITY-3095: Medium
     SECURITY-3129: Medium
     SECURITY-3188: High
     SECURITY-3192: Low
     SECURITY-3208: Medium

Affected Versions

     Jenkins weekly up to and including 2.415
     Jenkins LTS up to and including 2.401.2
     Bazaar Plugin up to and including 1.22
     Chef Identity Plugin up to and including 2.0.3
     GitLab Authentication Plugin up to and including 1.17.1
     Gradle Plugin up to and including 2.8
     Qualys Web App Scanning Connector Plugin up
to and including 2.0.10
     ServiceNow DevOps Plugin up to and including 1.38.0

Fix

     Jenkins weekly should be updated to version 2.416
     Jenkins LTS should be updated to version 2.401.3
     GitLab Authentication Plugin should be updated to
version 1.18
     Gradle Plugin should be updated to version 2.8.1
     Qualys Web App Scanning Connector Plugin should be
updated to version 2.0.11
     ServiceNow DevOps Plugin should be updated to version
1.38.1

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:

     Bazaar Plugin
     Chef Identity Plugin

Learn why we announce these issues.


Credit

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

     Alvaro Muñoz (@pwntester), GitHub Security Lab for
SECURITY-3129
     Andrea Chiera, CloudBees, Inc. for SECURITY-3192
     Kevin Guerroudj, CloudBees, Inc. for SECURITY-3095
     Kevin Guerroudj, CloudBees, Inc. and Devin Nusbaum,
CloudBees, Inc. for SECURITY-3188
     Wadeck Follonier, CloudBees Inc. for SECURITY-2696
     Yaroslav Afenkin, CloudBees, Inc. for SECURITY-3012


========================================================+ CERT-RENATER        |    tel : 01-53-94-20-44         +
+ 23/25 Rue Daviel    |    fax : 01-53-94-20-41         +
+ 75013 Paris         |   email:cert@support.renater.fr +
=======================================================