Page MenuHomePhabricator

CVE-2025-32067: i18n XSS vulnerability in message growthexperiments-homepage-suggestededits-tasktype-description-link-recommendation
Closed, ResolvedPublicSecurity

Description

Discovered with $wgUseXssLanguage. (See T340201: Use custom language code to find i18n XSS issues)

To reproduce:

  • visit Special:Homepage with ?uselang=x-xss

Details

Risk Rating
Medium
Author Affiliation
WMF Product
Related Changes in Gerrit:

Event Timeline

I also tried to check our VisualEditor integration, but that didn't load at all, with the following error:

Uncaught Error: Syntax error, unrecognized expression: [accesskey="<script>alert('accesskey-save')</script>"><script>alert('accesskey-save')</script><x y="()"]

Should we have an extra task for that?

Urbanecm_WMF triaged this task as High priority.EditedFeb 21 2025, 9:30 AM

Same vulnerability is in growthexperiments-homepage-suggestededits-tasktype-description-*, according to the code.

Urbanecm_WMF edited projects, added Growth-Team (Current Sprint); removed Growth-Team.
Urbanecm_WMF moved this task from Incoming to Code Review on the Growth-Team (Current Sprint) board.

Fix is below:

@Michael (or other engineers), do you mind giving it a +2?

I also tried to check our VisualEditor integration, but that didn't load at all, with the following error:

Uncaught Error: Syntax error, unrecognized expression: [accesskey="<script>alert('accesskey-save')</script>"><script>alert('accesskey-save')</script><x y="()"]

Should we have an extra task for that?

Probably. That feels like an issue in VisualEditor itself, but I'm unsure if it also has security implications.

Fix is below:

@Michael (or other engineers), do you mind giving it a +2?

I'm a bit surprised that we only adjust the method for the description to parse. Are the others escaped client-side?

I'm a bit surprised that we only adjust the method for the description to parse. Are the others escaped client-side?

That is correct. As far as I can see, only the description is displayed using $( '<p>' ).html( this.taskTypeData.messages.description ). All other parts are displayed using the text() method, for example:

$( tagName )
	.addClass( 'suggested-edits-task-explanation-heading' )
	.text( this.taskTypeData.messages.name )

Relevant code seems to be modules/ext.growthExperiments.Homepage.SuggestedEdits/TaskExplanationWidget.js.

I wouldn't mind moving the escaping to a single location (all server side or all client side), but that should be probably done in a separate (public) patch.

I'm a bit surprised that we only adjust the method for the description to parse. Are the others escaped client-side?

That is correct. As far as I can see, only the description is displayed using $( '<p>' ).html( this.taskTypeData.messages.description ). All other parts are displayed using the text() method, for example:

$( tagName )
	.addClass( 'suggested-edits-task-explanation-heading' )
	.text( this.taskTypeData.messages.name )

Relevant code seems to be modules/ext.growthExperiments.Homepage.SuggestedEdits/TaskExplanationWidget.js.

I wouldn't mind moving the escaping to a single location (all server side or all client side), but that should be probably done in a separate (public) patch.

Thanks! That explanation and the fact that I did not observe any alerts from any of the other message keys is good enough for me. I'm hereby giving a virtual +2 to @Urbanecm_WMF's change.

10:08 <urbanecm> !log Deployed security patch for T386963
10:09 <+stashbot> Logged the message at https://wikitech.wikimedia.org/wiki/Server_Admin_Log

Deployed to production.

@sbassett, is it OK to backport in Gerrit and publish the task?

@sbassett, is it OK to backport in Gerrit and publish the task?

Sure.

sbassett changed the visibility from "Custom Policy" to "Public (No Login Required)".Feb 24 2025, 3:31 PM
sbassett changed the edit policy from "Custom Policy" to "All Users".
sbassett changed Risk Rating from N/A to Medium.

Change #1122163 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] SECURITY: Fix XSS in Suggested edits

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

Change #1122163 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] SECURITY: Fix XSS in Suggested edits

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

Mstyles renamed this task from i18n XSS vulnerability in message growthexperiments-homepage-suggestededits-tasktype-description-link-recommendation to CVE-2025-32067: i18n XSS vulnerability in message growthexperiments-homepage-suggestededits-tasktype-description-link-recommendation.Apr 11 2025, 5:06 PM