in reply to Re^2: Insecure dependency in system under -T, with list form invocation
in thread Insecure dependency in system under -T, with list form invocation
The part you need is this:
# allow alphanumerics, period, hyphen, ampersand if ($data =~ /^([-\@\w.]+)$/) { # $data is tainted $data = $1; # $data now untainted } else { die "Bad data in '$data'"; # log this somewhere }
The regex alone will NOT untaint the data - you must copy it through a capture variable, like $1, to untaint it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Insecure dependency in system under -T, with list form invocation
by cramdorgi (Acolyte) on Sep 11, 2008 at 14:25 UTC | |
by mr_mischief (Monsignor) on Sep 11, 2008 at 16:00 UTC | |
by cramdorgi (Acolyte) on Sep 12, 2008 at 08:24 UTC | |
by mr_mischief (Monsignor) on Sep 12, 2008 at 15:01 UTC |