shenme has asked for the wisdom of the Perl Monks concerning the following question:
As I processed CGI forms I would validate and untaint data items, and then accumulate them in my session hash. Later in other CGI invocations I'd try to use those bits of information and blow up with taint errors.
After putting in some debug displays I realized I was simply hitting the taint mode restriction on input data - anything read from a data file is tainted. (My CGI::Session options were 'driver:File;serializer:Storable' and so session data is stored in files)
I'm really puzzled as I can't find previous mentions of this issue, and can't believe the combination of CGI::Session session files and taint mode hasn't been done. I mean, gosh, doesn't everybody use taint mode?
Has anybody dealt with this problem? That is, somehow untainting the session data string read from a file (or database record for that matter), before CGI::Session then uses thaw() to recreate the session hash?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::Session, taint mode, and tainted session file input data
by emazep (Priest) on Apr 25, 2005 at 09:51 UTC | |
|
Re: CGI::Session, taint mode, and tainted session file input data
by tlm (Prior) on Apr 25, 2005 at 02:19 UTC | |
by shenme (Priest) on Apr 25, 2005 at 02:31 UTC | |
by tlm (Prior) on Apr 25, 2005 at 03:03 UTC |