Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F10721842
0001-T178451-REL1_28.patch
Reedy (Sam Reed)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
Reedy
Nov 11 2017, 1:02 AM
2017-11-11 01:02:01 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
0001-T178451-REL1_28.patch
View Options
From e5c3f71503a29e138afa45ebf271c748d3a3280b Mon Sep 17 00:00:00 2001
From: Brian Wolff <bawolff+wn@gmail.com>
Date: Wed, 18 Oct 2017 05:28:43 +0000
Subject: [PATCH] SECURITY: Escape internal error message
This message contains the request url, which is semi-user controlled.
Most browsers percent escape < and > so its probably not exploitable
(curl is an exception here), but nonetheless its not good.
Bug: T178451
Change-Id: I19358471ddf1b28377aad8e0fb54797c817bb6f6
---
RELEASE-NOTES-1.28 | 2 ++
includes/exception/MWException.php | 16 +++++++++-------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28
index b916d23768..870f9c33ab 100644
--- a/RELEASE-NOTES-1.28
+++ b/RELEASE-NOTES-1.28
@@ -17,6 +17,8 @@ This is not a release yet!
* (T160298) Remove use of implicitGroupBy() in ActiveUsersPager.
* (T174255) Declare uploadCount property in importDump.php.
* Updated dev dependancy phpunit/phpunit from v4.8.24 to v4.8.36.
+* (T178451) SECURITY: Potential XSS when $wgShowExceptionDetails = false and browser
+ sends non-standard url escaping.
== MediaWiki 1.28.1 ==
diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php
index e958c9449f..93952c9795 100644
--- a/includes/exception/MWException.php
+++ b/includes/exception/MWException.php
@@ -114,13 +114,15 @@ class MWException extends Exception {
$logId = WebRequest::getRequestId();
$type = get_class( $this );
return "<div class=\"errorbox\">" .
- '[' . $logId . '] ' .
- gmdate( 'Y-m-d H:i:s' ) . ": " .
- $this->msg( "internalerror-fatal-exception",
- "Fatal exception of type $1",
- $type,
- $logId,
- MWExceptionHandler::getURL( $this )
+ htmlspecialchars(
+ '[' . $logId . '] ' .
+ gmdate( 'Y-m-d H:i:s' ) . ": " .
+ $this->msg( "internalerror-fatal-exception",
+ "Fatal exception of type $1",
+ $type,
+ $logId,
+ MWExceptionHandler::getURL( $this )
+ )
) . "</div>\n" .
"<!-- Set \$wgShowExceptionDetails = true; " .
"at the bottom of LocalSettings.php to show detailed " .
--
2.14.1
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5081417
Default Alt Text
0001-T178451-REL1_28.patch (2 KB)
Attached To
Mode
T168823: Tracking bug for 1.27.4/1.28.3/1.29.2 security releases
Attached
Detach File
T178451: XSS when $wgShowExceptionDetails=false and browser sends non-standard url escaping
Attached
Detach File
Event Timeline
Log In to Comment