SECURITY: Ensure Message::rawParams can't lead to XSS
authorBrian Wolff <bawolff+wn@gmail.com>
Sun, 24 Sep 2017 00:57:05 +0000 (00:57 +0000)
committerReedy <reedy@wikimedia.org>
Wed, 15 Nov 2017 02:36:48 +0000 (02:36 +0000)
commit410c00a9ae92411d3d1568e84c4aa2579a577635
treeb11e258017ea604e78e7c3a4335dcfcfd2903d88
parent492431bce57aac2a995ea468a9e273b6423cde81
SECURITY: Ensure Message::rawParams can't lead to XSS

If you used wfMessage( 'foo' )->rawParams( 'bar"baz' )
there's a possibility of leading to xss, if the foo
message has a $1 in an attribute, as the quote characters
may end the attribute.

To prevent that, we convert $1 to $'"1 for after parameters,
so if any of them end up in attributes, the attribute escaping
will break the parameter name, preventing substitution.

This would of course break if someone intentionally inserted
a raw parameter into an attribute, but that's silly and I
don't think we should allow that.

This is similar to the parser strip marker issue.

Bug: T176247
Change-Id: If83aec01b20e414f9c92be894f145d7df2974866
includes/Message.php