security - perl open() injection prevention -
I read that open () command with 2 arguments is weak for injection, while 3 arguments I is not injection-enabled
I have a directory where all my files have a normal prefix, that is, "file-" therefore an example file name would be, file-SomeSourceCode.txt
How < $ fileextension
can be of any kind, which can be of any type.
The name of the file name 'I say, it will not be vulnerable to a file name such as is completely weak, it is impossible to unzip the inappropriate injection this name This can be used to execute arbitrary commands |
open (my $ FH, "some / random / dir / file-" $ user_text)
a file called some / random / dir / file-foo.
$ perl -e'open (my $ FH, "file -". $ ARGV [0]) ''; Echo 0wned & gt; And 2 'Sh: 1: file-: not found 0wned
Comments
Post a Comment