Skip to content
XSS Write-up Advanced

Twitter XSS by stopping redirection and javascript scheme

The dev.twitter.com site had an open redirect that could be abused to inject a javascript: scheme link into the page body. By crafting a URL with an invalid port, the redirect was blocked in Firefox while the page still rendered a clickable javascript: link, allowing script execution when clicked.

Sergey Bobrov Follow

Published on blog.blackfan.ru

Разгребал логи скриптов для bugbounty и нашел интересное перенаправление на сайте dev.twitter.com. Изначально оно выглядело так https://dev.twitter.com//xxx/

Sergey Bobrov, on blog.blackfan.ru

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 server reflected part of the request URI into the Location header and page body without proper validation, allowing a javascript: scheme to be injected and the redirect to be broken by an invalid port.

Impact

An attacker could execute arbitrary JavaScript in the context of dev.twitter.com when a victim clicks the crafted link, potentially stealing cookies; the lack of X-Frame-Options also allowed clickjacking to trigger the click.

What the attacker needed

Victim uses Firefox; victim clicks the crafted link

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 website was redirecting users based on part of the URL. The attacker found a way to make the site show a link that starts with 'javascript:', which runs code when clicked. They also stopped the automatic redirect so the victim would see and click the link.

What is XSS?

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

More by Sergey Bobrov

View all

1 more disclosed report, best first.

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.