Page MenuHomePhabricator

XSS in Flow topic titles
Closed, ResolvedPublic

Description

Split from T120291#1850816:

I wasn't able to trigger an XSS in the Echo flyout, but I was in Flow...

Screenshot from 2015-12-03 14-58-35.png (1×1 px, 179 KB)
Screenshot from 2015-12-03 14-59-57.png (1×1 px, 245 KB)

Simply put <script>alert(1)</script> in a topic title.

Event Timeline

Catrope raised the priority of this task from to Unbreak Now!.
Catrope updated the task description. (Show Details)
Catrope added subscribers: Catrope, Legoktm.

Change 256858 had a related patch set uploaded (by Catrope):
[SECURITY] Escape HTML characters in topic titles

https://gerrit.wikimedia.org/r/256858

Change 256867 had a related patch set uploaded (by CSteipp):
Add warning comment on formatLinksInComment

https://gerrit.wikimedia.org/r/256867

Change 256858 merged by jenkins-bot:
[SECURITY] Escape HTML characters in topic titles

https://gerrit.wikimedia.org/r/256858

Change 256867 merged by jenkins-bot:
Add warning comment on formatLinksInComment

https://gerrit.wikimedia.org/r/256867

I audited the other callers of Linker::formatLinksInComment() (CentralAuth and LQT) and they both call the Sanitizer first properly. I'll leave it to either @Catrope or @csteipp to mark this as resolved.

The issue is resolved, so I'm going to close this.

SBisson, if there are ways I can support the Collab team's QA process to make sure we don't have this happen again, let me know. Let's make that a followup phab task, if there's anything we can identify.

Etonkovidova subscribed.

Checked in betalabs - title, reply, board description, summary look fine.

There is the same issue with displaying html in a topic title as in T119537: Links in Flow topic titles: html code displayed when page scrolls up

SBisson, if there are ways I can support the Collab team's QA process to make sure we don't have this happen again, let me know. Let's make that a followup phab task, if there's anything we can identify.

It's a good question. @Etonkovidova, our QA, might have some ideas.

Please review the following - any suggestions(follow-up bugs/more testing) are welcomed.

Tested on test.wikipedia.org

dataFlow topic titlesEcho flyoutNotification page
<code></code>plain textas code textas code text
<script>alert(1)</script>plain textplain textplain text
<tt>plain textis not displayedmonospace; changes all text to monospace
{{release}}plain textred linkred link
<!--T:1-->plain textplain textplain text
<translate>plain textplain textplain text

Red links for templates and <code> text displayed on Notifications page and in Echo.

Screen Shot 2016-01-22 at 7.35.49 AM.png (255×561 px, 54 KB)

Screen Shot 2016-01-22 at 7.57.07 AM.png (555×1 px, 158 KB)

Screen Shot 2016-01-22 at 7.39.47 AM.png (423×562 px, 71 KB)

Monospace in Echo notifications

Screen Shot 2016-01-22 at 7.07.32 AM.png (543×746 px, 100 KB)

<tt> in a topic titles displayed on Notifications page changed all subsequent notification messages font to monospace (and, in fact, all page's fonts)

Screen Shot 2016-01-22 at 7.32.32 AM.png (670×927 px, 78 KB)

Please review the following - any suggestions(follow-up bugs/more testing) are welcomed.

Tested on test.wikipedia.org

Thanks for testing. The *only* markup topic titles support are internal links ([[Earth]]) and media links ([[Media:Saturn.jpg]]).

That means all cells of that table should be plain text.

The red links for templates is only because the template didn't exist. If it did, it would render, which is also wrong (templates are not supported).

Some of this is T120291: wikitext in flow titles is parsed (HTML tags like <tt> and templates) on echo notifications.

@Mattflaschen To clarify, did you re-open due to further security issues, or do you just have related concerns with title handling that do not have security implications.

If its for follow-up things that aren't security, could that be done in a separate bug?

I don't think any of the remaining parts are strictly security.

I'll use T120291: wikitext in flow titles is parsed (HTML tags like <tt> and templates) on echo notifications and file a new bug if I find Flow itself displaying it wrong anywhere.