diff --git a/README.html b/README.html index c8f5e59..de61564 100644 --- a/README.html +++ b/README.html @@ -340,7 +340,7 @@ It features background tasks and interactive chats, and can serve as an interfac

Running a Telegram Bot means it is connected to the public and you never know what's send to your Bot.

Bash scripts in general are not designed to be bullet proof, so consider this Bot as a proof of concept. Bash programmers often struggle with 'quoting hell' and globbing, see Implications of wrong quoting

Whenever you are processing input from untrusted sources (messages, files, network) you must be as careful as possible, e.g. set IFS appropriate, disable globbing (set -f) and quote everything. In addition remove unused scripts and examples from your Bot, e.g. everything in example/ and disable/remove all not needed bot commands.

-

It's important to escape or remove $ in input from user, files or network (as bashbot does) One of the powerful features of unix shells are variable and command substitution using ${} and$(), this can lead to remove code execution (RCE) or information disclosing bugs if unescaped $ is included in untrusted input, e.g. $$ or $(rm -rf /*)

+

It's important to escape or remove $ in input from user, files or network (as bashbot does) One of the powerful features of unix shells are variable and command substitution using ${} and$(), this can lead to remote code execution (RCE) or remote information disclosure (RID) bugs if unescaped $ is included in untrusted input, e.g. $$ or $(rm -rf /*)

A powerful tool to improve your scripts is shellcheck. You can use it online or install shellcheck locally. Shellcheck is used extensively in bashbot development to ensure a high code quality, e.g. it's not allowed to push changes without passing all shellcheck tests. In addition bashbot has a test suite to check if important functionality is working as expected.

Use printf whenever possible

If you're writing a script and it is taking external input (from the user as arguments or file system...), you shouldn't use echo to display it. Use printf whenever possible

@@ -390,6 +390,6 @@ It features background tasks and interactive chats, and can serve as an interfac

@Gnadelwartz

That's it all guys!

If you feel that there's something missing or if you found a bug, feel free to submit a pull request!

-

$$VERSION$$ v1.21-dev-33-gd083390

+

$$VERSION$$ v1.21-dev-34-ga5307e3

diff --git a/README.txt b/README.txt index ebd8979..bdb7a11 100644 --- a/README.txt +++ b/README.txt @@ -185,8 +185,9 @@ It's important to escape or remove `$` in input from user, files or network (_as bashbot does_) One of the powerful features of unix shells are variable and command substitution using `${}` and`$()`, -this can lead to remove code execution (RCE) or information disclosing bugs if -unescaped `$` is included in untrusted input, e.g. `$$` or `$(rm -rf /*)` +this can lead to remote code execution (RCE) or remote information disclosure +(RID) bugs if unescaped `$` is included in untrusted input, e.g. `$$` or `$(rm +-rf /*)` A powerful tool to improve your scripts is `shellcheck`. You can [use it online](https://www.shellcheck.net/) or @@ -319,4 +320,4 @@ See `mycommnds.sh.dist` for an example. If you feel that there's something missing or if you found a bug, feel free to submit a pull request! -#### $$VERSION$$ v1.21-dev-33-gd083390 +#### $$VERSION$$ v1.21-dev-34-ga5307e3 diff --git a/bashbot.sh b/bashbot.sh index d4faf49..275a067 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -26,7 +26,7 @@ # 8 - curl/wget missing # 10 - not bash! # -#### $$VERSION$$ v1.21-dev-27-gd0f8716 +#### $$VERSION$$ v1.21-dev-36-gc6001c2 ################################################################## # shellcheck disable=SC2140,SC2031,SC2120,SC1091,SC1117,SC2059 @@ -1120,15 +1120,6 @@ bot_init() { [ -r "${addons}" ] && source "${addons}" "init" "${DEBUG}" done printf "Done.\n" - if [[ ! -d "logs" ]]; then - printf "Move Logfiles ...\n" - mkdir logs 2>/dev/null - for MVLOG in DEBUG.log MESSAGE.log ERROR.log BASHBOT.log - do - [ -f "${MVLOG}" ] && mv "${MVLOG}" logs 2>/dev/null - done - printf "Done.\n" - fi # setup bashbot [[ "${UID}" -eq "0" ]] && RUNUSER="nobody" printf "Enter User to run bashbot [$RUNUSER]: " diff --git a/dev/make-distribution.sh b/dev/make-distribution.sh index 6acb574..1632236 100755 --- a/dev/make-distribution.sh +++ b/dev/make-distribution.sh @@ -7,7 +7,7 @@ # # Options: --notest - skip tests # -#### $$VERSION$$ v1.21-dev-35-g7ecb836 +#### $$VERSION$$ v1.21-dev-36-gc6001c2 ############################################################## # magic to ensure that we're always inside the root of our application,