I have read that the open() command with 2 arguments is vulnerable to injection whereas the open() command with 3 arguments isn't inject-able.
SAy I have a directory where all my files have a common prefix, i.e "file-" so an example filename would be, file-SomeSourceCode.txt
How would something like open(FILEHANDLE, "some/random/dir/file-" . $fileextension)
be vulnerable?
where $fileextension
could be any sort of 'filename' per say. As far as I understand, this would not be vulnerable to a filename like | shutdown -r |
which would execute the command to the server.
open
. Are you concerned about the safety of some old code that you're not able to update?open
. Why bother trying to mitigate this risk, when you don't need to take it in the first place.