Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^6: Any security holes?

by hippo (Bishop)
on Jun 28, 2022 at 08:45 UTC ( [id://11145128]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Any security holes?
in thread Any security holes?

I also tried using -T (taint) after the shebang line but then I just get 500 Internal error - any idea why?

Your script attempts to write tainted data to the filesystem. Running in taint mode protects you from doing this which is a very good reason to run in taint mode. See your web server's error log for more detail.

Update: As in the replies, there is no reason why your script as posted would not run under taint mode. I too have just tried it and it works fine.


🦛

Replies are listed 'Best First'.
Re^7: Any security holes?
by haj (Vicar) on Jun 28, 2022 at 13:43 UTC
    Your script attempts to write tainted data to the filesystem. Running in taint mode protects you from doing this ...

    This is not how taint mode works. You can write tainted data to the file system just fine. It is passing tainted data to the OS (via the file system, starting processes and the like) where taint mode kicks in.

    A frequent path to taint failures is whenever environment variables like e.g. $ENV{HOME} or $ENV{TMP} are used by Perl modules. This may also differ between platforms. For example, my current Linux desktops don't even have $ENV{TMP} defined, whereas on Windows it is usually set.

Re^7: Any security holes?
by ikegami (Patriarch) on Jun 28, 2022 at 13:25 UTC

    Running in taint mode protects you from doing this

    No it doesn't.

    Taint prevents code execution. While writing to disk could eventually lead to it getting executed, it's too far removed for taint purposes.

    The posted program runs fine in taint mode.

      The posted program runs fine in taint mode.

      Ah yes, you are quite right. I should have known better than to trust the assertion that it did not.


      🦛

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11145128]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-19 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found