Page MenuHomePhabricator

XSS from wikitext when $wgArticlePath='$1'
Closed, ResolvedPublic

Description

When $wgArticlePath is set to '$1', it's trivially possible to execute XSS attacks:

  • Create a page named javascript:alert('XSS!')
  • Add a wikilink to that page on another one: [[javascript:alert('XSS!')]]

Since $wgArticlePath is not absolute, this will generate <a href="javascript:alert('XSS!')" ...>.

Note that $wgArticlePath = '$1' is a pretty broken configuration setting and unlikely to result in a fully functional wiki, but people desperately grappling with short URLs might end up setting that. On master, it seems to cause infinite redirect loops (probably due to 155d555b83eca6403e07d2094b074a8ed2f301ae?), but I was able to view pages with that setting on MediaWiki 1.25.

It seems that T48998 is an old bug pointing out that some $wgArticlePaths just shouldn't be allowed (with a patch).


patches:

affected versions:
type: XSS
CVE: CVE-2015-8622

Event Timeline

matmarex raised the priority of this task from to Needs Triage.
matmarex updated the task description. (Show Details)
matmarex changed the visibility from "Public (No Login Required)" to "Custom Policy".
matmarex changed the edit policy from "All Users" to "Custom Policy".
matmarex changed Security from None to Software security bug.
matmarex subscribed.

Would be fixed with https://gerrit.wikimedia.org/r/135196

@Bawolff is going to +2 that, and we'll backport it for the next security release to address the issue.

Ok, I've +2'd that patch.

I'm not putting any backports into gerrit now, as I assume we're going to wait until the security release, so as to not draw any attention to this.

Somebody should probably delete the earlier comment with the list of vulnerable wikis before this is publicised, or get them all to upgrade :)

Somebody should probably delete the earlier comment with the list of vulnerable wikis before this is publicised, or get them all to upgrade :)

Did the former to be extra safe and not call them out.

demon changed the visibility from "Custom Policy" to "Public (No Login Required)".
demon changed the edit policy from "Custom Policy" to "All Users".
demon changed Security from Software security bug to None.