Property changes on: branches/REL1_16/phase3/maintenance/deleteSelfExternals.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1 | 1 | Merged /trunk/phase3/maintenance/deleteSelfExternals.php:r79561 |
Property changes on: branches/REL1_16/phase3/maintenance/moveBatch.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2 | 2 | Merged /trunk/phase3/maintenance/moveBatch.php:r79561 |
Property changes on: branches/REL1_16/phase3/maintenance/cleanupTable.inc |
___________________________________________________________________ |
Modified: svn:mergeinfo |
3 | 3 | Merged /trunk/phase3/maintenance/cleanupTable.inc:r79561 |
Property changes on: branches/REL1_16/phase3/maintenance/Maintenance.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
4 | 4 | Merged /trunk/phase3/maintenance/Maintenance.php:r79561 |
Property changes on: branches/REL1_16/phase3/maintenance |
___________________________________________________________________ |
Modified: svn:mergeinfo |
5 | 5 | Merged /trunk/phase3/maintenance:r79561 |
Property changes on: branches/REL1_16/phase3/skins/common/jquery.js |
___________________________________________________________________ |
Modified: svn:mergeinfo |
6 | 6 | Merged /trunk/phase3/skins/common/jquery.js:r79561 |
Property changes on: branches/REL1_16/phase3/skins/common/jquery.min.js |
___________________________________________________________________ |
Modified: svn:mergeinfo |
7 | 7 | Merged /trunk/phase3/skins/common/jquery.min.js:r79561 |
Property changes on: branches/REL1_16/phase3/skins/common |
___________________________________________________________________ |
Modified: svn:mergeinfo |
8 | 8 | Merged /trunk/phase3/skins/common:r79561 |
Property changes on: branches/REL1_16/phase3/skins/vector |
___________________________________________________________________ |
Modified: svn:mergeinfo |
9 | 9 | Merged /trunk/phase3/skins/vector:r79561 |
Property changes on: branches/REL1_16/phase3/CREDITS |
___________________________________________________________________ |
Modified: svn:mergeinfo |
10 | 10 | Merged /trunk/phase3/CREDITS:r79561 |
Property changes on: branches/REL1_16/phase3/includes/upload |
___________________________________________________________________ |
Modified: svn:mergeinfo |
11 | 11 | Merged /trunk/phase3/includes/upload:r79561 |
Property changes on: branches/REL1_16/phase3/includes/search/SearchSqlite.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
12 | 12 | Merged /trunk/phase3/includes/search/SearchSqlite.php:r79561 |
Index: branches/REL1_16/phase3/includes/diff/DifferenceInterface.php |
— | — | @@ -112,6 +112,8 @@ |
113 | 113 | global $wgUser, $wgOut, $wgUseExternalEditor, $wgUseRCPatrol; |
114 | 114 | wfProfileIn( __METHOD__ ); |
115 | 115 | |
| 116 | + # Allow frames except in certain special cases |
| 117 | + $wgOut->allowClickjacking(); |
116 | 118 | |
117 | 119 | # If external diffs are enabled both globally and for the user, |
118 | 120 | # we'll use the application/x-external-editor interface to call |
— | — | @@ -199,6 +201,7 @@ |
200 | 202 | // Check if page is editable |
201 | 203 | $editable = $this->mNewRev->getTitle()->userCan( 'edit' ); |
202 | 204 | if ( $editable && $this->mNewRev->isCurrent() && $wgUser->isAllowed( 'rollback' ) ) { |
| 205 | + $wgOut->preventClickjacking(); |
203 | 206 | $rollback = ' ' . $sk->generateRollback( $this->mNewRev ); |
204 | 207 | } else { |
205 | 208 | $rollback = ''; |
Property changes on: branches/REL1_16/phase3/includes/diff |
___________________________________________________________________ |
Modified: svn:mergeinfo |
206 | 209 | Merged /trunk/phase3/includes/diff:r79561 |
Property changes on: branches/REL1_16/phase3/includes/json/Services_JSON.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
207 | 210 | Merged /trunk/phase3/includes/json/Services_JSON.php:r79561 |
Index: branches/REL1_16/phase3/includes/Article.php |
— | — | @@ -792,6 +792,9 @@ |
793 | 793 | return; |
794 | 794 | } |
795 | 795 | |
| 796 | + # Allow frames by default |
| 797 | + $wgOut->allowClickjacking(); |
| 798 | + |
796 | 799 | # Should the parser cache be used? |
797 | 800 | $useParserCache = $this->useParserCache( $oldid ); |
798 | 801 | wfDebug( 'Article::view using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" ); |
— | — | @@ -1452,6 +1455,8 @@ |
1453 | 1456 | ); |
1454 | 1457 | if ( !$dbr->numRows( $tbs ) ) return; |
1455 | 1458 | |
| 1459 | + $wgOut->preventClickjacking(); |
| 1460 | + |
1456 | 1461 | $tbtext = ""; |
1457 | 1462 | while ( $o = $dbr->fetchObject( $tbs ) ) { |
1458 | 1463 | $rmvtxt = ""; |
Property changes on: branches/REL1_16/phase3/includes/Article.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1459 | 1464 | Merged /trunk/phase3/includes/Article.php:r79561 |
Property changes on: branches/REL1_16/phase3/includes/OutputHandler.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1460 | 1465 | Merged /trunk/phase3/includes/OutputHandler.php:r79561 |
Property changes on: branches/REL1_16/phase3/includes/LocalisationCache.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1461 | 1466 | Merged /trunk/phase3/includes/LocalisationCache.php:r79561 |
Index: branches/REL1_16/phase3/includes/ImagePage.php |
— | — | @@ -600,6 +600,7 @@ |
601 | 601 | $this->loadFile(); |
602 | 602 | $pager = new ImageHistoryPseudoPager( $this ); |
603 | 603 | $wgOut->addHTML( $pager->getBody() ); |
| 604 | + $wgOut->preventClickjacking( $pager->getPreventClickjacking() ); |
604 | 605 | |
605 | 606 | $this->img->resetHistory(); // free db resources |
606 | 607 | |
— | — | @@ -803,6 +804,7 @@ |
804 | 805 | class ImageHistoryList { |
805 | 806 | |
806 | 807 | protected $imagePage, $img, $skin, $title, $repo, $showThumb; |
| 808 | + protected $preventClickjacking = false; |
807 | 809 | |
808 | 810 | public function __construct( $imagePage ) { |
809 | 811 | global $wgUser, $wgShowArchiveThumbnails; |
— | — | @@ -929,6 +931,7 @@ |
930 | 932 | # Don't link to unviewable files |
931 | 933 | $row .= '<span class="history-deleted">' . $wgLang->timeAndDate( $timestamp, true ) . '</span>'; |
932 | 934 | } elseif( $file->isDeleted(File::DELETED_FILE) ) { |
| 935 | + $this->preventClickjacking(); |
933 | 936 | $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); |
934 | 937 | # Make a link to review the image |
935 | 938 | $url = $this->skin->link( |
— | — | @@ -1015,9 +1018,19 @@ |
1016 | 1019 | return wfMsgHtml( 'filehist-nothumb' ); |
1017 | 1020 | } |
1018 | 1021 | } |
| 1022 | + |
| 1023 | + protected function preventClickjacking( $enable = true ) { |
| 1024 | + $this->preventClickjacking = $enable; |
| 1025 | + } |
| 1026 | + |
| 1027 | + public function getPreventClickjacking() { |
| 1028 | + return $this->preventClickjacking; |
| 1029 | + } |
1019 | 1030 | } |
1020 | 1031 | |
1021 | 1032 | class ImageHistoryPseudoPager extends ReverseChronologicalPager { |
| 1033 | + protected $preventClickjacking = false; |
| 1034 | + |
1022 | 1035 | function __construct( $imagePage ) { |
1023 | 1036 | parent::__construct(); |
1024 | 1037 | $this->mImagePage = $imagePage; |
— | — | @@ -1058,6 +1071,10 @@ |
1059 | 1072 | $s .= $list->imageHistoryLine( !$file->isOld(), $file ); |
1060 | 1073 | } |
1061 | 1074 | $s .= $list->endImageHistoryList($navLink); |
| 1075 | + |
| 1076 | + if ( $list->getPreventClickjacking() ) { |
| 1077 | + $this->preventClickjacking(); |
| 1078 | + } |
1062 | 1079 | } |
1063 | 1080 | return $s; |
1064 | 1081 | } |
— | — | @@ -1140,4 +1157,13 @@ |
1141 | 1158 | } |
1142 | 1159 | $this->mQueryDone = true; |
1143 | 1160 | } |
| 1161 | + |
| 1162 | + protected function preventClickjacking( $enable = true ) { |
| 1163 | + $this->preventClickjacking = $enable; |
| 1164 | + } |
| 1165 | + |
| 1166 | + public function getPreventClickjacking() { |
| 1167 | + return $this->preventClickjacking; |
| 1168 | + } |
| 1169 | + |
1144 | 1170 | } |
Property changes on: branches/REL1_16/phase3/includes/UserMailer.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1145 | 1171 | Merged /trunk/phase3/includes/UserMailer.php:r79561 |
Index: branches/REL1_16/phase3/includes/HTMLForm.php |
— | — | @@ -311,6 +311,9 @@ |
312 | 312 | $this->displayErrors( $submitResult ); |
313 | 313 | } |
314 | 314 | |
| 315 | + # For good measure (it is the default) |
| 316 | + $wgOut->preventClickjacking(); |
| 317 | + |
315 | 318 | $html = '' |
316 | 319 | . $this->mHeader |
317 | 320 | . $this->getBody() |
Index: branches/REL1_16/phase3/includes/OutputPage.php |
— | — | @@ -37,6 +37,7 @@ |
38 | 38 | var $mPageTitleActionText = ''; |
39 | 39 | var $mParseWarnings = array(); |
40 | 40 | var $mSquidMaxage = 0; |
| 41 | + var $mPreventClickjacking = true; |
41 | 42 | var $mRevisionId = null; |
42 | 43 | protected $mTitle = null; |
43 | 44 | |
— | — | @@ -1348,6 +1349,41 @@ |
1349 | 1350 | } |
1350 | 1351 | |
1351 | 1352 | /** |
| 1353 | + * Set a flag which will cause an X-Frame-Options header appropriate for |
| 1354 | + * edit pages to be sent. The header value is controlled by |
| 1355 | + * $wgEditPageFrameOptions. |
| 1356 | + * |
| 1357 | + * This is the default for special pages. If you display a CSRF-protected |
| 1358 | + * form on an ordinary view page, then you need to call this function. |
| 1359 | + */ |
| 1360 | + public function preventClickjacking( $enable = true ) { |
| 1361 | + $this->mPreventClickjacking = $enable; |
| 1362 | + } |
| 1363 | + |
| 1364 | + /** |
| 1365 | + * Turn off frame-breaking. Alias for $this->preventClickjacking(false). |
| 1366 | + * This can be called from pages which do not contain any CSRF-protected |
| 1367 | + * HTML form. |
| 1368 | + */ |
| 1369 | + public function allowClickjacking() { |
| 1370 | + $this->mPreventClickjacking = false; |
| 1371 | + } |
| 1372 | + |
| 1373 | + /** |
| 1374 | + * Get the X-Frame-Options header value (without the name part), or false |
| 1375 | + * if there isn't one. This is used by Skin to determine whether to enable |
| 1376 | + * JavaScript frame-breaking, for clients that don't support X-Frame-Options. |
| 1377 | + */ |
| 1378 | + public function getFrameOptions() { |
| 1379 | + global $wgBreakFrames, $wgEditPageFrameOptions; |
| 1380 | + if ( $wgBreakFrames ) { |
| 1381 | + return 'DENY'; |
| 1382 | + } elseif ( $this->mPreventClickjacking && $wgEditPageFrameOptions ) { |
| 1383 | + return $wgEditPageFrameOptions; |
| 1384 | + } |
| 1385 | + } |
| 1386 | + |
| 1387 | + /** |
1352 | 1388 | * Send cache control HTTP headers |
1353 | 1389 | */ |
1354 | 1390 | public function sendCacheControl() { |
— | — | @@ -1561,6 +1597,13 @@ |
1562 | 1598 | $wgRequest->response()->header( "Content-type: $wgMimeType; charset={$wgOutputEncoding}" ); |
1563 | 1599 | $wgRequest->response()->header( 'Content-language: '.$wgContLanguageCode ); |
1564 | 1600 | |
| 1601 | + // Prevent framing, if requested |
| 1602 | + $frameOptions = $this->getFrameOptions(); |
| 1603 | + if ( $frameOptions ) { |
| 1604 | + $wgRequest->response()->header( "X-Frame-Options: $frameOptions" ); |
| 1605 | + } |
| 1606 | + |
| 1607 | + |
1565 | 1608 | if ($this->mArticleBodyOnly) { |
1566 | 1609 | $this->out($this->mBodytext); |
1567 | 1610 | } else { |
Property changes on: branches/REL1_16/phase3/includes/OutputPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1568 | 1611 | Merged /trunk/phase3/includes/OutputPage.php:r79561 |
Index: branches/REL1_16/phase3/includes/HistoryPage.php |
— | — | @@ -166,6 +166,7 @@ |
167 | 167 | $pager->getBody() . |
168 | 168 | $pager->getNavigationBar() |
169 | 169 | ); |
| 170 | + $wgOut->preventClickjacking( $pager->getPreventClickjacking() ); |
170 | 171 | |
171 | 172 | wfProfileOut( __METHOD__ ); |
172 | 173 | } |
— | — | @@ -301,6 +302,7 @@ |
302 | 303 | class HistoryPager extends ReverseChronologicalPager { |
303 | 304 | public $lastRow = false, $counter, $historyPage, $title, $buttons, $conds; |
304 | 305 | protected $oldIdChecked; |
| 306 | + protected $preventClickjacking = false; |
305 | 307 | |
306 | 308 | function __construct( $historyPage, $year='', $month='', $tagFilter = '', $conds = array() ) { |
307 | 309 | parent::__construct(); |
— | — | @@ -382,6 +384,7 @@ |
383 | 385 | |
384 | 386 | $this->buttons = '<div>'; |
385 | 387 | if( $wgUser->isAllowed('deleterevision') ) { |
| 388 | + $this->preventClickjacking(); |
386 | 389 | $float = $wgContLang->alignEnd(); |
387 | 390 | # Note bug #20966, <button> is non-standard in IE<8 |
388 | 391 | $this->buttons .= Xml::element( 'button', |
— | — | @@ -488,6 +491,7 @@ |
489 | 492 | $del = ''; |
490 | 493 | // User can delete revisions... |
491 | 494 | if( $wgUser->isAllowed( 'deleterevision' ) ) { |
| 495 | + $this->preventClickjacking(); |
492 | 496 | // If revision was hidden from sysops, disable the checkbox |
493 | 497 | if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
494 | 498 | $del = Xml::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) ); |
— | — | @@ -534,6 +538,7 @@ |
535 | 539 | # Rollback and undo links |
536 | 540 | if( !is_null( $next ) && is_object( $next ) ) { |
537 | 541 | if( $latest && $this->title->userCan( 'rollback' ) && $this->title->userCan( 'edit' ) ) { |
| 542 | + $this->preventClickjacking(); |
538 | 543 | $tools[] = '<span class="mw-rollback-link">'. |
539 | 544 | $this->getSkin()->buildRollbackLink( $rev ).'</span>'; |
540 | 545 | } |
— | — | @@ -721,6 +726,20 @@ |
722 | 727 | return ''; |
723 | 728 | } |
724 | 729 | } |
| 730 | + |
| 731 | + /** |
| 732 | + * This is called if a write operation is possible from the generated HTML |
| 733 | + */ |
| 734 | + function preventClickjacking( $enable = true ) { |
| 735 | + $this->preventClickjacking = $enable; |
| 736 | + } |
| 737 | + |
| 738 | + /** |
| 739 | + * Get the "prevent clickjacking" flag |
| 740 | + */ |
| 741 | + function getPreventClickjacking() { |
| 742 | + return $this->preventClickjacking; |
| 743 | + } |
725 | 744 | } |
726 | 745 | |
727 | 746 | /** |
Property changes on: branches/REL1_16/phase3/includes/HistoryPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
728 | 747 | Merged /trunk/phase3/includes/HistoryPage.php:r79561 |
Property changes on: branches/REL1_16/phase3/includes/Sanitizer.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
729 | 748 | Merged /trunk/phase3/includes/Sanitizer.php:r79561 |
Property changes on: branches/REL1_16/phase3/includes/api/ApiBase.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
730 | 749 | Merged /trunk/phase3/includes/api/ApiBase.php:r79561 |
Property changes on: branches/REL1_16/phase3/includes/api/ApiQueryAllUsers.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
731 | 750 | Merged /trunk/phase3/includes/api/ApiQueryAllUsers.php:r79561 |
Property changes on: branches/REL1_16/phase3/includes/api |
___________________________________________________________________ |
Modified: svn:mergeinfo |
732 | 751 | Merged /trunk/phase3/includes/api:r79561 |
Property changes on: branches/REL1_16/phase3/includes/WebRequest.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
733 | 752 | Merged /trunk/phase3/includes/WebRequest.php:r79561 |
Property changes on: branches/REL1_16/phase3/includes/media/Bitmap.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
734 | 753 | Merged /trunk/phase3/includes/media/Bitmap.php:r79561 |
Property changes on: branches/REL1_16/phase3/includes/media |
___________________________________________________________________ |
Modified: svn:mergeinfo |
735 | 754 | Merged /trunk/phase3/includes/media:r79561 |
Property changes on: branches/REL1_16/phase3/includes/ChangesList.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
736 | 755 | Merged /trunk/phase3/includes/ChangesList.php:r79561 |
Property changes on: branches/REL1_16/phase3/includes/ConfEditor.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
737 | 756 | Merged /trunk/phase3/includes/ConfEditor.php:r79561 |
Index: branches/REL1_16/phase3/includes/DefaultSettings.php |
— | — | @@ -3986,12 +3986,33 @@ |
3987 | 3987 | $wgParserTestRemote = false; |
3988 | 3988 | |
3989 | 3989 | /** |
3990 | | - * Break out of framesets. This can be used to prevent external sites from |
3991 | | - * framing your site with ads. |
| 3990 | + * Break out of framesets. This can be used to prevent clickjacking attacks, |
| 3991 | + * or to prevent external sites from framing your site with ads. |
3992 | 3992 | */ |
3993 | 3993 | $wgBreakFrames = false; |
3994 | 3994 | |
3995 | 3995 | /** |
| 3996 | + * The X-Frame-Options header to send on pages sensitive to clickjacking |
| 3997 | + * attacks, such as edit pages. This prevents those pages from being displayed |
| 3998 | + * in a frame or iframe. The options are: |
| 3999 | + * |
| 4000 | + * - 'DENY': Do not allow framing. This is recommended for most wikis. |
| 4001 | + * |
| 4002 | + * - 'SAMEORIGIN': Allow framing by pages on the same domain. This can be used |
| 4003 | + * to allow framing within a trusted domain. This is insecure if there |
| 4004 | + * is a page on the same domain which allows framing of arbitrary URLs. |
| 4005 | + * |
| 4006 | + * - false: Allow all framing. This opens up the wiki to XSS attacks and thus |
| 4007 | + * full compromise of local user accounts. Private wikis behind a |
| 4008 | + * corporate firewall are especially vulnerable. This is not |
| 4009 | + * recommended. |
| 4010 | + * |
| 4011 | + * For extra safety, set $wgBreakFrames = true, to prevent framing on all pages, |
| 4012 | + * not just edit pages. |
| 4013 | + */ |
| 4014 | +$wgEditPageFrameOptions = 'DENY'; |
| 4015 | + |
| 4016 | +/** |
3996 | 4017 | * Set this to an array of special page names to prevent |
3997 | 4018 | * maintenance/updateSpecialPages.php from updating those pages. |
3998 | 4019 | */ |
Index: branches/REL1_16/phase3/includes/specials/SpecialAllpages.php |
— | — | @@ -40,6 +40,7 @@ |
41 | 41 | |
42 | 42 | $this->setHeaders(); |
43 | 43 | $this->outputHeader(); |
| 44 | + $wgOut->allowClickjacking(); |
44 | 45 | |
45 | 46 | # GET values |
46 | 47 | $from = $wgRequest->getVal( 'from', null ); |
Index: branches/REL1_16/phase3/includes/specials/SpecialCategories.php |
— | — | @@ -12,6 +12,7 @@ |
13 | 13 | } else { |
14 | 14 | $from = $par; |
15 | 15 | } |
| 16 | + $wgOut->allowClickjacking(); |
16 | 17 | $cap = new CategoryPager( $from ); |
17 | 18 | $cap->doQuery(); |
18 | 19 | $wgOut->addHTML( |
Index: branches/REL1_16/phase3/includes/specials/SpecialSpecialpages.php |
— | — | @@ -13,6 +13,7 @@ |
14 | 14 | $wgMessageCache->loadAllMessages(); |
15 | 15 | |
16 | 16 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); # Is this really needed? |
| 17 | + $wgOut->allowClickjacking(); |
17 | 18 | $sk = $wgUser->getSkin(); |
18 | 19 | |
19 | 20 | $pages = SpecialPage::getUsablePages(); |
Index: branches/REL1_16/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -107,6 +107,7 @@ |
108 | 108 | '<p>' . $pager->getNavigationBar() . '</p>' |
109 | 109 | ); |
110 | 110 | } |
| 111 | + $wgOut->preventClickjacking( $pager->getPreventClickjacking() ); |
111 | 112 | |
112 | 113 | |
113 | 114 | # Show the appropriate "footer" message - WHOIS tools, etc. |
— | — | @@ -428,6 +429,7 @@ |
429 | 430 | public $mDefaultDirection = true; |
430 | 431 | var $messages, $target; |
431 | 432 | var $namespace = '', $mDb; |
| 433 | + var $preventClickjacking = false; |
432 | 434 | |
433 | 435 | function __construct( $target, $namespace = false, $year = false, $month = false, $tagFilter = false ) { |
434 | 436 | parent::__construct(); |
— | — | @@ -565,6 +567,7 @@ |
566 | 568 | if( !$row->page_is_new && $page->quickUserCan( 'rollback' ) |
567 | 569 | && $page->quickUserCan( 'edit' ) ) |
568 | 570 | { |
| 571 | + $this->preventClickjacking(); |
569 | 572 | $topmarktext .= ' '.$sk->generateRollback( $rev ); |
570 | 573 | } |
571 | 574 | } |
— | — | @@ -671,4 +674,11 @@ |
672 | 675 | return $this->mDb; |
673 | 676 | } |
674 | 677 | |
| 678 | + protected function preventClickjacking() { |
| 679 | + $this->preventClickjacking = true; |
| 680 | + } |
| 681 | + |
| 682 | + public function getPreventClickjacking() { |
| 683 | + return $this->preventClickjacking; |
| 684 | + } |
675 | 685 | } |
Property changes on: branches/REL1_16/phase3/includes/specials/SpecialUpload.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
676 | 686 | Merged /trunk/phase3/includes/specials/SpecialUpload.php:r79561 |
Index: branches/REL1_16/phase3/includes/specials/SpecialVersion.php |
— | — | @@ -32,6 +32,7 @@ |
33 | 33 | |
34 | 34 | $this->setHeaders(); |
35 | 35 | $this->outputHeader(); |
| 36 | + $wgOut->allowClickjacking(); |
36 | 37 | |
37 | 38 | $wgOut->addHTML( Xml::openElement( 'div', |
38 | 39 | array( 'dir' => $wgContLang->getDir() ) ) ); |
Index: branches/REL1_16/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -364,6 +364,7 @@ |
365 | 365 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
366 | 366 | // add javascript specific to special:search |
367 | 367 | $wgOut->addScriptFile( 'search.js' ); |
| 368 | + $wgOut->allowClickjacking(); |
368 | 369 | } |
369 | 370 | |
370 | 371 | /** |
Index: branches/REL1_16/phase3/includes/specials/SpecialLinkSearch.php |
— | — | @@ -44,8 +44,10 @@ |
45 | 45 | $protocol = ''; |
46 | 46 | } |
47 | 47 | |
| 48 | + $wgOut->allowClickjacking(); |
| 49 | + |
48 | 50 | $self = Title::makeTitle( NS_SPECIAL, 'Linksearch' ); |
49 | | - |
| 51 | + |
50 | 52 | $wgOut->addWikiMsg( 'linksearch-text', '<nowiki>' . $wgLang->commaList( $wgUrlProtocols ) . '</nowiki>' ); |
51 | 53 | $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) . |
52 | 54 | Xml::hidden( 'title', $self->getPrefixedDbKey() ) . |
Property changes on: branches/REL1_16/phase3/includes/specials |
___________________________________________________________________ |
Modified: svn:mergeinfo |
53 | 55 | Merged /trunk/phase3/includes/specials:r79561 |
Index: branches/REL1_16/phase3/includes/Skin.php |
— | — | @@ -413,7 +413,7 @@ |
414 | 414 | 'wgUserGroups' => $wgUser->isAnon() ? null : $wgUser->getEffectiveGroups(), |
415 | 415 | 'wgUserLanguage' => $wgLang->getCode(), |
416 | 416 | 'wgContentLanguage' => $wgContLang->getCode(), |
417 | | - 'wgBreakFrames' => $wgBreakFrames, |
| 417 | + 'wgBreakFrames' => $wgOut->getFrameOptions() == 'DENY', |
418 | 418 | 'wgCurRevisionId' => isset( $wgArticle ) ? $wgArticle->getLatest() : 0, |
419 | 419 | 'wgVersion' => $wgVersion, |
420 | 420 | 'wgEnableAPI' => $wgEnableAPI, |
Property changes on: branches/REL1_16/phase3/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
421 | 421 | Merged /trunk/phase3/includes:r79561 |
Property changes on: branches/REL1_16/phase3/profileinfo.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
422 | 422 | Merged /trunk/phase3/profileinfo.php:r79561 |
Index: branches/REL1_16/phase3/config/Installer.php |
— | — | @@ -25,6 +25,7 @@ |
26 | 26 | |
27 | 27 | error_reporting( E_ALL | E_STRICT ); |
28 | 28 | header( "Content-type: text/html; charset=utf-8" ); |
| 29 | +header( 'X-Frame-Options: DENY' ); |
29 | 30 | @ini_set( "display_errors", true ); |
30 | 31 | |
31 | 32 | # In case of errors, let output be clean. |
Property changes on: branches/REL1_16/phase3/languages/messages/MessagesEn.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
32 | 33 | Merged /trunk/phase3/languages/messages/MessagesEn.php:r79561 |
Property changes on: branches/REL1_16/phase3/languages/classes/LanguageSe.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
33 | 34 | Merged /trunk/phase3/languages/classes/LanguageSe.php:r79561 |
Index: branches/REL1_16/phase3/RELEASE-NOTES |
— | — | @@ -57,6 +57,9 @@ |
58 | 58 | active or exec() and similar functions are disabled. |
59 | 59 | * (bug 19593) Specifying --server in now works for all maintenance scripts. |
60 | 60 | * Fixed $wgLicenseTerms register globals. |
| 61 | +* (bug 26561) Fixed clickjacking vulnerabilities by introducing support for |
| 62 | + X-Frame-Options. The header value can be configured using $wgBreakFrames and |
| 63 | + $wgEditPageFrameOptions. |
61 | 64 | |
62 | 65 | == Changes since 1.16 beta 3 == |
63 | 66 | |
Property changes on: branches/REL1_16/phase3 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
64 | 67 | Merged /trunk/phase3:r79561 |