]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
htmlscrubber: Security fix: In data:image/* uris, only allow a few whitelisted image...
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 12 Mar 2010 19:49:13 +0000 (14:49 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 12 Mar 2010 19:50:26 +0000 (14:50 -0500)
IkiWiki/Plugin/htmlscrubber.pm
debian/changelog
doc/security.mdwn

index ee284a45c3e46815f47a9001e1badb45adacdb6c..26e18ffc753c537158ceb86cca80d03f5b1cca2e 100644 (file)
@@ -30,9 +30,9 @@ sub import {
                "msnim", "notes", "rsync", "secondlife", "skype", "ssh",
                "sftp", "smb", "sms", "snews", "webcal", "ymsgr",
        );
-       # data is a special case. Allow data:image/*, but
-       # disallow data:text/javascript and everything else.
-       $safe_url_regexp=qr/^(?:(?:$uri_schemes):|data:image\/|[^:]+(?:$|\/))/i;
+       # data is a special case. Allow a few data:image/ types,
+       # but disallow data:text/javascript and everything else.
+       $safe_url_regexp=qr/^(?:(?:$uri_schemes):|data:image\/(?:png|jpeg|gif)|[^:]+(?:$|\/))/i;
 }
 
 sub getsetup () {
index bae0e7ee01e6448f8c6c5d308915ef6bac33a56c..7fdbbcb63695ccf844091e27aa2a084454804f22 100644 (file)
@@ -1,4 +1,4 @@
-ikiwiki (3.20100303) UNRELEASED; urgency=low
+ikiwiki (3.20100312) unstable; urgency=HIGH
 
   * Fix utf8 issues in calls to md5_hex.
   * moderatedcomments: Added moderate_pagespec that can be used
@@ -12,6 +12,8 @@ ikiwiki (3.20100303) UNRELEASED; urgency=low
   * Fix missing span on recentchanges page template.
   * search: Avoid '$' in the wikiname appearing unescaped on omega's
     query template, where it might crash omega.
+  * htmlscrubber: Security fix: In data:image/* uris, only allow a few
+    whitelisted image types. No svg.
 
  -- Joey Hess <joeyh@debian.org>  Tue, 09 Mar 2010 19:46:35 -0500
 
index 3924186c2120c9371b1f55b648c4a760a0a5d6d3..21aef316bcbddb8773aa335c79bd9ce1c036e4e3 100644 (file)
@@ -427,3 +427,15 @@ enabling TeX configuration options that disallow unsafe TeX commands.
 The fix was released on 30 Aug 2009 in version 3.1415926, and was
 backported to stable in version 2.53.4. If you use the teximg plugin,
 I recommend upgrading. ([[!cve CVE-2009-2944]])
+
+## javascript insertion via svg uris
+
+Ivan Shmakov pointed out that the htmlscrubber allowed `data:image/*` urls,
+including `data:image/svg+xml`. But svg can contain javascript, so that is
+unsafe.
+
+This hole was discovered on 12 March 2010 and fixed the same day
+with the release of ikiwiki 3.20100312.
+A fix was also backported to Debian etch, as version 2.53.5. I recommend
+upgrading to one of these versions if your wiki can be edited by third
+parties.