GHSL-2024-035_GHSL-2024-036: CORS misconfguration and Reflected XSS in Casdoor - CVE-2024-41657, CVE-2024-41658
Casdoor had a CORS misconfiguration that allowed any website to make cross-domain requests as the logged-in user, and a reflected XSS in the WeChat Pay QR code page via the successUrl parameter. An attacker could take actions on behalf of the user or execute script after a payment.
Casdoor is vulnerable to a CORS misconfiguration and a reflected Cross-Site Scripting (XSS) vulnerability, both of which may allow an attacker to take actions on behalf of the signed-in user.
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
Likely the CORS filter checked only a prefix of the Origin header, and the QR code page used an attacker-controlled successUrl without validation.
Impact
This could lead to account takeover, as an attacker may perform unauthorised actions as the signed-in user or execute script after a payment.
What the attacker needed
Victim is signed in to Casdoor; victim visits attacker's site or link; attacker controls a domain with allowed prefix; victim completes a WeChat Pay purchase
How it was found
- The attacker creates a domain whose name starts with an allowed prefix, such as localhost.example.com.
- The attacker hosts a page on that domain that makes cross-domain requests to Casdoor.
- A signed-in user visits the attacker's page, and the browser sends requests to Casdoor with the user's credentials.
- For the XSS, the attacker crafts a Casdoor payment link with a malicious successUrl parameter.
- The attacker sends the link to the user, who completes a WeChat Pay purchase.
- After payment, the page redirects to the attacker-supplied URL, triggering XSS.
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.
CORS is a browser rule that lets a website say which other sites may read its responses; a mistake here lets a malicious site act as you. Reflected XSS means a value from the link you click is put into the page and run as code, so an attacker can run script in your session. Together these could let an attacker do things as you, like take over your account.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.