Skip to content

Commit

Permalink
SECURITY: DifferenceEngine: hide diff-multi-sameuser message for supr…
Browse files Browse the repository at this point in the history
…essed revisions

CVE-2023-PENDING

reduce the edit count if a user for a given revision is suppress-deleted

Bug: T341529
Change-Id: I79539464cf3500065cb4f42e1542ff5feec31395
  • Loading branch information
Maryum Styles authored and reedy committed Sep 28, 2023
1 parent b889a91 commit 3cc1781
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion includes/diff/DifferenceEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -1675,12 +1675,22 @@ public function getMultiNotice() {

// Don't show the notice if too many rows must be scanned
// @todo show some special message for that case
$nEdits = $this->revisionStore->countRevisionsBetween(
$nEdits = 0;
$revisionIdList = $this->revisionStore->getRevisionIdsBetween(
$this->mNewPage->getArticleID(),
$oldRevRecord,
$newRevRecord,
1000
);
// only count revisions that are visible
if ( count( $revisionIdList ) > 0 ) {
foreach ( $revisionIdList as $revisionId ) {
$revision = $this->revisionStore->getRevisionById( $revisionId );
if ( $revision->getUser( RevisionRecord::FOR_THIS_USER, $this->getAuthority() ) ) {
$nEdits++;
}
}
}
if ( $nEdits > 0 && $nEdits <= 1000 ) {
// Use an invalid username to get the wiki's default gender (as fallback)
$newRevUserForGender = '[HIDDEN]';
Expand Down

0 comments on commit 3cc1781

Please sign in to comment.