in reply to Untainting 'bad' filenames
Just be certain you only use $untainted in a "secure" way. I suspect a rename call is fine, but don't think of using it in, say, system.($untainted) = $file =~ /^(.*)$/s;
The example you used ($filename=~/^(.+)$/; $file=$1;) breaks if there's a newline in the filename and if it doesn't successfully match the filename, you could be setting $file to something you do not expect (since an unsuccessful match leaves $1 to what it was set to before). Taint-checking probably wouldn't pick up on this mistake.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Untainting 'bad' filenames
by doran (Deacon) on Dec 08, 2000 at 12:20 UTC | |
by chipmunk (Parson) on Dec 08, 2000 at 20:13 UTC |