From 13169c88c11470146326e0123d2e762948edbe2f Mon Sep 17 00:00:00 2001 From: Reedy Date: Thu, 22 Mar 2012 19:52:37 +0000 Subject: [PATCH] * (bug 34212) ApiBlock/ApiUnblock allow action to take place without a token parameter present * (bug 35317) CSRF in Special:Upload Revert r56793, which removed the CSRF check for Special:Upload for normal file uploads. Cross-site posting of file uploads without user interaction has been possible since at least as early as Chrome 8 (late 2010) and Firefox 6 (mid 2011). Commonist has used api.php since version 0.4.0 (April 2010), and the API already requires an edit token, so Commonist 0.4.0+ is not affected by this change. * (bug 34907) Fix for CSRF vulnerability due to mw.user.tokens. Patch by Roan Kattouw and Tim Starling. * Filter out private modules early in ResourceLoader::makeResponse() and just pretend they weren't specified. This means these modules cannot be loaded through load.php . This filtering must not happen in makeModuleResponse(), because that would break inlining. * Force inlining of private modules in OutputPage::makeResourceLoaderLink(), disregarding $wgResourceLoaderInlinePrivateModules * Remove $wgResourceLoaderInlinePrivateModules * Remove special treatment of private modules ($private) in ResourceLoader::makeResponse() and sendResponseHeaders(), because we're not allowing private modules to be loaded through here any more * Remove identity checks in ResourceLoaderUserOptionsModule and ResourceLoaderUserCSSPrefsModule, they didn't make a lot of sense before but they're certainly useless now. * Factored out error comment construction in ResourceLoader.php and stripped comment terminations from exception messages. I didn't find an XSS vulnerability but it looked scary. Patchset2: Removes whitespace error that prevented automatic merge by Gerrit: includes/resourceloader/ResourceLoaderUserOptionsModule.php Change-Id: I2dec8b8caf9db3c64919763865cc10cccdd6a1a3 --- includes/DefaultSettings.php | 7 --- includes/OutputPage.php | 11 ++-- includes/api/ApiMain.php | 2 +- includes/resourceloader/ResourceLoader.php | 51 ++++++++++--------- .../ResourceLoaderUserCSSPrefsModule.php | 29 ++--------- .../ResourceLoaderUserOptionsModule.php | 28 ++-------- includes/specials/SpecialUpload.php | 9 +--- 7 files changed, 40 insertions(+), 97 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e214b7b302..1ca2aba37d 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2581,13 +2581,6 @@ $wgResourceLoaderMaxage = array( ), ); -/** - * Whether to embed private modules inline with HTML output or to bypass - * caching and check the user parameter against $wgUser to prevent - * unauthorized access to private modules. - */ -$wgResourceLoaderInlinePrivateModules = true; - /** * The default debug mode (on/off) for of ResourceLoader requests. This will still * be overridden when the debug URL parameter is used. diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 47f6641619..a044c5512f 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2505,7 +2505,7 @@ $templates * @return string html