Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

Jenkins Path Traversal / Arbitrary File Write

Medium

Synopsis

Tenable discovered that the patch for CVE-2018-1000406 (SECURITY-1074) is inadequate.

CVE-2019-10352: Path Traversal Arbitrary File Write

A path traversal vulnerability exists in core/src/main/java/hudson/model/FileParameterValue.java that allows authenticated attackers with Job/Configure permission to define a file parameter with a file name outside the intended directory, resulting in an arbitrary file write on the Jenkins master when scheduling a build.

Proof of Concept

Below is a series of instructions to follow in order to reproduce the vulnerability:

  1. Download Jenkins latest weekly from http://mirrors.jenkins.io/war/latest/jenkins.war. At the time of this writing, this is 2.180.
  2. Start Jenkins (java -jar jenkins.war) and browse to http://<server>:8080/
  3. Follow the on screen instructions to begin using Jenkins (initialAdminPW, default plugins etc.).
  4. Create a user and give them overall read and job build, configure & read permissions.
  5. Create a new "Freestyle Project" named test (the workspace for this project will be located at JENKINS_HOME/workspace/test)
  6. Log out of admin user and in as the restricted permission user created above.
  7. Select the project and click configure on the left.
  8. Tick the "This build is parameterised" box and select File Parameter.
  9. For the file location enter: 'dir/../../../pwned' and click save.
  10. Click build with parameters and select the file you wish to upload.
  11. With the path supplied above, the file will be written to the JENKINS_HOME/workspace directory (it is the intended behaviour that it should only be permitted to be written under the project workspace - in this case JENKINS_HOME/workspace/test). However, it may be written to anywhere on the filesystem that the user running Jenkins has permission to write.
The original fix disallowed absolute / relative paths. However, the above path bypasses their validation.

Solution

Upgrade to Jenkins 2.186.

Disclosure Timeline

06/13/2019 - Vulnerability discovered.
06/13/2019 - Vulnerability reported to Jenkins using issue tracker. 90-day date is 9/11/19.
06/13/2019 - Jenkins thanks Tenable for the report.
06/13/2019 - Jenkins asks for clarification about affected versions.
06/14/2019 - Tenable provides clarification.
06/14/2019 - Jenkins thanks Tenable.
06/14/2019 - Jenkins says, "Earliest fix release would be 2.176.2 on July 17, latest possible within disclosure schedule 2.xxx.1 on September 11."
06/14/2019 - Tenable thanks Jenkins for the update.
06/14/2019 - Jenkins confirms the vulnerability exists.
07/02/2019 - Tenable asks for an update.
07/02/2019 - Jenkins plans to release a fix on July 17.
07/03/2019 - Tenable thanks Jenkins for the update.
07/12/2019 - Jenkins ticket added CVE-2019-10352.
07/17/2019 - Jenkins security advisory released.

All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.

Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.

For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.

If you have questions or corrections about this advisory, please email [email protected]

Try for Free Buy Now

Try Tenable.io

FREE FOR 60 DAYS

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Sign up now.

Buy Tenable.io

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

65 assets

$2,275.00

Buy Now

Try for Free Buy Now

Try Nessus Professional Free

FREE FOR 7 DAYS

Nessus® is the most comprehensive vulnerability scanner on the market today. Nessus Professional will help automate the vulnerability scanning process, save time in your compliance cycles and allow you to engage your IT team.

Buy Nessus Professional

Nessus® is the most comprehensive vulnerability scanner on the market today. Nessus Professional will help automate the vulnerability scanning process, save time in your compliance cycles and allow you to engage your IT team.

Buy a multi-year license and save

Try for Free Buy Now

Try Tenable.io Web Application Scanning

FREE FOR 60 DAYS

Enjoy full access to our latest web application scanning offering designed for modern applications as part of the Tenable.io platform. Safely scan your entire online portfolio for vulnerabilities with a high degree of accuracy without heavy manual effort or disruption to critical web applications. Sign up now.

Buy Tenable.io Web Application Scanning

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

5 FQDNs

$3,578.00

Buy Now

Try for Free Contact Sales

Try Tenable.io Container Security

FREE FOR 60 DAYS

Enjoy full access to the only container security offering integrated into a vulnerability management platform. Monitor container images for vulnerabilities, malware and policy violations. Integrate with continuous integration and continuous deployment (CI/CD) systems to support DevOps practices, strengthen security and support enterprise policy compliance.

Buy Tenable.io Container Security

Tenable.io Container Security seamlessly and securely enables DevOps processes by providing visibility into the security of container images – including vulnerabilities, malware and policy violations – through integration with the build process.

Learn More about Industrial Security

Get a Demo of Tenable.sc

Please fill out the form below with your contact information and a sales representative will contact you shortly to schedule a demo. You may also include a short comment (limited to 255 characters). Please note that fields with asterisks (*) are mandatory.