bad error trapping could cause unexpected shell commands
Posted: 2011-12-26T08:06:07-07:00
Hi,
through struggling with IM syntax I make frequent errors. Several of these has pointed out what looks like it could be an exploit.
It seems the parser is giving up and exiting before having even finished reading the input.
The net result is that the rest of the command line , that was intended for IM get read AND EXECUTED by the shell.
Thus an incorrectly formatted IM command could cause the execution of arbitrary (of malicious) shell commands.
I would suggest the correct behaviour would be to read to the end of input before attempting to parse the command.
regards.
through struggling with IM syntax I make frequent errors. Several of these has pointed out what looks like it could be an exploit.
Code: Select all
convert -size $((5*$wid))x$((5*$ht)) xc: -tile (-extract 50%x25%+25%+5% tile.png)\
-draw "rectangle 0,0 $((5*$wid)),$((5*$ht))" \
output-tile.png
The net result is that the rest of the command line , that was intended for IM get read AND EXECUTED by the shell.
Code: Select all
$ -draw "rectangle 0,0 $((5*$wid)),$((5*$ht))" \
> output-tile.png
bash: -draw: command not found
I would suggest the correct behaviour would be to read to the end of input before attempting to parse the command.
regards.