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)
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


No differences found