📜 ⬆️ ⬇️

New bug in Telegram Desktop allows you to read the latest message.

Recently I discovered a very interesting bug in Telegram. It allows you to read deleted messages. And as a supporter and fan of cult products - he immediately sent a message about the bug to Telegram support. With a clear conscience, he showed his colleagues at work the found bug. “Do you want to restore your last message in Telegram?” I said and got down to business, watching the surprised faces of my colleagues.

telegram bug

But let's not hesitate and get down to business


Telegram Desktop version 1.6.3 (last available today)

Steps to play
')
  1. We send the "secret" message to Bob
  2. We clean the chat messages with Bob, the “Clear history” button
  3. Send any new message to bob
  4. Delete the message from the context menu “Delete message” (tick off - delete from Bob too)

Expectations

All messages are deleted and the chat is completely empty.

Reality

Our “secret message” has appeared, which has been deleted.

The further course of my thoughts


First of all, I wanted to understand - this is the server side or the client side. Therefore, in the same way, I tried to reproduce the bug on the Telegram client for Android. Unfortunately, the cellular bug has not been reproduced and the optimism has already diminished. It became clear that we probably had a cosmetic fix in front of us: we got it messed up with indices and a little more records were being received from the local cache.

Since Telegram Desktop is open source and lies on github . I found my version of Telegram, opened the code and tried to understand what was happening. The code turned out to be quite trivial and understandable. It all starts with hanging the handler for the command. It just shows the dialog box with the parameters for deletion and then goes on to clear the chat. Personally, I visually did not catch the eye for anything and everything seems to be working correctly. It is necessary to deploy the environment, debug, and immediately it becomes clear what's what.

At the current moment and at the time of publication of this article - this bug is not fixed, so you can surprise your colleagues and friends with it. You can show your girlfriend that she did not do stupid things.

If you like this article and there will be a lot of comments, I will definitely write the following article: “How I fixed the bug in Telegram”. And also I will tell in detail how to deploy the environment for the desktop version of Telegram. Thanks for attention!

Update


How life has changed after the publication on Habré


As usual I get up and watch the news in google. I see my full name on the front pages and I understand that something is wrong. The people also reproduce this bug and force the given message ( full text of the article ). It is very nice, thank you!

image

Watch Android app


In a personal, many asked to see the Android app. I can not refuse colleagues and install the Android application Telegram. Especially I did not penetrate, but there are enough mistakes. For example, here.

image

Playback steps
1) Clearing the story with "Victor"
2) “Victor” writes a message

Expectations
Notify comes via google server and the message is displayed in ListView.

Reality
Notify comes, but ListView does not display changes. There is a mark "History cleared."

How the current bug was found


A lot of colleagues were interested in how I found this bug. Because for all Telegram "works like a clock." My former team leader (Anton Ryzhakov), once answered this question like this: “He poked and poked trouble”. This very accurately describes everything that happens. Friends, thank you for all the responses in PM - they were very nice to read. I hope you were interested. Good working day!

Source: https://habr.com/ru/post/447034/


All Articles