Page MenuHomePhabricator

Some MediaWiki: messages not safe in HTML (tracking)
Open, MediumPublic

Description

Many MediaWiki: messages are still used as raw HTML output. Strict XML parsing by user agents would make
it very difficult for a sysop modifying them through the wiki to recover from an error which creates invalid
output -- the entire wiki interface can be broken.

Messages should be converted to either plaintext (via htmlspecialchars()) or wikitext which will go through
normalization. (This is an ongoing effort.)

Details

Reference
bz212

Related Objects

StatusSubtypeAssignedTask
OpenNone
ResolvedNone
ResolvedNone
DeclinedNone
InvalidNone
ResolvedNone
Resolvedhashar
ResolvedAmire80
OpenNone
OpenNone
InvalidNone
Resolved Mattflaschen-WMF
Resolvedmatmarex
DeclinedNone
DuplicateNone
ResolvedMtDu
DuplicateNone
ResolvedDevirk
InvalidNone
OpenNone
ResolvedSecuritysbassett
ResolvedSecurityGrunny
ResolvedSecurityGrunny
ResolvedSecuritysbassett
ResolvedSecuritysbassett
ResolvedSecuritysbassett
ResolvedSecuritysbassett
ResolvedSecuritysbassett
ResolvedSecuritysbassett
ResolvedSecurityUmherirrender
Resolvedjhsoby

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

avarab wrote:

Nevermind, the rest of those messages didn't need any modification, applied the
patch to HEAD.

WP:BEANS violation:

  1. GOTO http://en.wikipedia.org/wiki/MediaWiki:Copyright
  2. ADD <img src="/w/api.php?action=logout" />
  3. FLEE

i.e. rouge admin can make everyone forced to log out.

(In reply to comment #7)

WP:BEANS violation:

  1. GOTO http://en.wikipedia.org/wiki/MediaWiki:Copyright
  2. ADD <img src="/w/api.php?action=logout" />
  3. FLEE

i.e. rouge admin can make everyone forced to log out.

You sure about this? I could be wrong, but I just tried it on my localhost and it didn't force a logout.

I think I got most of them with my last commits r50881, r50882 and r50883. Keeping this bug open like this seems not quite useful. What I would like to is mechanism to detect this automatically, something that can be enabled during development. PHP's taint module seems a candidate, but as of now it is not easy to install.

Created bug 19291 for that. Closing this now as INVALID, because this bug cannot be easily fixed as-is.

Reopening as there seems no reason to close it; bug 19291 looks like a request for a tool to aid in working on bug 212 issues.

happy.melon.wiki wrote:

Are there *any* messages that need to allow full (X)HTML?? Pages like the site footer use raw HTMl links, for example: is that still performance-necessary?

(In reply to comment #8)

(In reply to comment #7)

WP:BEANS violation:

  1. GOTO http://en.wikipedia.org/wiki/MediaWiki:Copyright
  2. ADD <img src="/w/api.php?action=logout" />
  3. FLEE

i.e. rouge admin can make everyone forced to log out.

You sure about this? I could be wrong, but I just tried it on my localhost and
it didn't force a logout.

This still apply (just tested) Remember to modify the src="" to match your local install.

Changing subject since we don't support XHTML 1.0 anymore ;).

As an aside, people on wikinews use the raw html in [[mediawiki:Copyright]] to add rdf to the footer, to make them be picked up in google's creative commons content search.

(In reply to comment #15)

As an aside, people on wikinews use the raw html in [[mediawiki:Copyright]]
to
add rdf to the footer, to make them be picked up in google's creative commons
content search.

Raw RDF comments instead of RDFa!!!

Interesting report history. :)

The fact is that nobody seems to be working or planning to work on this. Setting priority to Lowest accordingly.

  • Bug 43646 has been marked as a duplicate of this bug. ***
  • Bug 43646 has been marked as a duplicate of this bug. ***

Converting to tracking bug per bug 43646 comment 6.

Nemo_bis raised the priority of this task from Lowest to Medium.Dec 9 2014, 1:29 PM

Nikerabbit committed a number of patches. https://gerrit.wikimedia.org/r/#/q/topic:esc,n,z

@Nemo_bis: If an end ("task resolved") can ever be clearly defined: epic. If not: tracking. I think the latter.

TTO renamed this task from Many MediaWiki: messages not safe in HTML (tracking) to Some MediaWiki: messages not safe in HTML (tracking).Sep 8 2015, 7:02 AM
TTO updated the task description. (Show Details)
TTO subscribed.

Changed title from "Many" to "Some". A quick unscientific audit (prepending some inline JS to each message string in en.json) hasn't found many raw HTML messages at all. There are probably very few raw HTML messages remaining, I'll file tasks for any I come across and mark them "easy".

T85864 found hundreds just on the extensions enabled at translatewiki.net. There are probably hundreds more.

T85864 found hundreds just on the extensions enabled at translatewiki.net. There are probably hundreds more.

This is a core task, my comment was referring to core only. My apologies for any confusion.

Tgr added a subtask: Restricted Task.Mar 19 2018, 6:50 AM

Dear author @brion, it's prefer to (request to) create tasks instead of opening tracking tasks which are nowadays nonsense under any circumstances.

Should we convert this old-decaded tracking task to a project? Or just archive this task?

One message containing raw html is "MediaWiki:Mobile-frontend-editor-anonwarning". After a discussion on svwiki, I changed the wording of that message locally, i.e. on svwiki and not as a general change on Translatewiki, and while I was at it, I replaced the html with wikitext. It turns out that message is still not possible to edit for others than interface admins. Is that expected behaviour? If so, what have I missed?

One message containing raw html is "MediaWiki:Mobile-frontend-editor-anonwarning". After a discussion on svwiki, I changed the wording of that message locally, i.e. on svwiki and not as a general change on Translatewiki, and while I was at it, I replaced the html with wikitext.

It's not necessary, but not bad either. You were able to edit it because you're interface admin on svwiki, and that's why you couldn't edit it on translatewiki

It turns out that message is still not possible to edit for others than interface admins. Is that expected behaviour? If so, what have I missed?

Yes, and that's why it's not necessary to change them. They are already sort of protected, since very few users can edit them.

There are apparently some conflicting info about this, but that could of course be due to not yet updated pages. So it's correct to say that no system message can be edited locally by others than interface admins?

There are apparently some conflicting info about this, but that could of course be due to not yet updated pages. So it's correct to say that no system message can be edited locally by others than interface admins?

Not all of them. A subset of them. Like the MediaWiki:Mobile-frontend-editor-anonwarning that you mentioned, normal admins cannot edit it, but they can edit MediaWiki:Mobile-frontend-home-button because the former has extra checks that make sure only interface admins can edit it.

So, how do I see which system messages can be edited by all admins?

So, how do I see which system messages can be edited by all admins?

The ones not editable by normal admins are the exception rather than the rule. So you should consider all messages as editable by all admins until you encounter the few non-editable ones. There's no way to know this info from the UI, but you may know when you attempt to edit them without the required permissions.

You may however look them up in the source. The affected messages in core are listed here. Extensions append their own to the array.