Telegram bug bounties: XSS, privacy issues, official bot exploitation and more…
The article describes multiple vulnerabilities in Telegram, including insufficient verification of callback_data allowing manipulation of bot buttons, an XSS on telegram.org via embedded video players, a privacy issue exposing profile pictures, sticker crashes, and permission issues on bugs.telegram.org. An attacker could exploit these to ban users, execute JavaScript, view private profile pictures, crash clients, or access private posts.
{{media:0}}
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.
Context
This article collects five bugs found in Telegram products over several years: the Bot API's callback_data handling, an XSS on telegram.org and the sites that embed Telegram widgets, a privacy flaw in profile picture retrieval, a series of client crashes triggered by malformed animated stickers, and broken authorisation on bugs.telegram.org. The work was done by Davide, Andrea and Giuseppe.

Telegram bots are ordinary Telegram accounts with restrictions and extra features. One of those features is a message with buttons. There are two kinds of buttons, KeyboardButton and InlineKeyboardButton. Inline buttons are the interesting ones: the text shown to the user can differ from the query the bot receives. A button can display an emoji while the bot receives a short name such as btn1. The Bot API documentation describes the callback data parameter as follows:
data String Optional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.
That data field corresponds to callback_data and is what the bot receives when the button is pressed. Normally only the bot can create the buttons a user sees, and changing them would require the bot's API token. The warning in the documentation suggests that a client which does not respect that restriction can still send arbitrary data.
Setup
For the callback_data work, Davide and Andrea built a program that used an MTProto client (MTProto is the protocol for communicating with the Telegram APIs) to send and test requests against the Telegram APIs. Using a library that supports MTProto let them make calls with a user account, without being limited by the official client. The libraries they used for testing the Telegram API were MadelineProto, Telethon, Pyrogram and TDLib. They note that the documentation of the individual libraries is more up to date than the official method documentation.
For the XSS work they needed a public channel and a site that served a video player. For the sticker work they used the official clients (Android, Desktop, Telegram X and iOS) and a bot, t.me/jsontgsbot, that converts between JSON and animated stickers. For the bugs.telegram.org work they used a browser and observed the requests the site's API made.
Finding it
Arbitrary callback_data
Using the Telegram API (which is different from the Bot API), they invoked the messages.getBotCallbackAnswer method to simulate a button press. They noticed that the data parameter could be filled with any string they wanted. The documentation warned about this, but the question was whether bots actually validated the value.
Many developers had not considered the possibility and implemented checks based on what their bot had sent. A button carrying something like ban#1234567 in callback_data would, on a bot without validation, ban user 1234567 as soon as someone sent a modified value. The same lack of checks could allow banning users without permission, SQL injection, or worse. These were not hypothetical: similar things happened in third-party bots and were fairly common.
Telegram ships two official bots that demonstrate the Bot API, VoteBot (t.me/vote) and LikeBot (t.me/like). Neither validated callback_data properly.
XSS on telegram.org
Andrea and Davide noticed that the Telegram app could play videos directly from a site preview. They explored t.me, which offers a widget with a preview of posts from public channels and can embed a video player, as happens with YouTube.
Profile picture privacy
After a Beta release added the option to make a profile picture visible only to contacts, Davide looked at the endpoint his bot used to fetch profile pictures, https://t.me/i/userpic/320/USERNAME.jpg, which he found in the Login Widget documentation. The endpoint returned profile pictures of users who had set their privacy to contacts only. He waited until the Beta ended before reporting, to avoid reporting something still in progress. After the official March release the issue was still present, so he reported it.
Sticker crashes
The July 2019 update introduced animated stickers. According to the documentation they use Lottie. Looking at the app sources, Giuseppe found that an animated sticker is a compressed JSON file, compressed with gzip. Extracting a TGS file yields a JSON containing the vector information, the layers of the animation, and other data such as frame rate and resolution.
Giuseppe built t.me/jsontgsbot to speed up testing: feed it the right JSON and it produces an animated sticker; give it a sticker and it returns the equivalent JSON. Zip bombs did not work: the size cannot exceed 64KB compressed, and the JSON must be valid for the client to accept it. So they manipulated the JSON instead, changing frames, removing, adding and duplicating parameters, and generating invalid JSON in every way they could think of. At first nothing happened, but after a few attempts clients sometimes crashed.
bugs.telegram.org permissions
Telegram had recently launched a platform for suggestions and bug reports. Users write posts, and below every post there is a comment section where you can leave a like or subscribe to a discussion and receive notifications in the app. At the time of testing it was not yet possible to open posts; only comments were allowed. Comments mentioned that in future it would be possible to open private posts to report security problems.
By exploring the requests the browser made, Davide observed the endpoint and parameters used by the site's API. He looked at post IDs such as https://bugs.telegram.org/c/123 and noticed that some posts, instead of returning the usual error Sorry, this card doesn't exist., returned You can not view this card. That difference suggested that some posts existed but were not accessible to him.
Exploitation
Step 1: send arbitrary callback_data with messages.getBotCallbackAnswer
With an MTProto library, receive the updates sent to the user to learn the callback_data of a button, then invoke messages.getBotCallbackAnswer with a data value of your choosing. The method accepted any string.
Step 2: VoteBot
VoteBot is just text with votes, not a bot used to ban. After altering the values and a few attempts, they found that sending the id of another poll created through the same bot overwrote the title and the vote text with those of the other poll. It was therefore possible to modify other people's messages, and even messages of channels that used the bot, with a custom message.
Step 3: LikeBot
LikeBot had a very similar situation. Here the id had to be replaced with the id of a vote with the same number of buttons, and only the text of the buttons changed, not the text of the message itself.
Step 4: XSS through the video player preview
They created a site with a working video player. They created a site with a working video player, using index.php and player.php. They created a public channel and posted the link https://website/test/index.php to generate the preview. The site accepted the video player without any hassle. Visiting the t.me page that pointed to the post produced an alert box.
Cookies of the original page could not be read because the player was inside an iframe. It was still possible to create alerts, perform open redirects, or run anything else JavaScript could execute. The same problem occurred on telegram.org, since the two sites were identical, and on all sites that allowed Telegram widgets, such as Telegra.ph.
Step 5: fetch a contacts-only profile picture
Request https://t.me/i/userpic/320/USERNAME.jpg for a user whose profile picture privacy is set to contacts only. The endpoint returned the picture anyway.
Step 6: crash clients with malformed TGS
Use t.me/jsontgsbot to convert a sticker to JSON, edit the JSON, and convert it back. Removing almost all parameters, such as the frame rate and all the layers, made the Android client go into error and crash. Setting the frame rate to 0 crashed the desktop client, which tried to divide by 0. Other values crashed the desktop client with a SIGSEGV error. The next day they found another crash after additional server-side controls had been put in place.
Step 7: crash Telegram X with an old sticker
A month later, scrolling through an old chat full of tested stickers, Davide saw a crash on Telegram X, the other official Android client. Finding the sticker among many was complicated because the app kept crashing. Using the Desktop client he located it: it was one of the stickers reported earlier. Reloading it, the server no longer accepted it, but it had been uploaded before the server-side block, so forwarding it still made it viewable as a sticker. A friend with iOS confirmed that his client crashed too.
Step 8: crashes return
A few months later, revisiting an old chat with stickers, crashes appeared again with the following stickers: Android stock and Android tgx; Android stock and Android tgx; Android tgx; and a tgx crash log. The report lists these as captions without reproducing the files.
Step 9: like a post you cannot see
Writing a comment to a post through the API was blocked: the server said the request was not authorised. Leaving a like on a post he had no authorisation for was accepted. Through the API responses he could also see the number of likes and dislikes. Not very useful by itself, but it motivated further searching.
Step 10: subscribe to a post you cannot see
The next step was a request to subscribe to a post, where the hash value is used as if it were a session cookie. The API responded positively and the subscription was created. This would have delivered notifications for future comments directly to the Telegram app. He could not verify that, because he did not have permission to comment.
Step 11: read comments of private posts
In posts with many comments there was an API request to load more comments. He changed the ID and loaded comments. This let him read comments of private posts, potentially leaking part of the security reports made through the platform. Since the platform was newly released, there were only comments written by the developers, so nothing important was leaked.
Root cause
The callback_data issue is a trust problem: the bot receives a value that the client controls, and bots that act on it without validating it against what they sent can be driven to act on other objects. The documentation warned about arbitrary data, but the official bots did not check it, likely because the value was treated as opaque and trusted.
The XSS came from accepting an embedded video player from an arbitrary domain in the post preview. The preview accepted an embedded video player from an arbitrary domain, so a page on an attacker-controlled site could run JavaScript inside the widget. The iframe limited the damage to the widget's origin rather than the main page's cookies.
The profile picture issue is an authorisation check missing on a public endpoint: https://t.me/i/userpic/320/USERNAME.jpg served the picture regardless of the user's privacy setting.
The sticker crashes followed from malformed JSON: removing required parameters, setting the frame rate to 0, or other invalid values. Removing required parameters, setting the frame rate to 0, or other malformed values led to errors, division by zero and SIGSEGV. Server-side validation was added, but stickers uploaded before the block remained viewable when forwarded, and later the bug was reintroduced.
The bugs.telegram.org issue is broken authorisation on several API actions: commenting was blocked, but liking, subscribing and loading comments were not checked against the same permission, so the object ID alone was enough.
Impact
With arbitrary callback_data, any user could act on other users' objects in bots that trusted the value: banning users without permission, SQL injection, or worse, depending on the bot. On VoteBot it was possible to overwrite the title and vote text of other polls, including messages of channels that used the bot. On LikeBot only the button text changed, and only with a vote that had the same number of buttons.
The XSS allowed alerts, open redirects and any JavaScript execution inside the widget iframe on t.me, telegram.org and sites that embed Telegram widgets such as Telegra.ph. Cookies of the main page were not readable because of the iframe.
The profile picture endpoint exposed pictures of users who had chosen contacts-only visibility to anyone who knew the username.
Malformed stickers crashed the Android, Desktop, Telegram X and iOS clients. Because a sticker uploaded before the server-side block could still be forwarded and viewed, the crash remained reachable after the first fix.
On bugs.telegram.org, a user without permission on a post could like it, subscribe to it and read its comments, potentially leaking part of the security reports made through the platform. At the time only developer comments existed, so nothing important was leaked.
Fix
Telegram acknowledged and fixed the callback_data issue: users can no longer send arbitrary text via messages.getBotCallbackAnswer. If the data does not match the name of an existing button, the method returns the error 400 DATA_INVALID.
For the XSS, Telegram confirmed the problem and fixed it by allowing embedded videos only from trusted domains such as youtube.com and twitter.com.
For the profile picture issue, Telegram confirmed it and the endpoint now respects the user's privacy settings: the picture is not viewable unless it is public.
For the stickers, the first report was fixed on both the client and server side by blocking the upload of invalid stickers. Invalid stickers now have mime type application/x-bad-tgsticker instead of application/x-tgsticker and are displayed as files. The second report was fixed by patching the clients. The third report, after the bug was reintroduced, was confirmed again and the clients were patched.
For bugs.telegram.org, Telegram confirmed the issue and fixed it during the winter holidays. The website's APIs no longer allow access without authorisation.
Variants to test
- Other bots that act on callback_data. Press a button, capture the
callback_datawith an MTProto client, and resend it throughmessages.getBotCallbackAnswerwith another object's id. A positive result is the bot acting on an object you do not own, such as changing another poll or banning another user. - Other preview widgets that embed third-party players. Post a link to a page you control that serves a video player and view the generated preview. A positive result is your JavaScript running in the widget, shown by an alert or a redirect.
- Other public media endpoints. Take an endpoint that serves user media by username or id and request it for an account with restrictive privacy settings. A positive result is the media being returned despite the setting.
- Other parsers of compressed structured data. Feed a client or server a valid but malformed document: remove required fields, set numeric fields to 0, duplicate keys. A positive result is a crash, an unhandled error, or a division by zero.
- Other API actions on objects you cannot read. Find an object whose read returns a permission error, then try related actions such as liking, subscribing or loading sub-resources with the same id. A positive result is a success response or data from the protected object.
What happened, in plain words
Over several years, three Italian researchers, Davide, Andrea and Giuseppe, found five separate problems in Telegram's products. Telegram is a messaging app you can install on a phone or use in a browser. The problems were:
- A way to send fake button presses to Telegram bots, which let them change other people's polls and, in theory, do much worse on badly written bots.
- A cross-site scripting (XSS) bug on telegram.org and on sites that embed Telegram widgets, such as Telegra.ph, which let them run their own JavaScript inside a Telegram page.
- A privacy bug: a public web address returned profile pictures of people who had set their picture to be visible only to their contacts.
- A series of crashes in the official Telegram apps, caused by deliberately malformed animated stickers.
- A permissions bug on bugs.telegram.org, Telegram's bug-reporting site, where they could like, subscribe to and read comments of posts they were not allowed to see.
All five were reported to Telegram, which confirmed and fixed them. This article walks through each one from the beginning, assuming you know how to use a browser and nothing about security.

