Skip to content

make callbackquery safe #709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
91DarioDev opened this issue Jul 5, 2017 · 6 comments · Fixed by #1844
Closed

make callbackquery safe #709

91DarioDev opened this issue Jul 5, 2017 · 6 comments · Fixed by #1844

Comments

@91DarioDev
Copy link

91DarioDev commented Jul 5, 2017

botogram implemented a safe way to handle callback queries as you can read in the documentation (https://botogram.pietroalbini.org/docs/dev/buttons/#buttons-security)

the problem is that the callback_data is not sent by telegram, but the clients. So if a bot is admin of a group and it lets ban spamming users with buttons and the callback_data containts parameters (for example ban_user:123456789) a maliciuos client could change the parameter (for example ban_user:987654321) despite the text of the callback could be the same

@jsmnbom
Copy link
Member

jsmnbom commented Jul 5, 2017

For most uses, this kind of security doesn't really matter, since callback queries generally don't handle things that need to be secured, and in some cases the hash will be annoying for the developer more than anything since it uses up some of the 64 bytes that callback_data is allowed to consist of (in fact it seems that due to how botogram handles callback_data you're limited to only 32 bytes).

Therefore if we do decide to implement this (PRs are always welcome!), it should be 100% optional.

@tsnoam
Copy link
Member

tsnoam commented Jul 28, 2017

A similar subject was previously discussed by the developers. In general, what should be sent over the callback_data should be a secure key (UUID is a good example) which, similarly to a cookie, when received by the bot will be mapped to actual data.

@jsmnbom
Copy link
Member

jsmnbom commented Jul 29, 2017

It would be nice to provide the user with tools to do this simply

@JosXa
Copy link
Contributor

JosXa commented Feb 1, 2018

@Bibo-Joshi Bibo-Joshi mentioned this issue Apr 9, 2020
6 tasks
@skrtdev
Copy link

skrtdev commented Apr 28, 2021

This can be safely closed, as this is not an issue anymore

@Bibo-Joshi
Copy link
Member

While callback_data is in fact checked by TG, they don't want us to rely on it (made the effort to ask @botsupport about that). Also #1844 is on the roadmap anyway, which will close this ;)

@github-actions github-actions bot locked and limited conversation to collaborators Jun 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants