POST XSS - fields[account][firstname] parameter
A registration form accepted a first name containing an image tag with an error handler; the report says this could execute and potentially lead to cookie theft and session hijacking.
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][firstname] 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[account][firstname]" value="fnfOzvSR<img src=x onerror=prompt(1)>" />
<input type="hidden" name="fields[account][lastname]" value="fnfOzvSR" />
<input type="hidden" name="fields[contacts][email]" value="testing@example.com" />
<input type="hidden" name="fields[contacts][phone]" value="555-666-0606" />
<input type="hidden" name="formid" value="crm_register_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
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 first name value was stored and later rendered into a page without context-appropriate output encoding, so HTML in the input was treated as markup.
Impact
An attacker could steal cookies and impersonate legitimate users through session hijacking, though the report gives no proof of execution beyond the payload itself.
What the attacker needed
Victim submits or is tricked into the form; attacker-supplied first name value
How it was found
- Build a page that automatically submits a POST request to the registration endpoint.
- Include the first name field with an image tag carrying an error handler, plus last name, email, phone and form identifiers.
- Load the page so the form submits on its own.
- Check whether the submitted value is displayed and whether 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.
A website took text typed into a form (a first name) and put it back on a page without cleaning it. The text contained code disguised as an image, which could run in the browser and potentially let an attacker act as the user.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.