-
Notifications
You must be signed in to change notification settings - Fork 124
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
Vulnerability in all telegram-bot-bash Versions up to 0.94, *UPDATE NOW* #125
Comments
PLS check if your fork of telegram-bot-bash is also vulnerable ... Notify all forks: |
More information at topkecleon#125
hopefully everyone mentioned fixed the bug ... |
fixed for new v1.40 feature webhook in V1.41 also |
All versions up to 0.94 are vulnerable by a shell variable expansion bug, allowing remote code execution as the user running telegram-bot-bash
The bug is fixed in Release 0.941 and 0.96-dev-8, pls UPDATE NOW
Workaround
In case you cannot update, e.g. you modified bashbot.sh or rely on a feature not working in current releases, apply the following modification to your
bashbot.sh
file:Description
We did not follow the most important rule for programming: Do not trust external or user input!
Even we does extensive testing, quoting and disable globbing, we forgot to protect Input for the most powerful, but also dangerous feature of a shell: Variable and command expansion!
Solution
Escape every
$
in Telegram updates, not only in user input but also in everything received from telegram.From first tests this will not break telegram-bot-bash functionality, but may require adaptions if you test for existence of
$
in a telegram message.Test
to test if your bot is affected send him command containing
$$
and echo the message:The text was updated successfully, but these errors were encountered: