--
TWiki:Main/PeterThoeny
- 2018-01-01
Patch:
Index: lib/TWiki/Attach.pm
===================================================================
--- lib/TWiki/Attach.pm (revision 30559)
+++ lib/TWiki/Attach.pm (working copy)
@@ -217,6 +217,8 @@
my $comment = $info->{comment};
if ( $comment) {
$comment =~ s/\|/|/g;
+ $comment =~ s/</</g;
+ $comment =~ s/>/>/g;
} else {
$comment = " ";
}
Index: lib/TWiki/UI/Upload.pm
===================================================================
--- lib/TWiki/UI/Upload.pm (revision 30559)
+++ lib/TWiki/UI/Upload.pm (working copy)
@@ -223,6 +223,7 @@
my $updateField = $query->param('updatefield') || '';
my $updateFormat = $query->param('updateformat') || '';
+ $fileComment =~ s/[<>]//gos; # Item7833: Filter out < and > to block XSS
$fileComment =~ s/\s+/ /go;
$fileComment =~ s/^\s*//o;
$fileComment =~ s/\s*$//o;
--
TWiki:Main.PeterThoeny
- 2018-07-14