Most invocations of zip are likely to be vulnerable, as it doesn’t support the end-of-options switch before the archive name.
It can be used to break out from restricted environments by running non-interactive system commands.
This vector relies on the integrity test feature (-T
) with an arbitrary
command (-TT
). To chain both short names, a dummy option is added (-m
).
When injecting during the archive creation process, two positional arguments
are required: the destination and a file to compress.
zip '-TmTT="$(id>/tmp/foo)foooo".zip' './a.zip' './a.txt'