From ccfe5ad97b2d4dce3f6214cc8826ae9a2c0d80fb Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 4 Jan 2011 06:12:33 +0000 Subject: [PATCH] Fix for bug 26561: clickjacking attacks. See the bug report for full documentation. --- includes/Article.php | 6 +++ includes/DefaultSettings.php | 25 ++++++++++- includes/HTMLForm.php | 3 ++ includes/HistoryPage.php | 20 +++++++++ includes/ImagePage.php | 26 ++++++++++++ includes/OutputPage.php | 42 +++++++++++++++++++ includes/Skin.php | 1 + includes/diff/DifferenceEngine.php | 5 +++ includes/installer/WebInstallerOutput.php | 3 +- .../ResourceLoaderStartUpModule.php | 3 +- includes/specials/SpecialAllpages.php | 1 + includes/specials/SpecialCategories.php | 1 + includes/specials/SpecialContributions.php | 10 +++++ includes/specials/SpecialLinkSearch.php | 1 + includes/specials/SpecialSearch.php | 3 +- includes/specials/SpecialSpecialpages.php | 2 + includes/specials/SpecialVersion.php | 1 + 17 files changed, 147 insertions(+), 6 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 3355b0138d..3b7780fe5a 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -886,6 +886,9 @@ class Article { return; } + # Allow frames by default + $wgOut->allowClickjacking(); + if ( !$wgUseETag && !$this->mTitle->quickUserCan( 'edit' ) ) { $parserOptions->setEditSection( false ); } @@ -1304,6 +1307,7 @@ class Article { $sk = $wgUser->getSkin(); $token = $wgUser->editToken( $rcid ); + $wgOut->preventClickjacking(); $wgOut->addHTML( "