• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7833: Sanitation of attachment comment

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine Attachment Normal Closed   patch 6.1.0

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

-- 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/</&lt;/g;
+            $comment =~ s/>/&gt;/g;
         } else {
             $comment = "&nbsp;";
         }

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

ItemTemplate
Summary Sanitation of attachment comment
ReportedBy TWiki:Main.PeterThoeny
Codebase ~twiki4, 6.0.2
SVN Range TWiki-6.0.2-trunk, Fri, 03 Nov 2017, build 30403
AppliesTo Engine
Component Attachment
Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:30564 TWikirev:30565 TWikirev:30566 TWikirev:30567
TargetRelease patch
ReleasedIn 6.1.0
Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r10 - 2018-07-17 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback