| JJMC89 |
| Feb 18 2018, 4:51 AM |
| F14400052: T187638-v2.patch |
| Mar 5 2018, 3:11 AM |
| F13975535: T187638.patch |
| Feb 23 2018, 9:56 PM |
Description
On the English Wikipedia links to https://en.wikipedia.org/w/index.php?title=Special%3ALog&limit=1&offset=20180216090941&type=rights&user=Oshwah, which shows
reveals the hidden user. The information may also be suppressed.
Linking to https://en.wikipedia.org/w/index.php?title=Special%3ALog&limit=1&offset=20180216090941&type=rights shows the correct log event.
{ "batchcomplete": "", "query": { "logevents": [ { "logid": 89126214, "actionhidden": "", "type": "rights", "action": "rights", "userhidden": "", "timestamp": "2018-02-16T09:09:40Z", "comment": "Confirmed as recently active IP. Granting 'confirmed' flag manually." } ] } }
{ "batchcomplete": "", "continue": { "lecontinue": "20180214180709|89093360", "continue": "-||" }, "query": { "logevents": [ { "logid": 89126301, "ns": -1, "title": "Special:Log/rights", "pageid": 0, "logpage": 0, "params": { "type": "logging", "ids": [ "89126214" ], "old": { "bitmask": 0 }, "new": { "bitmask": 5, "content": "", "user": "" } }, "type": "delete", "action": "event", "user": "Oshwah", "timestamp": "2018-02-16T09:18:12Z", "comment": "[[WP:RD5|RD5]]: Other valid deletion under [[WP:DEL#REASON|deletion policy]]" } ] } }
Special:Redirect/logid was implemented in rMW1b294bd3c538: Make Special:Redirect page redirect to log events by ID for T71107: Allow browsing log events by log ID.
Details
Related Objects
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | Reedy | T199021 Release MediaWiki 1.27.5/1.29.3/1.30.1/1.31.1 | |||
| Resolved | Reedy | T181665 Tracking bug for 1.27.5/1.29.3/1.30.1/1.31.1 security release | |||
| Resolved | Samwilson | T187638 When a log event is (partially) hidden Special:Redirect/logid can link to the incorrect log and reveal hidden information (CVE-2018-0504) |
- Mentioned In
- T230402: Exposed suppressed username via Special:Redirect
T199027: Obtain CVEs for 1.27.5/1.29.3/1.30.1/1.31.1 security releases
T199021: Release MediaWiki 1.27.5/1.29.3/1.30.1/1.31.1
T181665: Tracking bug for 1.27.5/1.29.3/1.30.1/1.31.1 security release
T188145: Special:Log implements revdel restrictions incorrectly when filtering on log type or log author - Mentioned Here
- T191608: markasread param doesn't work for log entry thanks
rMW27c61fb1e94d: Add `actor` table and code to start using it
T188145: Special:Log implements revdel restrictions incorrectly when filtering on log type or log author
rMW1b294bd3c538: Make Special:Redirect page redirect to log events by ID
T71107: Allow browsing log events by log ID
Event Timeline
Apologies if this shouldn't be a Security task.
In T187638#3981346, @JJMC89 wrote:Apologies if this shouldn't be a Security task.
This definitely is a security task (leaking secret info)
Thank you for reporting this.
)
There's also an issue with Special:redirect/user if the user has been revdel'd
Code-Review-1
+ 'log_type' => LogPage::DELETED_ACTION,
We were discussing this on T188145, I don't think this is correct.
+ // get rid of log_id and log_deleted. + array_shift( $logparams ); array_shift( $logparams );
This should probably just use .
+ if ( !LogEventsList::userCan( + $rowMain, $fieldToBitsMapping[$cond], $user + ) ) { + // This field is redacted for main log entry, + // so treat as always matching. + $matchedRows[] = $row; + continue; + }
This could go outside the inner loop, just assign and continue. If you change the code below to use instead of , you could even skip the assignment.
Also, won't this and the bits below generate undefined index warnings when trying to access for ?
Thanks for the review. PS2:
- array_shift( $logparams ); + // get rid of log_id and log_deleted. + unset( $logparams[0] ); + unset( $logparams[1] );
Huh? $logparams doesn't have a [0] or [1] ... Oh, I see, this needs a rebase on top of rMW27c61fb1e94d: Add `actor` table and code to start using it.
+ if ( + $logKey === 'log_user_text' && + !LogEventsList::userCan( + $rowMain, LogPage::DELETED_USER, $user + ) + ) { + continue; + } $query[$keys[$logKey]] = $matchedRows[0]->$logKey;
I'd prefer it if you used either or consistently here.
Could this be fixed by removing the log look-up entirely from Special:Redirect and having a log-ID parameter to Special:Log? (Have done so in https://gerrit.wikimedia.org/r/#/c/428265/ for T191608).
In T187638#4151786, @Samwilson wrote:Could this be fixed by removing the log look-up entirely from Special:Redirect and having a log-ID parameter to Special:Log? (Have done so in https://gerrit.wikimedia.org/r/#/c/428265/ for T191608).
Do we want to backport this patch then?
Done in https://gerrit.wikimedia.org/r/#/q/I5f2e52531cd2ba617a25570e40aa8c5168e284d9
Does this patch fix the bug fully on it's own then?
Closing as patches merged.
To be opened up to public with security release
