doc.owncloud.org: XSS via Referrer
The Referer header value was reflected into a link on the page without proper sanitisation, allowing a javascript: URL to be inserted. An attacker could craft a request with a malicious Referer, and if a victim clicked the resulting link, script would execute.
- Disclosed after 9 hours
Hi,
The Referer Header in the following request, can be used to trigger an XSS.
GET /promote/ HTTP/1.1 Host: doc.owncloud.org User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0 Referer: javascript:alert('XSS'); Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Connection: keep-alive Content-Length: 2
The Referrer Value is reflected in the page (in the "referring page" link) see the PoC, however the XSS is not trigger until the victim click in the link.
Attachments


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 application reflected the Referer header into an anchor's href attribute without validating or encoding it, allowing a javascript: scheme.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser if the victim clicked the crafted link, but user interaction is required.
What the attacker needed
Victim clicks a link; attacker can set Referer header
How it was found
- Send a request to /promote/ with a Referer header containing a javascript: payload.
- Observe that the Referer value is reflected in the 'referring page' link on the page.
- Get the victim to click that link to trigger the 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.
When you visit a web page, your browser often sends a 'Referer' header that tells the site where you came from. This site took that value and put it directly into a clickable link without checking it was safe. An attacker could make the link start with 'javascript:' so that clicking it runs code in the victim's browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.