Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F4326058
T125163-REL1_23
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
Bawolff
Aug 1 2016, 12:18 PM
2016-08-01 12:18:51 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
T125163-REL1_23
View Options
From 81272e26e3c355031852bc81c909dbecb86d8226 Mon Sep 17 00:00:00 2001
From: Brian Wolff <bawolff+wn@gmail.com>
Date: Thu, 28 Jan 2016 18:04:01 -0500
Subject: [PATCH] Make anchor for headlines escape > and <
As a hardening step against language converter and its crazy regexes.
Change-Id: I0d253611fbb8d12cb5c937e36fdb122efe186943
---
includes/Linker.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/includes/Linker.php b/includes/Linker.php
index d9e8b6d..49207c9 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -1722,11 +1722,13 @@ class Linker {
* @return string HTML headline
*/
public static function makeHeadline( $level, $attribs, $anchor, $html, $link, $legacyAnchor = false ) {
+ $anchor = htmlspecialchars( $anchor );
$ret = "<h$level$attribs"
. "<span class=\"mw-headline\" id=\"$anchor\">$html</span>"
. $link
. "</h$level>";
if ( $legacyAnchor !== false ) {
+ $legacyAnchor = htmlspecialchars( $legacyAnchor );
$ret = "<div id=\"$legacyAnchor\"></div>$ret";
}
return $ret;
--
1.9.5 (Apple Git-50.3)
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3896753
Default Alt Text
T125163-REL1_23 (1 KB)
Attached To
Mode
T125163: id attribute on headlines allow raw > [Possible issue in combination with language converter] (CVE-2017-8812)
Attached
Detach File
Event Timeline
Log In to Comment