Insecure dependency in open while running with -T switch

K

kskkaf

In an upload subroutine I have the following code:

open (OUTFILE, "> $root/$docfolder/$fpage") or die "Can't open output
file for write: $!";

But the error message as show in the title keeps coming up. Now that I
insist keeping the -T switch, how can I avoid the error message? Thanks
for any clue.
 
P

Paul Lalli

kskkaf said:
Subject: Insecure dependency in open while running with -T switch
In an upload subroutine I have the following code:

open (OUTFILE, "> $root/$docfolder/$fpage") or die "Can't open output
file for write: $!";

But the error message as show in the title keeps coming up. Now that I
insist keeping the -T switch, how can I avoid the error message? Thanks
for any clue.

It's telling you that one or more of $root, $docfolder, or $fpage are
tainted. That is, they came from user input or another insecure method.
You must untaint this data before using it to open a file. Untainting means
to verify, via regular expressions, that the data is what it's allowed to
be. Read
perldoc perlsec
for more information and examples.

Paul Lalli
 
K

kskkaf

Paul said:
It's telling you that one or more of $root, $docfolder, or $fpage are
tainted. That is, they came from user input or another insecure method.
You must untaint this data before using it to open a file. Untainting means
to verify, via regular expressions, that the data is what it's allowed to
be. Read
perldoc perlsec
for more information and examples.

Paul Lalli
Thanks Paul!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top