GHSL-2023-079: Arbitrary File Exfiltration in Jenkins MathWorks Polyspace Plugin - CVE-2023-37960
The Jenkins MathWorks Polyspace Plugin does not validate the file path in a job parameter, allowing an attacker with Job/Configure permission to attach arbitrary files from the Jenkins controller to an email notification. This could lead to exfiltration of sensitive files.
Originally disclosed on GitHub Security Lab
Jenkins MathWorks Polyspace Plugin 1.0.5 and earlier does not restrict a file path in a job parameter, allowing attackers with the Job/Configure permission to exfiltrate arbitrary files from the Jenkins controller by sending them in an email notification.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The plugin concatenates user-controlled input to a workspace path without validating that the resulting path stays within the workspace, allowing path traversal.
Impact
This issue may lead to arbitrary file read, but exploitation requires that the job runs on the controller or that the workspace path also exists on the controller.
What the attacker needed
Job/Configure permission; Polyspace plugin global config set up; SMTP server configured in Jenkins; Job runs on controller or workspace path exists on…
How it was found
- Set up the global configuration for the Polyspace plugin (it doesn't need to be correct).
- Configure a functional SMTP server in Jenkins.
- Create a new job and set the Polyspace environment.
- Add a Polyspace Notification post-build step.
- Configure the Attachment filename property with a path traversal sequence (e.g., '../../../../../../../../etc/passwd').
- Execute the job; the SMTP server receives an email with the file attached.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
The plugin lets a user set a filename to attach to an email after a build. It does not check that the file is inside the build's workspace, so someone who can configure jobs can use a path like '../../etc/passwd' to make the plugin read a file from the server and email it to themselves. This means they can steal sensitive files from the Jenkins server.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.