Skip to content
XSS Disclosed report Beginner

XSS found for https://█████████

The search endpoint reflects the query parameter without sanitisation, allowing an attacker to inject JavaScript that executes in a victim's browser. An attacker could trick a user into submitting a malicious form to steal sessions or perform actions as the user.

thpless Follow

Originally disclosed on HackerOne

  • Triaged in 6 hours
  • Fixed in 7 days
  • Disclosed after 9 days
  • Location: POST request to the endpoint /web/guest/search
  • Parameter Affected: query=
  • Proof of Concept:
<html>
<body>
<script>
	window.onload = function(){document.forms['XSS'].submit();}
</script>
	<form id='XSS' action='https://█████████/web/guest/search' method='post'>
		<input type='text' name='query' value="'};alert('XSS');var x={y:'">
	</form>
</body>
</html>

Impact

An attacker can craft a malicious payload and trick a user into sending a POST request to the vulnerable endpoint. The unvalidated and unsanitized data is then reflected in the server’s response, allowing the attacker to execute arbitrary JavaScript code in the victim’s browser. This could lead to session hijacking, redirection to malicious sites, or unauthorized actions being performed in the context of the authenticated user.

System Host(s)

██████████

Affected Product(s) and Version(s)

██████████ WebPortal

CVE Numbers

Steps to Reproduce

You can download the added exploit.html and open it in a browser

████

Suggested Mitigation/Remediation Actions

To fix this issue, ensure that all user-supplied data is properly sanitized and encoded before being reflected in the server's response. Implementing Content Security Policy (CSP) headers can also mitigate the risk of XSS attacks by restricting the sources from which scripts can be loaded.

The original report as published on HackerOne, by thpless. 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 reflects the query parameter into the HTML response without output encoding or input validation.

Impact

An attacker could execute arbitrary JavaScript in the victim's browser, potentially leading to session hijacking, redirection to malicious sites, or unauthorised actions as the authenticated user.

What the attacker needed

Victim opens a malicious HTML page; victim's browser submits the form

The fix

All user-supplied data should be properly sanitised and encoded before being reflected, and a Content Security Policy can help restrict script sources.

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 type something into a search box, the website usually shows it back to you. Here, the site puts whatever you typed directly into the page without cleaning it first. An attacker can type code instead of normal text, and the victim's browser will run that code as if the website itself had written it.

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 thpless

View all

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