White Hat on Adult Grounds : How I hacked Pornhub and made $$$
A search box reflected user input without proper sanitisation, allowing an attacker to inject a script that executed in the victim's browser. The attacker could steal session cookies, potentially hijacking accounts.
medium.com
Published on medium.com
Hello everyone!! I hope you’re all doing good.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the search input was reflected into the HTML response without proper output encoding, and the filter could be bypassed with an alternative payload.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser and read their session cookie, potentially leading to session hijacking.
What the attacker needed
Victim clicks a crafted link; attacker can host a malicious link
How it was found
- Go to the site and find the search box.
- Enter a basic script payload; it is blocked.
- Try an HTML injection payload; it is reflected.
- Use a payload from a filter evasion list to bypass the block.
- A pop-up appears, confirming script execution.
- Use a payload to read document.cookie and see the session cookie.
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 write-up has not been written yet. The Original tab links to the source.
A search box on a website took what you typed and showed it back on the page without cleaning it first. An attacker could type special code that the browser runs as a program, letting them read the victim's login cookie and take over their account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.