Jenkins Security Advisory 2021-10-06

This advisory announces vulnerabilities in the following Jenkins deliverables:

Descriptions

Improper handling of equivalent directory names on Windows

SECURITY-2424 / CVE-2021-21682

Jenkins stores jobs and other entities on disk using their name shown on the UI as file and folder names.

On Windows, when specifying a file or folder with a trailing dot character (example.), the file or folder will be treated as if that character was not present (example). As both are legal names for jobs and other entities in Jenkins 2.314 and earlier, LTS 2.303.1 and earlier, this could allow users with the appropriate permissions to change or replace configurations of jobs and other entities.

Jenkins 2.315, LTS 2.303.2 does not allow names of jobs and other entities to end with a dot character.

Jenkins core bundles vulnerable version of the commons-httpclient library

SECURITY-2475 / CVE-2014-3577

Jenkins 2.314 and earlier, LTS 2.303.1 and earlier bundles a version of the commons-httpclient library with the vulnerability CVE-2014-3577 that incorrectly verified SSL/TLS certificates, making it susceptible to man-in-the-middle attacks.

This library is widely used as a transitive dependency in Jenkins plugins.

The fix for CVE-2014-3577 was backported to the version of commons-httpclient that is bundled in Jenkins 2.315, LTS 2.303.2 and made available to plugins.

Path traversal vulnerability on Windows

SECURITY-2481 / CVE-2021-21683

The file browser for workspaces, archived artifacts, and userContent/ in Jenkins 2.314 and earlier, LTS 2.303.1 and earlier may interpret some paths to files as absolute on Windows.

This results in a path traversal vulnerability allowing attackers with Overall/Read permission (Windows controller) or Job/Workspace permission (Windows agents) to obtain the contents of arbitrary files.

The file browser in Jenkins 2.315, LTS 2.303.2 refuses to serve files that would be considered absolute paths.

Stored XSS vulnerability in Git Plugin

SECURITY-2499 / CVE-2021-21684

Git Plugin 4.8.2 and earlier does not escape the Git SHA-1 checksum parameters provided to commit notifications when displaying them in a build cause.

This results in a stored cross-site scripting (XSS) vulnerability exploitable by attackers able to submit crafted commit notifications to the /git/notifyCommit endpoint.

Git Plugin 4.8.3 rejects Git SHA-1 checksum parameters that do not match the expected format. Existing values are sanitized when displayed on the UI.

This vulnerability is only exploitable in Jenkins 2.314 and earlier, LTS 2.303.1 and earlier. See the LTS upgrade guide.

Severity

Affected Versions

  • Jenkins weekly up to and including 2.314
  • Jenkins LTS up to and including 2.303.1
  • Git Plugin up to and including 4.8.2

Fix

  • Jenkins weekly should be updated to version 2.315
  • Jenkins LTS should be updated to version 2.303.2
  • Git Plugin should be updated to version 4.8.3

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:

  • Daniel Beck, CloudBees, Inc. for SECURITY-2499
  • Mümin Köykıran for SECURITY-2481
  • Wadeck Follonier, CloudBees, Inc., Daniel Beck, CloudBees, Inc., and James Nord, CloudBees, Inc. for SECURITY-2424