Changeset 1915
- Timestamp:
- 04/16/2011 11:58:59 AM (13 months ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
. (modified) (1 prop)
-
w/RELEASE-NOTES (modified) (2 diffs)
-
w/api.php (modified) (1 diff)
-
w/img_auth.php (modified) (1 diff)
-
w/includes/DefaultSettings.php (modified) (1 diff)
-
w/includes/RawPage.php (modified) (1 diff)
-
w/includes/Sanitizer.php (modified) (2 diffs)
-
w/includes/WebRequest.php (modified) (1 diff)
-
w/includes/specials/SpecialImport.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:externals
-
old new 1 w/bin http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_ 2/phase3/bin2 w/cache http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_ 2/phase3/cache3 w/config http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_ 2/phase3/config4 w/docs http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_ 2/phase3/docs5 w/languages http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_ 2/phase3/languages6 w/maintenance http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_ 2/phase3/maintenance7 w/math http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_ 2/phase3/math8 w/serialized http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_ 2/phase3/serialized9 w/extensions/Interwiki http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_ 2/extensions/Interwiki1 w/bin http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_4/phase3/bin 2 w/cache http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_4/phase3/cache 3 w/config http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_4/phase3/config 4 w/docs http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_4/phase3/docs 5 w/languages http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_4/phase3/languages 6 w/maintenance http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_4/phase3/maintenance 7 w/math http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_4/phase3/math 8 w/serialized http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_4/phase3/serialized 9 w/extensions/Interwiki http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_16_4/extensions/Interwiki
-
- Property svn:externals
-
trunk/w/RELEASE-NOTES
r1881 r1915 1 1 = MediaWiki release notes = 2 2 3 == MediaWiki 1.16. 2==4 5 2011-0 2-013 == MediaWiki 1.16.4 == 4 5 2011-04-14 6 6 7 7 This is a security and maintenance release of the MediaWiki 1.16 branch. … … 44 44 you have the DBA extension for PHP installed, this will improve performance 45 45 further. 46 47 == Changes since 1.16.3 == 48 49 * (bug 28507) The change we made in 1.16.3 to fix bug 28235 (XSS for IE 6 50 clients) was not actually sufficient to fix that bug. This release contains 51 a second attempt, hopefully we have fixed it this time. 52 53 == Changes since 1.16.2 == 54 55 * (bug 28449) Fixed permissions checks in Special:Import which allowed users 56 without the 'import' permission to import pages from the configured import 57 sources. 58 * (bug 28235) Fixed XSS affecting IE 6 and earlier clients only, due to those 59 browsers looking for a file extension in the query string of the URL, and 60 ignoring the Content-Type header if one is found. 61 * (bug 28450) Fixed a CSS validation issue involving escaped comments, which 62 led to XSS for Internet Explorer clients and privacy loss for other clients. 46 63 47 64 == Changes since 1.16.1 == -
trunk/w/api.php
r1484 r1915 53 53 if ( $wgRequest->isPathInfoBad() ) { 54 54 wfHttpError( 403, 'Forbidden', 55 'Invalid file extension found in PATH_INFO. ' . 56 'The API must be accessed through the primary script entry point.' ); 55 'Invalid file extension found in PATH_INFO or QUERY_STRING.' ); 57 56 return; 58 57 } -
trunk/w/img_auth.php
r1484 r1915 36 36 { 37 37 wfForbidden('img-auth-accessdenied','img-auth-public'); 38 } 39 40 // Check for bug 28235: QUERY_STRING overriding the correct extension 41 if ( isset( $_SERVER['QUERY_STRING'] ) 42 && preg_match( '/\.[a-z0-9]{1,4}(#|\?|$)/i', $_SERVER['QUERY_STRING'] ) ) 43 { 44 wfForbidden( 'img-auth-accessdenied', 'img-auth-bad-query-string' ); 38 45 } 39 46 -
trunk/w/includes/DefaultSettings.php
r1881 r1915 34 34 35 35 /** MediaWiki version number */ 36 $wgVersion = '1.16. 2';36 $wgVersion = '1.16.4'; 37 37 38 38 /** Name of the site. It must be changed in LocalSettings.php */ -
trunk/w/includes/RawPage.php
r1484 r1915 126 126 # Just return a 403 Forbidden and get it over with. 127 127 wfHttpError( 403, 'Forbidden', 128 'Invalid file extension found in PATH_INFO . ' .128 'Invalid file extension found in PATH_INFO or QUERY_STRING. ' . 129 129 'Raw pages must be accessed through the primary script entry point.' ); 130 130 return; -
trunk/w/includes/Sanitizer.php
r1881 r1915 728 728 /** 729 729 * Pick apart some CSS and check it for forbidden or unsafe structures. 730 * Returns a sanitized string, or false if it was just too evil. 730 * Returns a sanitized string. This sanitized string will have 731 * character references and escape sequences decoded, and comments 732 * stripped. If the input is just too evil, only a comment complaining 733 * about evilness will be returned. 731 734 * 732 735 * Currently URL references, 'expression', 'tps' are forbidden. 733 736 * 737 * NOTE: Despite the fact that character references are decoded, the 738 * returned string may contain character references given certain 739 * clever input strings. These character references must 740 * be escaped before the return value is embedded in HTML. 741 * 734 742 * @param $value String 735 * @return Mixed743 * @return String 736 744 */ 737 745 static function checkCss( $value ) { 746 // Decode character references like { 738 747 $value = Sanitizer::decodeCharReferences( $value ); 739 740 // Remove any comments; IE gets token splitting wrong741 $value = StringUtils::delimiterReplace( '/*', '*/', ' ', $value );742 743 // Remove anything after a comment-start token, to guard against744 // incorrect client implementations.745 $commentPos = strpos( $value, '/*' );746 if ( $commentPos !== false ) {747 $value = substr( $value, 0, $commentPos );748 }749 748 750 749 // Decode escape sequences and line continuation 751 750 // See the grammar in the CSS 2 spec, appendix D. 752 static $decodeRegex, $reencodeTable; 751 // This has to be done AFTER decoding character references. 752 // This means it isn't possible for this function to return 753 // unsanitized escape sequences. It is possible to manufacture 754 // input that contains character references that decode to 755 // escape sequences that decode to character references, but 756 // it's OK for the return value to contain character references 757 // because the caller is supposed to escape those anyway. 758 static $decodeRegex; 753 759 if ( !$decodeRegex ) { 754 760 $space = '[\\x20\\t\\r\\n\\f]'; … … 765 771 $value = preg_replace_callback( $decodeRegex, 766 772 array( __CLASS__, 'cssDecodeCallback' ), $value ); 773 774 // Remove any comments; IE gets token splitting wrong 775 // This must be done AFTER decoding character references and 776 // escape sequences, because those steps can introduce comments 777 // This step cannot introduce character references or escape 778 // sequences, because it replaces comments with spaces rather 779 // than removing them completely. 780 $value = StringUtils::delimiterReplace( '/*', '*/', ' ', $value ); 781 782 // Remove anything after a comment-start token, to guard against 783 // incorrect client implementations. 784 $commentPos = strpos( $value, '/*' ); 785 if ( $commentPos !== false ) { 786 $value = substr( $value, 0, $commentPos ); 787 } 767 788 768 789 // Reject problematic keywords and control characters -
trunk/w/includes/WebRequest.php
r1881 r1915 689 689 * the extension is not mangled. So this should be a reasonably portable 690 690 * way to perform this security check. 691 * 692 * Also checks for anything that looks like a file extension at the end of 693 * QUERY_STRING, since IE 6 and earlier will use this to get the file type 694 * if there was no dot before the question mark (bug 28235). 691 695 */ 692 696 public function isPathInfoBad() { 693 697 global $wgScriptExtension; 698 699 if ( isset( $_SERVER['QUERY_STRING'] ) 700 && preg_match( '/\.[a-z0-9]{1,4}(#|\?|$)/i', $_SERVER['QUERY_STRING'] ) ) 701 { 702 // Bug 28235 703 // Block only Internet Explorer, and requests with missing UA 704 // headers that could be IE users behind a privacy proxy. 705 if ( !isset( $_SERVER['HTTP_USER_AGENT'] ) 706 || preg_match( '/; *MSIE/', $_SERVER['HTTP_USER_AGENT'] ) ) 707 { 708 return true; 709 } 710 } 694 711 695 712 if ( !isset( $_SERVER['PATH_INFO'] ) ) { -
trunk/w/includes/specials/SpecialImport.php
r1484 r1915 46 46 */ 47 47 function execute( $par ) { 48 global $wgRequest ;48 global $wgRequest, $wgUser, $wgOut; 49 49 50 50 $this->setHeaders(); … … 57 57 } 58 58 59 if( !$wgUser->isAllowed( 'import' ) && !$wgUser->isAllowed( 'importupload' ) ) 60 return $wgOut->permissionRequired( 'import' ); 61 62 # TODO: allow Title::getUserPermissionsErrors() to take an array 63 # FIXME: Title::checkSpecialsAndNSPermissions() has a very wierd expectation of what 64 # getUserPermissionsErrors() might actually be used for, hence the 'ns-specialprotected' 65 $errors = wfMergeErrorArrays( 66 $this->getTitle()->getUserPermissionsErrors( 67 'import', $wgUser, true, 68 array( 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' ) 69 ), 70 $this->getTitle()->getUserPermissionsErrors( 71 'importupload', $wgUser, true, 72 array( 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' ) 73 ) 74 ); 75 76 if( $errors ){ 77 $wgOut->showPermissionsErrorPage( $errors ); 78 return; 79 } 80 59 81 if ( $wgRequest->wasPosted() && $wgRequest->getVal( 'action' ) == 'submit' ) { 60 82 $this->doImport(); … … 85 107 } 86 108 } elseif ( $sourceName == "interwiki" ) { 109 if( !$wgUser->isAllowed( 'import' ) ){ 110 return $wgOut->permissionRequired( 'import' ); 111 } 87 112 $this->interwiki = $wgRequest->getVal( 'interwiki' ); 88 113 if ( !in_array( $this->interwiki, $wgImportSources ) ) { … … 134 159 private function showForm() { 135 160 global $wgUser, $wgOut, $wgRequest, $wgImportSources, $wgExportMaxLinkDepth; 136 if( !$wgUser->isAllowed( 'import' ) && !$wgUser->isAllowed( 'importupload' ) )137 return $wgOut->permissionRequired( 'import' );138 161 139 162 $action = $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) );
Note: See TracChangeset
for help on using the changeset viewer.
