How I could steal Telegram OTPs using SMS relays
The Telegram Peer-to-Peer Login (P2PL) program lets a user's phone act as an SMS relay for other users' OTPs. An attacker who joins P2PL and captures baseband traffic with a rooted Qualcomm phone could see other users' OTPs, but Telegram says server-side restrictions stop the attacker from using them.
medium.com
Published on medium.com
In this article, I will discuss SMS relays for mobile applications, how they can be abused to steal other users’ OTPs, and provide a practical example of stealing Telegram OTPs.
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 P2PL design relays other users' OTP SMS through a participant's device, so the relay device can read the message contents at the baseband level.
Impact
An attacker could read other users' OTPs, but Telegram states server-side restrictions prevent the attacker from using them to take over accounts.
What the attacker needed
Rooted Qualcomm Android phone; debug mode enabled; P2PL membership in a supported country; many valid Telegram accounts
The fix
Telegram already applies server-side restrictions, and the author recommends root detection and similar measures for any SMS-relay system.
How it was found
- Join the Telegram P2PL program so the device can act as an SMS relay.
- Run QCsuper on a rooted Qualcomm Android phone with debug mode enabled to capture baseband traffic.
- Log in with many valid Telegram accounts using phone numbers from a wordlist to trigger OTP sends.
- Filter the capture for SMS-SUBMIT packets and read the destination number and message data.
- Automate extraction of phone:OTP pairs with Tshark and try to submit the OTPs.
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 one-time password (OTP) is a short code sent by SMS to prove who you are when logging in. Telegram's P2PL program uses some users' phones to forward these SMS codes to other users, so the code passes through another person's device. The researcher showed that a modified phone can read those forwarded codes, but Telegram says its servers block anyone other than the original user from actually using them.
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.