CSRF to Stored HTML injection at https://www.█████
The case-studies search page reflected a user-supplied keyword without sanitising HTML characters, so markup such as links could be injected into the results page. Because the input arrives via a POST request, the reporter chained it with a cross-site request forgery so a victim visiting a crafted page would see the injected content.
- Triaged in 8 hours
- Fixed in 43 days
- Disclosed after 43 days
Description: I have found out that on the https://www.███████ domain, you initiate POST request in order to look up for case studies, the parameter keyword on the request, allows the usage of bad characters such as < " ', although XSS payloads are pretty secured, HTML injection is an option.
As you might notice because this is a POST request, and the content is not initiated by the URL, i need to chain it with CSRF so the victim will get presented the malicious infected page, which you will see on the Video PoC, even upon refreshing is remain infected with the injection, only when you open a new tab, the page rests.
This allows me implementing malicious links and contents inside the case studies search page.
████████
Step-by-step Reproduction Instructions
- Navigate to https://www.█████
- Craft a malicious HTML injection as you wish, I have injected: "<a href=https://naglinagli.github.io>Click here to win 1000$!</a>"
- Save the POST request and craft CSRF payload.
HTML snippet of the CSRF payload:
<html>
<!-- CSRF PoC - generated by Burp Suite Professional -->
<body>
<script>history.pushState('', '', '/')</script>
<form action="https://www.███████" method="POST">
<input type="hidden" name="keyword" value="<a href=https://naglinagli.github.io>Click here to win 1000$!</a>" />
<input type="hidden" name="Find Case Studies" value="Find Case Studies" />
<input type="hidden" name="crimetype" value="none" />
<input type="hidden" name="year" value="none" />
<input type="hidden" name="gender" value="search.php" />
<input type="hidden" name="employeetype" value="none" />
<input type="hidden" name="age" value="none" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>
Suggested Mitigation/Remediation Actions
Sanitizing malicious characters on the keyword parameter.
##Best Regards, nagli
Impact
CSRF to Stored HTML injection on the case-studies search 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 keyword parameter was written into the results page without HTML-encoding, and the search action lacked CSRF protection.
Impact
An attacker could make a victim's browser display attacker-controlled links and content on the case-studies search page, which persisted on refresh until a new tab was opened.
What the attacker needed
Victim visits attacker page; victim's browser submits the form
The fix
The keyword parameter should be sanitised to remove malicious characters.
How it was found
- Open the case-studies search page on the target site.
- Enter HTML markup in the keyword field and submit the search.
- Save the resulting POST request and build a cross-site request forgery page that replays it.
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 search box on a website was echoing back whatever was typed into it, including HTML code that makes links and other page elements. Normally a browser only sends that search from the site itself, so the attacker built a separate page that quietly submits the same search on the victim's behalf. The victim then sees a page containing the attacker's link, which is a form of trickery called cross-site request forgery.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.