“The $10,800 Typo: How a Single Dot Broke Twitter’s Authentication”
The Digits SDK validated postMessage origins using String.search(), which treats the origin as a regular expression, so a dot matched any character. An attacker could register a lookalike domain and silently associate a victim's phone number with the attacker's account, then reset the password to take over the account.
infosecwriteups.com
Published on infosecwriteups.com
While researching web authentication vulnerabilities, I came across a fascinating case study that demonstrates how a tiny implementation flaw can compromise an entire authentication system. This wasn’t a complex cryptographic break — it was a simple regex mistake in Twitter’s “Sign in with Digits” feature that allowed…
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
The origin check used String.prototype.search(), which converts the argument to a regular expression, so dots in the expected hostname matched any character instead of a literal dot.
Impact
Any account using Digits authentication could be taken over silently, with no user interaction beyond visiting the malicious page, affecting Twitter's Fabric platform and other sites using the SDK.
What the attacker needed
Attacker registers a lookalike domain; victim logged into Fabric.io; victim visits the malicious page
The fix
The origin check should use strict equality or exact string matching instead of search(); the text presents this as the fix but does not say it was deployed.
How it was found
- Register a domain whose name matches the regex pattern produced from the expected origin.
- Host a page containing hidden Digits authentication code.
- Get a victim who is logged into Fabric.io to visit the page.
- The hidden code silently associates the victim's phone number with the attacker's account.
- Use the reset-password-with-Digits feature to take over the victim's account.
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 one website embeds a login widget from another, it checks messages by comparing the sender's web address (origin) to an expected value. Here the check used a string search that secretly treated dots as wildcards, so a similar-looking domain passed. That let an attacker link a visitor's phone number to the attacker's account and then reset the password.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.