Jenkins Security Advisory 2019-09-12

This advisory announces vulnerabilities in the following Jenkins deliverables:

Descriptions

System command execution vulnerability in Git client Plugin

SECURITY-1534 / CVE-2019-10392
Severity (CVSS): High
Affected plugin: git-client
Description:

Git client Plugin accepts user-specified values as argument to an invocation of git ls-remote to validate the existence of a Git repository at the specified URL. This was implemented in a way that allowed attackers with Job/Configure permission to execute an arbitrary system command on the Jenkins controller as the OS user that the Jenkins process is running as.

Git client Plugin now rejects repository URLs that do not appear to be valid URLs. Additionally, for versions of Git that support it, the repository URL argument is separated from option arguments using the -- separator to prevent interpretation as an option.

As of publication of this advisory, no update for users of prerelease versions of 3.x such as 3.0.0-rc is available. Users of Git client Plugin 3.0.0-rc are advised to downgrade to 2.8.5 (and downgrade Git Plugin from 4.0.0-rc to the latest 3.x release to resolve dependency problems).

Sandbox bypass vulnerability in Script Security Plugin

SECURITY-1538 / CVE-2019-10393, CVE-2019-10394, CVE-2019-10399, CVE-2019-10400
Severity (CVSS): High
Affected plugin: script-security
Description:

Sandbox protection in Script Security Plugin could be circumvented through any of the following:

  • Crafted method names in method call expressions (CVE-2019-10393)

  • Crafted property names in property expressions on the left-hand side of assignment expressions (CVE-2019-10394)

  • Crafted property names in property expressions in increment and decrement expressions (CVE-2019-10399)

  • Crafted subexpressions in increment and decrement expressions not involving actual assignment (CVE-2019-10400)

This allowed attackers able to specify and run sandboxed scripts to execute arbitrary code in the context of the Jenkins controller JVM.

These expressions are now subject to sandbox protection.

Stored XSS vulnerability in Build Environment Plugin

SECURITY-1476 / CVE-2019-10395
Severity (CVSS): Medium
Affected plugin: build-environment
Description:

Build Environment Plugin did not escape values of environment variables shown on its views. This resulted in a cross-site scripting vulnerability exploitable by attackers able to control the values of build environment variables, typically users with Job/Configure or Job/Build permission.

Jenkins applies the missing escaping by default since 2.146 and LTS 2.138.2, so newer Jenkins releases are not affected by this vulnerability.

Build Environment Plugin now escapes all variables displayed in its views.

Stored XSS vulnerability in Dashboard View Plugin

SECURITY-1489 / CVE-2019-10396
Severity (CVSS): Medium
Affected plugin: dashboard-view
Description:

Dashboard View Plugin did not escape the build description on the Latest Builds View. This resulted in a cross-site scripting vulnerability exploitable by attackers able to control the description of builds shown on that view.

Dashboard View Plugin now applies the configured markup formatter to the build description, rendering it as it appears elsewhere in Jenkins.

Aqua Security Serverless Scanner Plugin showed plain text password in job configuration form fields

SECURITY-1509 / CVE-2019-10397
Severity (CVSS): Low
Affected plugin: aqua-serverless
Description:

Aqua Security Serverless Scanner Plugin stores service passwords in job configurations.

While the password is stored encrypted on disk, it was transmitted in plain text as part of the configuration form. This could result in exposure of the password through browser extensions, cross-site scripting vulnerabilities, and similar situations.

Aqua Security Serverless Scanner Plugin no longer transmits the password form field in plain text.

Beaker builder Plugin stored credentials in plain text

SECURITY-1545 / CVE-2019-10398
Severity (CVSS): Low
Affected plugin: beaker-builder
Description:

Beaker builder Plugin stored the Beaker password unencrypted on the Jenkins controller. This password could be viewed by users with access to the Jenkins controller file system.

Beaker builder Plugin now stores these credentials encrypted.

Severity

Affected Versions

  • Aqua Security Serverless Scanner Plugin up to and including 1.0.4
  • Beaker builder Plugin up to and including 1.9
  • Build Environment Plugin up to and including 1.6
  • Dashboard View Plugin up to and including 2.11
  • Git client Plugin up to and including 2.8.4
  • Script Security Plugin up to and including 1.62

Fix

  • Aqua Security Serverless Scanner Plugin should be updated to version 1.0.5
  • Beaker builder Plugin should be updated to version 1.10
  • Build Environment Plugin should be updated to version 1.7
  • Dashboard View Plugin should be updated to version 2.12
  • Git client Plugin should be updated to version 2.8.5
  • Script Security Plugin should be updated to version 1.63

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

Credit

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

  • Francesco Soncina - ABN AMRO Red Team - https://iwantmore.pizza for SECURITY-1534
  • James Holderness, IB Boost for SECURITY-1509, SECURITY-1545
  • Nils Emmerich of ERNW Research GmbH for SECURITY-1538
  • Viktor Gazdag NCC Group for SECURITY-1476, SECURITY-1489