Page MenuHomePhabricator

CVE-2024-47840: Stored XSS through sidebar in Apex skin
Closed, ResolvedPublicSecurity

Description

Apex renders the sidebar without any form of escaping. Interface admins or others with access to MediaWiki:Sidebar can exploit this. The issue can be reproduced with code like '><script>alert('sidebar-custom');</script><'.

Event Timeline

Seeing as the skin is not actively maintained and the original author has been away for a long time now, would the Security Team be able to merge a patch to this?

Also, this is actually the same issue as T361452; are similar cases being tracked anywhere?

mmartorana changed the task status from Open to In Progress.EditedJul 23 2024, 3:54 PM
mmartorana triaged this task as Medium priority.
mmartorana changed Risk Rating from N/A to Low.
mmartorana subscribed.
In T370081#9982471, @R4356th wrote:

Seeing as the skin is not actively maintained and the original author has been away for a long time now, would the Security Team be able to merge a patch to this?

Also, this is actually the same issue as T361452; are similar cases being tracked anywhere?

Hi, the Security-Team is happy to review and merge any patch for this issue; however, we do not plan to actively work on developing a patch ourselves.

Thanks

Hi @mmartorana, apologies for the late reply. To be clear, I was not asking if the Security Team would be willing to develop a patch at all; I just wanted to know if you would be willing to merge it. Anyway, I am glad to hear you are, so here is the patch. Considering this issue requires elevated access, I think pushing this to Gerrit would be fine. Thanks for your time.

In T370081#10069490, @R4356th wrote:

+1 for the specific escape of Sanitizer::escapeIdForAttribute( "p-$name" ) here. Though I didn't review the code to determine if there are any additional XSS sinks at this time...

+1 for the specific escape of Sanitizer::escapeIdForAttribute( "p-$name" ) here. Though I didn't review the code to determine if there are any additional XSS sinks at this time...

Thanks, I have pentested to make sure it's fine. Are you fine with me pushing this to Gerrit now?

In T370081#10071391, @R4356th wrote:

Thanks, I have pentested to make sure it's fine. Are you fine with me pushing this to Gerrit now?

Yes, that's fine. In general, as long as the code isn't bundled or Wikimedia-production-deployed, it's fine to push security fixes publicly and get them merged. We try to (re-)announce issues like this via the supplemental security releases - I've added this issue to the tracking task for the next supplemental release: T368628.

Change #1064405 had a related patch set uploaded (by R4356thwiki; author: R4356thwiki):

[mediawiki/skins/apex@master] Bug: T370081

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

Change #1064405 had a related patch set uploaded (by R4356thwiki; author: R4356thwiki):

[mediawiki/skins/apex@master] SECURITY: Escape MediaWiki:Sidebar before rendering

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

Change #1064405 merged by jenkins-bot:

[mediawiki/skins/apex@master] SECURITY: Escape MediaWiki:Sidebar before rendering

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

Change #1071635 had a related patch set uploaded (by R4356thwiki; author: R4356thwiki):

[mediawiki/skins/apex@REL1_40] SECURITY: Escape MediaWiki:Sidebar before rendering

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

Change #1071635 abandoned by R4356thwiki:

[mediawiki/skins/apex@REL1_40] SECURITY: Escape MediaWiki:Sidebar before rendering

Reason:

Whoops, didn't realise 1.40 is EOL

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

Change #1071636 had a related patch set uploaded (by R4356thwiki; author: R4356thwiki):

[mediawiki/skins/apex@REL1_42] SECURITY: Escape MediaWiki:Sidebar before rendering

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

Change #1071636 merged by jenkins-bot:

[mediawiki/skins/apex@REL1_42] SECURITY: Escape MediaWiki:Sidebar before rendering

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

Mstyles renamed this task from Stored XSS through sidebar in Apex skin to CVE-2024-47840: Stored XSS through sidebar in Apex skin.Oct 5 2024, 12:53 AM
Mstyles closed this task as Resolved.
Mstyles claimed this task.
Mstyles changed the visibility from "Custom Policy" to "Public (No Login Required)".
Mstyles changed the edit policy from "Custom Policy" to "All Users".