Some surprising code execution sources in bash
I ran across two surprising sources of code execution in bash (and probably
other shells) recently.
In a historic context these probably weren't too
serious of a problem, but in the context of CI systems where everything is
a rats' nest of shell and YAML they could be useful execution primitives.
Source 1: arithmetic expressions (a.k.a. "white-collar eval")
Leading question aside, do you think this snippet of bash1 can run
arbitrary code?
function guess() {
num="${1}"
if [[ "${num}" -eq 42 ]]
th...
Read more at yossarian.net