Require strip marker names to not have & ' " < or > in them
authorBrian Wolff <bawolff+wn@gmail.com>
Fri, 29 Jan 2016 09:46:32 +0000 (04:46 -0500)
committerBrian Wolff <bawolff+wn@gmail.com>
Tue, 26 Apr 2016 17:53:26 +0000 (13:53 -0400)
commit939faea318d9c2107fab3a584bc1c023f3c592e9
treec69e70b50784f1b7d54e4559c02fb7e0ba4df9ae
parent0d4e0ca543b821636ec9aa98442b35bd1105f2f9
Require strip marker names to not have & ' " < or > in them

This is a little far fetched, but meant as a hardening step. No
valid strip marker name should have any of those things in them.
If a malicious user managed to somehow control the strip marker name,
he could make a strip marker that "spanned" different html contexts.
Note: I've checked carefully - its impossible for a user to control
the strip marker name. This is just a hardening step against any
future features.

For example, if someone could make a strip marker using the marker
name "a&#039;,&#039;b", then they could create an xss by feeding
"\x7UNIQfa+QINU\x7f" to charinsert, which will split on + sign,
and create output like
<a onclick="mw.toolbar.insertTags(&#039\x7FUNIQa&#039;,&#039;bQIN\X7f...
It just seems safer to not allow any of the special characters in
strip marker names - especially because there is no need to ever
use them, and to my knowledge there is no example of anyone ever
actually using such a special character in the marker name.
and not recognize either part as a strip marker.

Change-Id: I798d31aff4e48b4c6da886530c15867226c953d2
includes/parser/StripState.php