CVE-2020-2162: XSS
Jenkins 2.227 and earlier, LTS 2.204.5 and earlier does not set Content-Security-Policy headers for files uploaded as file parameters to a build, resulting in a stored XSS vulnerability.
Other sources
Jenkins 2.227 and earlier, LTS 2.204.5 and earlier served files uploaded as file parameters to a build without specifying appropriate Content-Security-Policy HTTP headers. This resulted in a stored cross-site scripting (XSS) vulnerability exploitable by users with permissions to build a job with file parameters.\n\nJenkins now sets Content-Security-Policy HTTP headers when serving files uploaded via a file parameter to the same value as used for files in workspaces and archived artifacts not served using the Resource Root URL.\n\nThe system property hudson.model.DirectoryBrowserSupport.CSP can be set to override the value of Content-Security-Policy headers sent when serving these files. This is the same system property used for files in workspaces and archived artifacts unless those are served via the Resource Root URL and works the same way for file parameters. See Configuring Content Security Policy to learn more.\n\nEven when Jenkins is configured to serve files in workspaces and archived artifacts using the Resource Root URL (introduced in Jenkins 2.200), file parameters are not, and therefore still subject to Content-Security-Policy restrictions.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/org.jenkins-ci.main:jenkins-coreto a version that resolves this vulnerability.Fixed in 2.228 - Upgrade
Upgrade
Jenkinsto a version that resolves this vulnerability.Fixed in 2.228 - Configuration
If you need to customize the CSP sent for files uploaded via file parameters, set the system property hudson.model.DirectoryBrowserSupport.CSP to the desired Content-Security-Policy HTTP header value.}}]} }}} }
Jenkins hudson.model.DirectoryBrowserSupport.CSP = override Content-Security-Policy HTTP headers for files uploaded via file parameters (set to the desired CSP value)
Event History
Frequently Asked Questions
What is the severity of CVE-2020-2162?
CVE-2020-2162 is classified as a high severity vulnerability due to its potential for stored cross-site scripting (XSS).
How do I fix CVE-2020-2162?
To fix CVE-2020-2162, upgrade Jenkins to version 2.228 or later.
Which versions of Jenkins are affected by CVE-2020-2162?
CVE-2020-2162 affects Jenkins versions 2.227 and earlier, as well as LTS 2.204.5 and earlier.
What type of vulnerability is CVE-2020-2162?
CVE-2020-2162 is a stored cross-site scripting (XSS) vulnerability that arises from inadequate Content-Security-Policy headers.
Is there a workaround for CVE-2020-2162?
There are no known workarounds for CVE-2020-2162; upgrading to a fixed version is the recommended solution.