diff --git a/C4/Auth.pm b/C4/Auth.pm index 164092d01e..23311f0083 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -139,6 +139,9 @@ sub get_template_and_user { my $in = shift; my ( $user, $cookie, $sessionID, $flags ); + my $safe_chars = 'a-zA-Z_\-\/'; + die "bad template path" unless $in->{'template_name'} =~ m/^[$safe_chars]+.tt?$/ig; #sanitize input + $in->{'authnotrequired'} ||= 0; my $template = C4::Templates::gettemplate( $in->{'template_name'},