Reserve data-mw and data-parsoid attribute prefix for trusted values
authorBrian Wolff <bawolff+wn@gmail.com>
Fri, 13 Nov 2015 04:24:52 +0000 (23:24 -0500)
committerLegoktm <legoktm.wikipedia@gmail.com>
Wed, 9 Dec 2015 06:47:49 +0000 (06:47 +0000)
commitb62f0e91564f1e1cb88c8dc063845bc1459e79ab
tree076d003bfe083083f90d845e04d3e133fe051347
parente1ebc2de02efbaf9183a48359b0025b04de9c5e4
Reserve data-mw and data-parsoid attribute prefix for trusted values

Don't let users set attributes starting with data-mw or data-parsoid.
The main idea is to allow MediaWiki to use data-mw-<something>
attributes for trusted input to client side scripts. There have
been a couple security vulnerabilities in the past based on users
being able to manipulate a data attribute, which client side was
assuming was trusted.

Also include data-mw and data-parsoid as both are used by Parsoid
currently.

See https://lists.wikimedia.org/pipermail/wikitech-l/2015-November/083811.html

A corresponding change will also have to be made in Parsoid.

Change-Id: I06585380bde3bc57b17ad76740c5acc2056d7c44
includes/Sanitizer.php
tests/parser/parserTests.txt