CVE-2021-42567 - Apereo CAS Reflected XSS on https://█████████
Apereo CAS echoes back the username or ticket ID in its error response without sanitising it, so a crafted POST request can execute script in the victim's browser. An attacker could run malicious JavaScript in the context of the CAS server.
Originally disclosed on HackerOne
- Triaged in 2 hours
- Fixed in 45 days
- Disclosed after 2 months
Apereo CAS through 6.4.1 allows XSS via POST requests sent to the REST API endpoints. CAS is vulnerable to a Reflected Cross-Site Scripting attack, via POST requests sent to the REST API endpoints. The payload could be injected on URLs: /███████/. Malicious scripts can be submitted to CAS via parameters such as the ticket id or the username. That results in CAS rejecting the request and producing a response in which the value of the vulnerable parameter is echoed back, resulting in its execution.
VULNERABLE SITE: https://██████████
VULNERABLE ENDPOINT: https://███████/█████████/
PROOF OF CONCEPT:
- It seems easy as you just need to drop the XSS payload inside the parameter "username" or at the end of the endpoint's path (in URL-encoded form, of course). Apereo CAS rejects the request and echoed back the ticket's ID or the username in the HTTP response without sanitizing.
- Save the above HTML code as xss.html
- Open it on the browser
- You can notice that the XSS is triggered via a POST request.
Impact
Apereo CAS through 6.4.1 allows XSS via POST requests sent to the REST API endpoints.
REFERENCES :
* https://apereo.github.io/2021/10/18/restvuln/
* https://www.sudokaikan.com/2021/12/exploit-cve-2021-42567-post-based-xss.html
* https://github.com/sudohyak/exploit/blob/dcf04f704895fe7e042a0cfe9c5ead07797333cc/CVE-2021-42567/README.md
* https://nvd.nist.gov/vuln/detail/CVE-2021-42567
* https://github.com/apereo/cas/releases
Best Regards, 3th1c_yuk1
System Host(s)
█████████
Affected Product(s) and Version(s)
Apereo CAS
CVE Numbers
CVE-2021-42567
Steps to Reproduce
- It seems easy as you just need to drop the XSS payload inside the parameter "username" or at the end of the endpoint's path (in URL-encoded form, of course). Apereo CAS rejects the request and echoed back the ticket's ID or the username in the HTTP response without sanitizing.
- Save the above HTML code as xss.html
- Open it on the browser
- You can notice that the XSS is triggered via a POST request.
Suggested Mitigation/Remediation Actions
You should check the server's version and update to ... not the versions 6.3.7.1 and 6.4.2, but the versions 6.3.7.4 and 6.4.4.2 to mitigate this XSS.
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
Likely the REST API error page reflects user-supplied parameters (username or ticket ID) into the HTML response without output encoding.
Impact
An attacker could execute arbitrary script in a victim's browser session on the CAS server, though the report does not demonstrate theft of credentials or session tokens.
What the attacker needed
Victim opens attacker's HTML page; CAS version before the fixed releases
The fix
The report says to upgrade to versions [redacted] or [redacted], which fix the issue.
How it was found
- Create an HTML page containing a form that posts to the CAS endpoint with a script payload in the username field.
- Save the page and open it in a browser.
- The form submits automatically and the script runs in the response.
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.
When a website takes something you typed and puts it straight back into the page without cleaning it, an attacker can slip in a small script. Here the login server did that with the username field, so a page the attacker controls could make the victim's browser run that script on the real site.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.