“The $10,800 Typo: How a Single Dot Broke Twitter’s Authentication”
Twitter“Sign in with Digits”功能因正则表达式错误导致认证漏洞,攻击者利用origin参数中的点号作为通配符绕过验证,实现账户接管。 2025-10-16 05:43:6 Author: infosecwriteups.com(查看原文) 阅读量:41 收藏

Aman Sharma

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 complete account takeover.

free link

Press enter or click to view image in full size

The Vulnerability: When a Dot Becomes a Wildcard

The issue was in Twitter’s Digits SDK, specifically in how it validated message origins between the authentication service and client websites. The vulnerable code looked like this:

onReceiveMessage: function(t) {
this.config && -1 !== this.config.get("sdk_host").search(t.origin) && this.resolve(t.data)
}

At first glance, it seems like it’s checking if the message origin matches https://www.digits.com. But there's a critical flaw in how JavaScript's String.prototype.search() works.

The Devil in the Details:

  • search() converts its parameter to a regular expression
  • In regex, dots (.) match any single character
  • So "https://www.digits.com".search("www.d.gits.co") actually returns a match position…

文章来源: https://infosecwriteups.com/the-10-800-typo-how-a-single-dot-broke-twitters-authentication-f485e6dc0f04?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh