Security alert:
Patches:
--- TWiki.pm (revision 28488)
+++ TWiki.pm (working copy)
@@ -4803,7 +4803,10 @@
sub QUERYSTRING {
my $this = shift;
- return $this->{request}->queryString();
+ my $qs = $this->{request}->queryString();
+ # Item7595: Sanitize QUERYSTRING
+ $qs =~ s/(['\/<>])/'%'.sprintf('%02x', ord($1))/ge;
+ return $qs;
}
sub QUERYPARAMS {
--- TWiki/UI/View.pm (revision 28488)
+++ TWiki/UI/View.pm (working copy)
@@ -349,8 +349,14 @@
next if ($name eq 'topic');
push @qparams, $name => $query->param($name);
}
- $tmpl =~ s/%QUERYPARAMSTRING%/TWiki::_make_params(1,@qparams)/geo;
+ if ( $tmpl =~ /%QUERYPARAMSTRING%/ ) {
+ my $qs = TWiki::_make_params( 1, @qparams );
+ # Item7595: Sanitize QUERYPARAMSTRING
+ $qs =~ s/(['\/<>])/'%'.sprintf('%02x', ord($1))/ge;
+ $tmpl =~ s/%QUERYPARAMSTRING%/$qs/go;
+ }
+
# extract header and footer from the template, if there is a
# %TEXT% tag marking the split point. The topic text is inserted
# in place of the %TEXT% tag. The text before this tag is inserted
--
TWiki:Main/PeterThoeny
- 2014-12-09