in reply to Common untainting methods?
When Perl gurus are asked "how do I untaint stuff", they generally answer with "it depends".Well, it doesn't "depend". There is only one (correct) way to untaint data, and that is by matching it.
What you allow to match is the part that "depends" (it's called data validation).my $tainted = $ENV{PATH}; my $untainted = $1 if $tainted =~ /^(.*)$/;
In your case, it doesn't look like you need to validate data at all (you may need to escape it if you're gonna display it via html, but you should allow the user to enter everything).
PS - on a sidenote, you can untain values like
but you cannot rely on that behaviour.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Common untainting methods?
by sgifford (Prior) on Nov 26, 2003 at 06:39 UTC | |
by Anonymous Monk on Nov 26, 2003 at 17:06 UTC |