Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F31061327
T237887.patch
Urbanecm
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Urbanecm
Nov 10 2019, 10:14 PM
2019-11-10 22:14:31 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
T237887.patch
View Options
From 732d145eb76f586b40405f49f1e6316bb99683c1 Mon Sep 17 00:00:00 2001
From: Martin Urbanec <martin.urbanec@wikimedia.cz>
Date: Sun, 10 Nov 2019 23:11:34 +0100
Subject: [PATCH] SECURITY: Make sure provided filter id match provided history
ID in history view
AbuseFilterViewEdit does privilege checks based on filter ID,
and displays what is hidden under given history ID, but doesn't
make sure those two IDs actually belong to one filter.
That means user can easily change filter ID to a public
filter, and view any version of any filter, even if restricted.
Bug: T237887
Change-Id: Ic12790bd33982473f77551bde9599ed083a3e1f1
---
includes/Views/AbuseFilterViewEdit.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/includes/Views/AbuseFilterViewEdit.php b/includes/Views/AbuseFilterViewEdit.php
index 8dd4eb7c..26d3cd75 100644
--- a/includes/Views/AbuseFilterViewEdit.php
+++ b/includes/Views/AbuseFilterViewEdit.php
@@ -156,6 +156,10 @@ class AbuseFilterViewEdit extends AbuseFilterView {
// Load from request OR database.
list( $row, $actions ) = $this->loadRequest( $filter, $history_id );
+ if ( $row->af_id !== $filter ) {
+ throw new MWException( "Filter ID $history_id doesn't match filter ID $filter" );
+ return;
+ }
if ( !$row ) {
$out->addHTML(
--
2.17.1
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8199958
Default Alt Text
T237887.patch (1 KB)
Attached To
Mode
T237887: Old public versions of private filters are publicly viewable (CVE-2019-18987)
Attached
Detach File
Event Timeline
Log In to Comment