From 1786b60fe75e889c58cecaf78305d342beabfa00 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Mar 2010 15:20:25 -0500 Subject: [PATCH] htmlscrubber: Security fix: In data:image/* uris, only allow a few whitelisted image types. No svg. --- IkiWiki/Plugin/htmlscrubber.pm | 6 +++--- debian/changelog | 7 +++++++ doc/security.mdwn | 25 ++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/IkiWiki/Plugin/htmlscrubber.pm b/IkiWiki/Plugin/htmlscrubber.pm index 3bdaccea1..9530d8708 100644 --- a/IkiWiki/Plugin/htmlscrubber.pm +++ b/IkiWiki/Plugin/htmlscrubber.pm @@ -29,9 +29,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 sanitize (@) { #{{{ diff --git a/debian/changelog b/debian/changelog index 2121f812b..c01b697e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (2.53.5) stable-security; urgency=high + + * htmlscrubber: Security fix: In data:image/* uris, only allow a few + whitelisted image types. No svg. + + -- Joey Hess Fri, 12 Mar 2010 15:19:29 -0500 + ikiwiki (2.53.4) stable-security; urgency=high * teximg: Replace the insufficient blacklist with the built-in security diff --git a/doc/security.mdwn b/doc/security.mdwn index 403de81de..2eca735b2 100644 --- a/doc/security.mdwn +++ b/doc/security.mdwn @@ -416,4 +416,27 @@ can cause it to crash. This can potentially be used for a denial of service attack. intrigeri discovered this problem on 12 Nov 2008 and a patch put in place -later that day. +later that day, in version 2.70. The fix was backported to testing as version +2.53.3, and to stable as version 1.33.7. + +## Insufficient blacklisting in teximg plugin + +Josh Triplett discovered on 28 Aug 2009 that the teximg plugin's +blacklisting of insecure TeX commands was insufficient; it could be +bypassed and used to read arbitrary files. This was fixed by +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. -- 2.26.2