srdst13 has asked for the wisdom of the Perl Monks concerning the following question:
I have an old application that I have recently resurrected. The application is CGI::Application based. After our security team scanned the app, a single parameter was noted to be problematic. If the runmode parameter is specified as a non-existing runmode, then the application generates a run-time error and dumps the error--not a problem except if the runmode parameter was specified to have malicious javascript or something else like that. That code is also dumped as part of the error. I have tried to use the error_mode specification to return a custom error page, but it appears that the header that is sent specifies the content-type as "httpd/unix-directory" despite my setting the content-type in my setup subroutine:
$self->query->content_type('text/html');
I am running this all as a mod_perl 2 handler under apache and I have taint checking on. What am I missing here?
The safest thing to do here is probably to url-escape or otherwise scrub the parameters coming in, but I haven't figured out a convenient way to do that in the CGI::Application framework. Is there a standard way of doing this type of thing?
Thanks,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XSS protection in CGI::Application
by skx (Parson) on Mar 02, 2010 at 19:30 UTC | |
by srdst13 (Pilgrim) on Mar 02, 2010 at 19:54 UTC | |
|
Re: XSS protection in CGI::Application
by jaldhar (Vicar) on Mar 02, 2010 at 20:04 UTC | |
|
Re: XSS protection in CGI::Application
by Anonymous Monk on Mar 03, 2010 at 00:27 UTC |