Skip to content
XSS Write-up Beginner

XSS vulns galore (plus a cool shirt!)

Two reflected cross-site scripting vulnerabilities existed on the PornHub Premium website: one in the redeem code input and one in a URL parameter shown to new users. An attacker could run arbitrary scripts in a victim's browser, potentially accessing cookies and session tokens.

jonbottarini.com

Published on jonbottarini.com

When the adult website PornHub launched their public bug bounty program, I was pretty sure that most of the low hanging fruits of vulnerabilities would be taken care of and already reported. When I first started poking around, I found my first vulnerability in less than 15 minutes.

Jon Bottarini, on jonbottarini.com

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 application failed to properly sanitise or encode user-supplied input before reflecting it into the page.

Impact

An attacker could execute arbitrary scripts in a victim's browser, potentially accessing cookies and session tokens, though the report does not demonstrate actual theft.

What the attacker needed

Victim clicks a crafted link or enters payload; for second bug, victim must be a new user

The fix

The vulnerabilities were fixed according to the text.

How it was found

  1. Go to the redeem code section of the site.
  2. Enter a payload that starts with harmless text to bypass validation, followed by an XSS payload.
  3. Observe the script executing (e.g., a confirm dialog).
  4. For the second vulnerability, open the site in an incognito window to appear as a new user.
  5. Click 'enter' on the compliance pop-up, which adds a parameter to the URL.
  6. Modify that parameter with an XSS payload to execute script.

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.

Cross-site scripting (XSS) is a flaw where a website takes input from a user and puts it into a page without cleaning it, so an attacker can make the site run their own JavaScript. This lets the attacker steal cookies or session tokens, or change what the page shows. Here, two input fields on a site did not check what was typed, so a script could be injected.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

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.