Skip to content
XSS Write-up Intermediate

How I hacked Digg

Digg's profile link field failed to escape quotation marks, allowing an attacker to inject event handlers and CSS to create a full-page invisible overlay that executed JavaScript when a victim visited the profile. The attacker used this to automatically digg a story by fetching a CSRF token from an iframe and submitting a POST request.

phoboslab.org

Published on phoboslab.org

Two weeks ago I filed a bug report on Digg.com, explaining several XSS vulnerabilities and bugs I found. Some of these were (and some still are!) very critical.

The author, on phoboslab.org

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

What the attacker needed

Victim visits attacker's profile page; attacker has a Digg account

How it was found

  1. Add a profile link with a URL containing a quotation mark and an event handler.
  2. Add CSS styles to the URL to make the link cover the whole page and become invisible.
  3. Visit the profile page to trigger the JavaScript when the page loads.
  4. Load a 'Digg This' button in an iframe to obtain the diggcheck token.
  5. Send a POST request to digg the story using the token.

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.

When you add a link to your profile, the site should clean up any special characters so they can't break the page. Here, the site removed some dangerous characters but forgot to remove quotation marks, so an attacker could sneak in extra code that runs when someone views the profile. This let the attacker make visitors automatically 'digg' a story without their knowledge.

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.