GHSL-2021-072: Reflected Cross-Site Scripting (XSS) leading to Remote Code Execution (RCE) in Nuxeo - CVE-2021-32828
The oauth2 callback endpoint reflects the service provider name without sanitisation, allowing an attacker to inject script via a crafted URL. A logged-in user visiting the URL triggers the XSS, which can be escalated to remote code execution through the automation API.
Originally disclosed on GitHub Security Lab
The oauth2 REST API is vulnerable to Reflected Cross-Site Scripting (XSS). This XSS can be escalated to Remote Code Execution (RCE) by levering the automation API.
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 endpoint does not restrict the response content type, so Jersey uses the attacker-supplied Accept header, and the service provider name is reflected without sanitisation.
Impact
An attacker could execute arbitrary code on the server, but the victim must be logged in and visit a crafted link.
What the attacker needed
Victim is logged in; victim clicks a crafted link
The fix
The issue was fixed by restricting the response content type and sanitising the reflected input.
How it was found
- Craft a URL with a malicious service provider name in the path.
- Trick a logged-in user into visiting the URL.
- The XSS executes and loads attacker-controlled JavaScript.
- The JavaScript sends a request to the automation RunScript endpoint to execute arbitrary code.
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 application takes a value from the URL and puts it directly into the web page without cleaning it. An attacker can craft a link that, when clicked by a logged-in user, runs malicious code in the user's browser. Because the application has a powerful scripting feature, the attacker can then run commands on the server.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.