r86028 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86027‎ | r86028 | r86029 >
Date:07:12, 14 April 2011
Author:tstarling
Status:ok
Tags:
Comment:
MFT r86027: fix IE6 XSS again
Modified paths:
  • /branches/REL1_17/phase3/images/.htaccess (modified) (history)
  • /branches/REL1_17/phase3/img_auth.php (modified) (history)
  • /branches/REL1_17/phase3/includes/WebRequest.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/images/.htaccess
@@ -1,6 +1,6 @@
22 # Protect against bug 28235
33 <IfModule rewrite_module>
44 RewriteEngine On
5 - RewriteCond %{QUERY_STRING} \.[a-z]{1,4}$ [nocase]
 5+ RewriteCond %{QUERY_STRING} \.[a-z0-9]{1,4}(#|\?|$) [nocase]
66 RewriteRule . - [forbidden]
77 </IfModule>
Index: branches/REL1_17/phase3/includes/WebRequest.php
@@ -755,7 +755,7 @@
756756 global $wgScriptExtension;
757757
758758 if ( isset( $_SERVER['QUERY_STRING'] )
759 - && preg_match( '/\.[a-z]{1,4}$/i', $_SERVER['QUERY_STRING'] ) )
 759+ && preg_match( '/\.[a-z0-9]{1,4}(#|\?|$)/i', $_SERVER['QUERY_STRING'] ) )
760760 {
761761 // Bug 28235
762762 // Block only Internet Explorer, and requests with missing UA
Index: branches/REL1_17/phase3/img_auth.php
@@ -39,7 +39,7 @@
4040
4141 // Check for bug 28235: QUERY_STRING overriding the correct extension
4242 if ( isset( $_SERVER['QUERY_STRING'] )
43 - && preg_match( '/\.[a-z]{1,4}$/i', $_SERVER['QUERY_STRING'] ) )
 43+ && preg_match( '/\.[a-z0-9]{1,4}(#|\?|$)/i', $_SERVER['QUERY_STRING'] ) )
4444 {
4545 wfForbidden( 'img-auth-accessdenied', 'img-auth-bad-query-string' );
4646 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86027(bug 28507) Fix for r85844: that revision was not actually sufficient to fix ...tstarling07:10, 14 April 2011

Status & tagging log