Skip to content
XSS Disclosed report Beginner

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.

sandh0t Follow

Originally disclosed on HackerOne

  • 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

xss_poc_1.png
xss_poc_1.png From the original on HackerOne
xss_poc_2.png
xss_poc_2.png

The original report as published on HackerOne, by sandh0t. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Send a request to /promote/ with a Referer header containing a javascript: payload.
  2. Observe that the Referer value is reflected in the 'referring page' link on the page.
  3. 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.

More by sandh0t

View all

2 more disclosed reports, best first.

More from ownCloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.