API: Make output containing private or user-specific data uncacheable for logged...
authorRoan Kattouw <catrope@users.mediawiki.org>
Wed, 14 Jul 2010 19:00:54 +0000 (19:00 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Wed, 14 Jul 2010 19:00:54 +0000 (19:00 +0000)
commit70824ccccc29d78da6b5e8bda892d18d1ab347f0
tree3a79abe70ed4b2fb7e4c1a586dadf85a4488080d
parent1b1d821d16b5a69ca120203f8e3053a77d193441
API: Make output containing private or user-specific data uncacheable for logged-in users by setting Vary: Cookie or Cache-Control: private, whichever is appropriate. Fixes instances in core and WMF-deployed extensions only. Without this change, the output of requests like ?action=query&list=recentchanges&rcprop=patrolled&smaxage=3600 would be cached in Squid and viewable for anyone using the same URL, even if they don't have patrol rights. Other, more serious exploits are also possible. Also avoid using $wgUser in one place, kill some unused global $wgUser; instances and tweak a comment.
18 files changed:
includes/api/ApiBase.php
includes/api/ApiLogout.php
includes/api/ApiMain.php
includes/api/ApiParse.php
includes/api/ApiPatrol.php
includes/api/ApiPurge.php
includes/api/ApiQueryAllmessages.php
includes/api/ApiQueryBlocks.php
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryFilearchive.php
includes/api/ApiQueryInfo.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQueryRevisions.php
includes/api/ApiQueryUserContributions.php
includes/api/ApiQueryUserInfo.php
includes/api/ApiQueryUsers.php
includes/api/ApiQueryWatchlist.php
includes/api/ApiWatch.php