#perl - Wed 28 Mar 2007 between 15:54 and 16:03



Ani-_$ENV{PATH} (or %ENV in general) comes from the outside and is therefor tainted.
gnubeHere it is: /home/jeremiah/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games
pretty straightforward it would seem to me. Is it because I am passing a file from /tmp?
Ani-_gnube: perhaps I should explain myself better...
ailtonI have a $var1 set to "hello" and a $var2 set to pal, I wanna do a little regexp check on those vars and se if they match the regexp. I think it should be done something like this: if ($var1 + $var2 == ^hello\spal$) { print.. <-- any ideas?
Ani-_gnube: if you do not set $ENV{PATH} in your script then it should not be trusted (= it is tainted).
xandailton: why check something you know? and you use . to join strings, not +
Ani-_gnube: something that tries to trust it (File::Copy in this case) will give you that Insecure dependecny error.
gnubeAni-_ Ah! I see. So I should explicitly declare it before hand?
xandand to match regexes it's =~ not ==
Ani-_gnube: try: perl -Te 'system("ls");' # ==> it won't work.
gnube: exactly.
ailtonxand: well it's not always set to that.. it was an example
gnubeWow. Impressive security when you think about it.
ailtonxad: if ($var1 . $var2 == ^hello\spal$) {
xandno
ailtonwill it even work to use regexp like that? in an if statement?
xandnot like that
Ani-_*Everything* that is not set in your script is tainted. (that means, %ENV, input, ...)
gnubeAni-_: So are there other vars I need to watch out for or just the . . .
xandif($var1 . $var2 =~ /regex/){
gnubeahmad`, that was what I was going to ask
Ani-_, Is it enough to just declare the hash like this - my %ENV?
Ani-_gnube: perldoc perlsec # look at 'Cleaning Up Your Path'
gnubeAni-_, Ok, I have perlsec open now so I will read a little
Ani-_gnube: no. my %ENV will create a new lexical hash %ENV. It will leave intact the global %ENV.
DavemanHello gentlemen
xandHello cavemen
gnubeAni-_, Oh okay. Found the PATH info in perlsec, thanks for the pointer.
Davemanxand ^_^
ailtonxand, vill it match hello dude or hellodude ?
wil*
Ani-_Google--
xandtry it and see
Daveman:|
ailtonwill $var1 . $var2 be hellopal or hello pal ?
I want a space beween them
xand"fish" . "cake" = "fishcake"
ailtonbetween
Ani-_$var1 . $var2 will not add a spae in between.

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 100 107 114 121 

IrcArchive