Telegram bug in terminated sessions
After a Telegram session was terminated or an account deleted, the server continued sending channel message updates over an existing connection if the client ignored the termination signal. An attacker with a terminated session could still receive messages from channels they had joined.
Published on hack5.dev
A terminated session or a deleted account was still able to receive messages from active connections. Telegram fixed it as of 15~16 September 2021.
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 did not enforce session termination on the existing connection, relying on the client to close it after receiving an error.
Impact
A terminated session or deleted account could still receive channel messages, but not private chats, bots, basic groups, or the service account that sends login codes.
What the attacker needed
A Telegram account; ability to run a custom client; connection kept open after logout
The fix
The bug was fixed by Telegram on 15 September 2021.
How it was found
- Connect to the Telegram test environment and create an account.
- Log out of the account.
- Ignore the termination signal and wait for incoming updates.
- Observe that channel message updates are still received.
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 log out or delete your account, the server should stop sending you new messages. Here, if the app didn't close the connection properly, the server kept sending messages from channels you were in. This means someone who was supposed to be kicked out could still read those messages.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.