Gryphaan has asked for the wisdom of the Perl Monks concerning the following question:
Thanks in advance@special = ("body", "subject", "link_url", "pid"); foreach $field (keys %form_data) { # specific fields that can have additional characters if($field eq "body" || $field eq "subject" || $field eq "link_url" || $field eq "pid") { # were looking for specific hacker tricks here foreach (@special) { $form_data{$_} =~ s/system\(.+//g; $form_data{$_} =~ s/grep//g; $form_data{$_} =~ s/\srm\s//g; $form_data{$_} =~ s/\srf\s//g; $form_data{$_} =~ s/\.\.([\/\:]|$)//g; $form_data{$_} =~ s/< *((SCRIPT)|(APPLET)|(EMBED))[^>]+>// +ig; } # all other fields get sifted here } elsif($form_data{$field} ne "") { unless ($form_data{$field} =~ /^([-\@\w.\s]+)$/) { # exit handler here } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Opinions needed on CGI security
by merlyn (Sage) on Feb 14, 2001 at 06:37 UTC | |
|
Re: Opinions needed on CGI security
by Trimbach (Curate) on Feb 14, 2001 at 08:14 UTC | |
by tilly (Archbishop) on Feb 14, 2001 at 08:23 UTC | |
by Trimbach (Curate) on Feb 14, 2001 at 08:50 UTC | |
by AgentM (Curate) on Feb 14, 2001 at 09:56 UTC | |
by tilly (Archbishop) on Feb 14, 2001 at 17:17 UTC | |
by baku (Scribe) on Feb 14, 2001 at 19:33 UTC | |
by MeowChow (Vicar) on Feb 14, 2001 at 09:37 UTC | |
by Gryphaan (Beadle) on Feb 14, 2001 at 17:42 UTC | |
|
Re: Opinions needed on CGI security
by arturo (Vicar) on Feb 14, 2001 at 19:03 UTC |