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 |

  open (my $ FH, "some / random / dir / file-" $ user_text)  

is completely weak, it is impossible to unzip the inappropriate injection this name

  a file called some / random / dir / file-foo.  

This can be used to execute arbitrary commands

  $ perl -e'open (my $ FH, "file -". $ ARGV [0]) ''; Echo 0wned & gt; And 2 'Sh: 1: file-: not found 0wned  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -