water has asked for the wisdom of the Perl Monks concerning the following question:
I know you should always use taint when taking data in from a web app, because somewhere down the road that data or data derived from that data might go into a database or a shell script or backticks or something dangerous. Right.
Question (more theory than practice): if you are 100% certain some data from a cgi arg is never going anywhere dangerous, does untainting really do anything? Say you take a value from a scipt, 'action', and the code does one of three actions based on the value, and has a fallthru 'unknown action attempt' mode. (And the actions are explicit and hardcoded, not &{$action}(@args) insanity, so hacking the form doesn't do anything but get you an unknown mode error.)
I'm sure the right answer is use taint nonetheless -- healthy paranoia -- but I am wondering.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: taint theory question
by tilly (Archbishop) on Jul 02, 2004 at 13:09 UTC | |
|
Re: taint theory question
by kiat (Vicar) on Jul 02, 2004 at 11:50 UTC | |
|
Re: taint theory question
by husker (Chaplain) on Jul 02, 2004 at 14:06 UTC |