J-Rios / TLG_JoinCaptchaBot

Telegram Bot to verify if users joining a group are human. The Bot sends an image captcha for each new user and kicks any of them who can't solve the captcha in a specified time.
GNU General Public License v3.0
532 stars 218 forks source link

[Bug] Math captcha solved without equation result! #163

Closed J-Rios closed 2 years ago

J-Rios commented 2 years ago

Issue

Seems that an user could solve the math captcha by writting the math equation instead the result.

imagen

imagen

Reason

Once a message from a user that is solving a captcha is received, for both captcha mode "nums" or "math", Bot code first check if the message content has the number to solve, in the previous issue example, the expected solve number in this case is "8" and the user writes "56-48", containing a "8" on it, so it solves the captcha instead handle it like a "math" mode.

Bug located on code line: https://github.com/J-Rios/TLG_JoinCaptchaBot/blob/520381ac46aa60a462c9f35801212e30dd91bd45/sources/join_captcha_bot.py#L1126

J-Rios commented 2 years ago

Issue solved by: https://github.com/J-Rios/TLG_JoinCaptchaBot/commit/c72bd2311d20bf13069f32dd9a8c08672caadac5

Closing.