in reply to Putting HTML fieldnames in symbol space
For safety's sake it doesn't let you import into the main namespace. It is not safe to import into the main namespace (or other namespace that you don't reserve for just storing CGI params) because a cracker could overwrite any of your variables. Consider what would happen with the code I put below if a hacker "submitted" to the form with (the CGI formatted version of ) "cmd=rm -f /*". Where you weren't expecting cmd to be passed as a CGI param.my $query=new CGI(); $query->import_names('C'); print "C - $C::foo";
Kind of a silly example but it does demonstrate the veunerability of arbitrarily importing CGI parameters into the main namespace.my $cmd="ls"; foreach $key (CGI::param()) { ${$key} = CGI::param($key) } system $cmd;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Putting HTML fieldnames in symbol space
by btrott (Parson) on May 27, 2000 at 03:12 UTC | |
|
RE: Re: Putting HTML fieldnames in symbol space
by Russ (Deacon) on May 27, 2000 at 03:05 UTC |