Some background before we start
A few ideas come up again and again, so here they are once, in plain words.
What an API is. An API is the set of doors a program offers to other programs. When you use a website, your browser sends requests to the site's API and the site answers with data. Think of a restaurant: the menu is the API, the kitchen is the server, and you are the client. You can only order what is on the menu, but sometimes the kitchen forgets to check whether you are allowed to order a particular dish.
What a token is. A token is a secret string that proves who you are, like a wristband at a festival. If you have the wristband, the staff let you into the backstage area. If someone else copies it, they get in too. Telegram bots have an API token that lets their owner control them.
What a cookie is. A cookie is a small piece of data a website stores in your browser so it can recognise you on the next request, like a cloakroom ticket. If an attacker can read your cookies, they can often act as you.
What a bot is. A bot is a Telegram account run by a program instead of a person. It can send messages, and it can send messages with buttons you can press.
What XSS is. Cross-site scripting means getting your own JavaScript code to run inside someone else's web page. JavaScript is the programming language browsers use to make pages interactive. If an attacker's JavaScript runs on a site you trust, it can do things in your name on that site.
What an iframe is. An iframe is a window inside a web page that shows another page. The inner page is kept separate from the outer one, which is why the researchers could not read the main page's cookies.
What a crash is. A crash is a program stopping unexpectedly because it hit something it could not handle. A SIGSEGV is a specific kind of crash where a program tries to read or write memory it is not allowed to touch.
What fuzzing is. Fuzzing means feeding a program lots of strange, broken or unexpected input to see whether it breaks. It is like shaking a vending machine with every coin you can find to see which one jams it.
What gzip is. Gzip is a way of compressing data so it takes less space. You compress it to store or send it, and decompress it to read it back.
What JSON is. JSON is a text format for structured data, made of names and values in curly braces. It is how many programs exchange information.
What MTProto is. MTProto is the protocol Telegram's own apps use to talk to Telegram's servers. It is different from the Bot API, which is the simpler interface offered to bots.
Bug 1: fake button presses on Telegram bots
What the feature does
Telegram lets anyone create a bot. A bot can send a message with buttons attached. There are two kinds of buttons, KeyboardButton and InlineKeyboardButton. The inline ones are the interesting ones: the text you see on the button can be different from the value the bot receives when you press it. A button can show a nice emoji while the bot receives a short internal name such as btn1.
The value the bot receives is called callback_data. The official Bot API documentation describes it like this:
data String Optional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.
In plain words: the documentation is warning bot developers that a client which does not follow the rules can put anything it likes in that field. Normally only the bot's owner can create buttons, and changing them would require the bot's API token. The warning suggests that a client that ignores the rules can still send whatever it wants.
How they tested it
Davide and Andrea wrote a program that used an MTProto client to send requests to Telegram's servers directly. MTProto is the protocol Telegram's own apps use, so by using a library that speaks it they could act as a normal user account, without being limited by what the official app allows. The libraries they used were MadelineProto, Telethon, Pyrogram and TDLib. They note that each library's own documentation is more up to date than the official method documentation.
Using the Telegram API (which is different from the Bot API), they called the method messages.getBotCallbackAnswer to simulate a button press. They found that the data parameter could be filled with any string they wanted.
The question then was: do bots actually check that value? Many bot developers had not thought about it and simply acted on whatever arrived. Imagine a button whose callback_data contains something like ban#1234567. On a bot with no checks, anyone who sends a modified value could ban user 1234567 from a group or channel. The same lack of checks could allow SQL injection (sending database commands through a field the developer expected to be plain text) or worse. These were not hypothetical examples: similar things happened in third-party bots and were fairly common.
Telegram itself ships two official bots that demonstrate the Bot API: VoteBot at t.me/vote and LikeBot at t.me/like. Neither of them checked callback_data properly.
VoteBot
VoteBot is just text with votes, not a bot used to ban anyone. Using an MTProto library, the researchers could receive the updates sent to the user, which let them see what the callback_data of a button actually was. They then altered the values. After a few attempts they found that sending the id of another poll created through the same bot overwrote the title and the vote text with those of the other poll. That meant they could modify other people's messages, and even messages of channels that used the bot, replacing them with a custom message.
LikeBot
LikeBot had a very similar situation. Here the id had to be replaced with the id of a vote that had the same number of buttons, and only the text of the buttons changed, not the text of the message itself.
Why it worked
The bot receives a value that the client controls. If the bot acts on that value without checking it against what it originally sent, an attacker can make it act on a different object. The documentation warned about arbitrary data, but the official bots did not check it, probably because the value was treated as something only the bot could produce.
The fix
Telegram acknowledged the problem and fixed it. Users can no longer send arbitrary text through messages.getBotCallbackAnswer. If the data does not match the name of an existing button, the method now returns the error 400 DATA_INVALID.
Bug 2: XSS on telegram.org
What the feature does
Andrea and Davide noticed that the Telegram app could play videos directly from a site preview. They explored t.me, the site that offers a widget showing a preview of posts from public channels. That widget can embed a video player, in the same way a YouTube video can be embedded in a page.
How they tested it
They set out to create a site with a working video player. The code they used was in two files, index.php and player.php. The report does not reproduce their contents.
They created a public Telegram channel and posted the link https://website/test/index.php so that Telegram would generate a preview of it. The site accepted the video player without any hassle. Then they visited the t.me page that pointed to their post, and an alert box appeared. An alert box is the small pop-up a browser shows when JavaScript calls alert(), so seeing one proved their code had run inside the Telegram page.
What the impact was
The cookies of the original page could not be read, because the player was inside an iframe and the browser keeps the inner page separate from the outer one. Even so, it was possible to create alerts, perform open redirects (sending the visitor to another site), or run anything else JavaScript could execute. The same problem occurred on telegram.org, since the two sites were identical, and on all sites that allowed Telegram widgets, such as Telegra.ph.
Why it worked
The preview accepted an embedded video player from an arbitrary domain, so a page on an attacker-controlled site could run JavaScript inside the widget. The iframe limited the damage to the widget's own origin rather than the main page's cookies.
The fix
They reported the problem to Telegram, which confirmed it and fixed it by allowing embedded videos only from trusted domains such as youtube.com and twitter.com.
Bug 3: profile pictures visible to everyone
What the feature does
Every time a new Beta version of Telegram is released, Davide looks through it. One release added the option to change the privacy of your profile picture, making it visible only to your contacts.
How they found it
In his Telegram bot, Davide used an endpoint to fetch profile pictures: https://t.me/i/userpic/320/USERNAME.jpg. An endpoint is simply a web address that returns data rather than a page. He had found this one in the documentation for Telegram's Login Widget.
He noticed straight away that this endpoint returned the profile pictures of users who had set their privacy to contacts only. He chose to wait until the Beta ended before reporting, to avoid reporting something that was still a work in progress and not yet official. After the official March release, the issue was still there, so he reported it.
Why it worked
The endpoint had no authorisation check. It served the picture regardless of the user's privacy setting, so anyone who knew a username could fetch the picture.
The fix
Telegram confirmed the issue. The endpoint now respects the user's privacy settings: the picture is not viewable unless it is public.
Bug 4: crashing the apps with animated stickers
What the feature does
The July 2019 update introduced animated stickers. According to the documentation, they use Lottie. Looking at the app sources, Giuseppe found that an animated sticker is a compressed JSON file, compressed with gzip. If you extract a TGS file (the file format for animated stickers), you get a JSON containing the vector information, the layers of the animation, and other data such as the frame rate and resolution.
How they tested it
Giuseppe built a bot, t.me/jsontgsbot, to speed up testing. Feed it the right JSON and it produces an animated sticker; give it a sticker and it returns the equivalent JSON. It is a translator between the two formats.
They first tried zip bombs, files that expand enormously when decompressed, but to no avail: the size cannot exceed 64KB compressed, and the JSON must be valid for the client to accept it. So they manipulated the JSON instead, changing frames, removing, adding and duplicating parameters, and generating invalid JSON in every way they could think of. At first nothing happened, but after a few attempts clients sometimes crashed.
For example, removing almost all the parameters, such as the frame rate and all the layers, made the Android client go into error and crash. Setting the frame rate to 0 crashed the desktop client, which tried to divide by 0. Other values crashed the desktop client with a SIGSEGV error. The next day they found another crash, after additional server-side controls had been put in place.
First report
Davide reported that the Android client and the desktop client crashed. The problem was confirmed and fixed on both the client and server side by blocking the upload of invalid stickers. Invalid stickers now have the mime type application/x-bad-tgsticker instead of application/x-tgsticker and are simply displayed as files.
Crash again
A month later, Davide was scrolling through an old chat full of stickers he had tested and saw a crash. This time he was on Telegram X, the other official Android client. Finding which sticker caused the crash among many was complicated, because the app kept crashing. Using the Desktop client he located it: it was one of the stickers he had reported earlier. Reloading it, the server no longer accepted it, but he had uploaded it before the server-side block was in place, so forwarding it still made it viewable as a sticker. He asked a friend with iOS to check, and his client crashed too.
Second report
With an old sticker, two official clients crashed. Telegram confirmed the problem and fixed it by patching the clients.
Crash again x2
A few months later, revisiting an old chat with stickers, crashes appeared again with the following stickers: Android stock and Android tgx; Android stock and Android tgx; Android tgx; and a tgx crash log. The report lists these as captions without reproducing the files.
Third report
For some reason the bug had been reintroduced. Davide reported the crash again, Telegram confirmed it again, and the clients were patched.
Why it worked
The clients crashed on malformed JSON: removing required parameters, setting the frame rate to 0, or other invalid values. Removing required parameters, setting the frame rate to 0, or other malformed values led to errors, division by zero and SIGSEGV. Server-side validation was added, but stickers uploaded before the block remained viewable when forwarded, and later the bug came back.
Bug 5: permissions on bugs.telegram.org
What the feature does
Telegram had recently launched a platform for suggestions and bug reports. Users write posts, and below every post there is a comment section where you can leave a like or subscribe to a discussion and receive notifications in the app. At the time of testing it was not yet possible to open posts; only comments were allowed. Comments mentioned that in future it would be possible to open private posts to report security problems.
How they found it
By exploring the requests the browser made, Davide observed the endpoint and parameters used by the site's API. He looked at post IDs such as https://bugs.telegram.org/c/123 and noticed that some posts, instead of returning the usual error Sorry, this card doesn't exist., returned You can not view this card. That difference suggested that some posts existed but were not accessible to him.
Step 1: try to comment
He tried to write a comment to a post through the API, but the server blocked him, saying he was not authorised. So far, so good.
Step 2: like a post you cannot see
He then tried leaving a like on a post he had no authorisation for, and this time the API let him through. Through the API responses he could also see the number of likes and dislikes. Not very useful by itself, but it motivated him to search for more.
Step 3: subscribe to a post you cannot see
The next step was a request to subscribe to a post, where the hash value is used as if it were a session cookie. The API responded positively and the subscription was created. This would have delivered notifications for future comments directly to the Telegram app. He could not verify that, because he did not have permission to comment.
Step 4: read comments of private posts
In posts with many comments there was an API request to load more comments. He changed the ID and loaded comments. This let him read comments of private posts, potentially leaking part of the security reports made through the platform. Since the platform was newly released, there were only comments written by the developers, so nothing important was leaked.
Why it worked
Commenting was blocked, but liking, subscribing and loading comments were not checked against the same permission. The object ID alone was enough to act on a post you could not see.
The fix
Because of the high risk of information leakage, Davide reported the problem. Telegram confirmed it and fixed it during the winter holidays. The website's APIs no longer allow access without authorisation.
What you can take away
Each of these bugs is a version of the same question: does the server check that you are allowed to do what you are asking? The button press, the profile picture and the bug-reporting site all trusted something the client sent. The XSS trusted a domain the client chose. When you build or test something, ask who controls each value and whether the server checks it.
If you want to try similar tests yourself, the researchers suggest using the libraries MadelineProto, Telethon, Pyrogram and TDLib for MTProto work, and reading each library's documentation rather than the official method documentation, which is less up to date.
Glossary
- API: the set of requests a program offers to other programs, like a menu in a restaurant.
- Authorisation: the check that you are allowed to do something, as opposed to authentication, which is the check of who you are.
- Bot: a Telegram account run by a program rather than a person.
- Bot API: the simpler interface Telegram offers to bots, separate from the MTProto API used by the official apps.
- callback_data: the value a bot receives when a user presses an inline button.
- Cookie: a small piece of data a site stores in your browser to recognise you on later requests.
- Crash: a program stopping unexpectedly because it hit something it could not handle.
- Endpoint: a web address that returns data rather than a page.
- Frame rate: the number of frames per second in an animation.
- Fuzzing: feeding a program lots of strange or broken input to see whether it breaks.
- gzip: a way of compressing data so it takes less space.
- Hash: a short value derived from data, often used as an identifier or a secret; here it was used as if it were a session cookie.
- iframe: a window inside a web page that shows another page, kept separate from the outer page.
- Inline button: a button attached to a message whose displayed text can differ from the value the bot receives.
- JSON: a text format for structured data, made of names and values.
- Lottie: the animation format Telegram's animated stickers are based on.
- Mime type: a label that says what kind of file something is, such as
application/x-tgsticker. - MTProto: the protocol Telegram's own apps use to talk to Telegram's servers.
- Open redirect: a link that sends the visitor to another site chosen by the attacker.
- SIGSEGV: a crash where a program tries to read or write memory it is not allowed to touch.
- SQL injection: sending database commands through a field the developer expected to be plain text.
- TGS: the file format for Telegram animated stickers, a gzipped JSON file.
- Token: a secret string that proves who you are, like a wristband at a festival.
- XSS (cross-site scripting): getting your own JavaScript to run inside someone else's web page.
- Zip bomb: a file that expands enormously when decompressed.