GHSL-2023-055: XML external entity (XXE) or server-side request forgery (SSRF) in SAML SSO Jenkins Plugin - CVE-2023-32991, CVE-2023-32992
The SAML SSO Jenkins plugin parsed user-supplied XML metadata with an insecurely configured parser, allowing external entity resolution and unvalidated URL fetching. An authenticated attacker could read local files, perform server-side request forgery, or cause denial of service.
Originally disclosed on GitHub Security Lab
SAML Single Sign On (SSO) Jenkins plugin 2.0.2 and earlier does not configure its XML parser to prevent XML external entity (XXE) attacks or server-side request forgery.
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 used an XML parser without disabling external entity resolution and fetched arbitrary URLs without validation.
Impact
This could lead to arbitrary file read, server-side request forgery, and denial of service; the SSRF issue may lead to information disclosure.
What the attacker needed
Authenticated attacker; ability to send HTTP requests to Jenkins; a job named 'test' exists
The fix
The issue was fixed in version 2.0.3 of the plugin.
How it was found
- Set up a server hosting a malicious XML file and a DTD file.
- Send an authenticated GET request to the validateMetadataUrl endpoint with the metadataUrl parameter pointing to the malicious XML.
- The server downloads and parses the XML, resolving external entities and exfiltrating data to the attacker's server.
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 give a web address for SAML metadata, then downloads and reads that file. Because it did not restrict what the file could contain or where it could point, an attacker could make the server fetch internal resources or read local files. This is dangerous because the server trusts the attacker's file too much.
What is XXE?
An XML parser resolves entities the attacker defines, reading local files or making the server send requests.