Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F34251705
04-T270998-REL1_35.patch
Reedy (Sam Reed)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Reedy
Apr 5 2021, 12:11 AM
2021-04-05 00:11:59 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
04-T270998-REL1_35.patch
View Options
From ddc3ec04af4f7bc6ba7c86ec1a770c00431cc799 Mon Sep 17 00:00:00 2001
From: DannyS712 <dannys712.enwiki@gmail.com>
Date: Fri, 1 Jan 2021 12:40:41 +0200
Subject: [PATCH] SECURITY: ContentModelChange: Check that user can create
pages
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Taavi Väänänen <hi@tassu.me>
Change-Id: I2e3b79f36fa7c0a3ec4130de0ae9c68104cb3fdd
---
includes/content/ContentModelChange.php | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/includes/content/ContentModelChange.php b/includes/content/ContentModelChange.php
index f8becb3d40..801b39463b 100644
--- a/includes/content/ContentModelChange.php
+++ b/includes/content/ContentModelChange.php
@@ -112,7 +112,15 @@ class ContentModelChange {
$titleWithNewContentModel->setContentModel( $this->newModel );
$pm = $this->permManager;
+
+ $creationErrors = [];
+ if ( !$current->exists() ) {
+ $creationErrors = $pm->getPermissionErrors( 'create', $user, $current );
+ }
+
$errors = wfMergeErrorArrays(
+ // Potentially include creation errors, if applicable
+ $creationErrors,
// edit the contentmodel of the page
$pm->getPermissionErrors( 'editcontentmodel', $user, $current ),
// edit the page under the old content model
--
2.20.1
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8965934
Default Alt Text
04-T270998-REL1_35.patch (1 KB)
Attached To
Mode
T270988: CVE-2021-30155: Titleblacklist didn't prevent creation of pages by Special:ChangeContentModel when a rule was met
Attached
Detach File
T270459: Tracking bug for MediaWiki 1.31.13/1.35.2
Attached
Detach File
Event Timeline
Log In to Comment