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 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
- Add a profile link with a URL containing a quotation mark and an event handler.
- Add CSS styles to the URL to make the link cover the whole page and become invisible.
- Visit the profile page to trigger the JavaScript when the page loads.
- Load a 'Digg This' button in an iframe to obtain the diggcheck token.
- 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.