Page MenuHomePhabricator

CVE-2025-62698: Stored XSS through system messages in ExternalGuidance
Closed, ResolvedPublicSecurity

Authored By
SomeRandomDeveloper
Jul 15 2025, 11:06 PM
Referenced Files
F66723728: T399662-REL1_39.patch
Oct 3 2025, 3:55 PM
F66723725: T399662-REL1_43.patch
Oct 3 2025, 3:55 PM
F64683710: T399662.patch
Jul 15 2025, 11:09 PM
F64682223: image.png
Jul 15 2025, 11:06 PM
F64682132: image.png
Jul 15 2025, 11:06 PM
F64682084: image.png
Jul 15 2025, 11:06 PM

Description

In the ExternalGuidance extension, the externalguidance-machine-translation-heading and externalguidance-machine-translation-contribute system messages are inserted as HTML without proper sanitization.

Reproduction

  1. Install ExternalGuidance
  2. Go to /w/index.php?title=Main_Page&uselang=x-xss
  3. Run the following JS in the browser console (there is barely any documentation on how the extension works, so I just used this to manually load the module with minimal configuration):
mw.loader.using( [ 'mw.externalguidance' ] ).then( ( req ) => {
	const ExternalGuidance = req( 'mw.externalguidance' );
	const eg = new ExternalGuidance( 'machine-translation', {service: 'Google', to: 'de'} );
	eg.init();
} );

image.png (420×156 px, 9 KB)

image.png (412×190 px, 15 KB)

image.png (555×583 px, 75 KB)

Cause

The result of mw.msg(), which returns messages unsanitized, is passed to .html(), which inserts the message contents as raw HTML:
https://gerrit.wikimedia.org/g/mediawiki/extensions/ExternalGuidance/+/7584a17bb7f10f4622caf070a075d9daf4e24c62/modules/mw.externalguidance/core.js#61
https://gerrit.wikimedia.org/g/mediawiki/extensions/ExternalGuidance/+/7584a17bb7f10f4622caf070a075d9daf4e24c62/modules/mw.externalguidance/core.js#111

Additional information

Event Timeline

sbassett added a project: SecTeam-Processed.
sbassett subscribed.

Patch:

CR+1, LGTM. This can likely get deployed during next Monday's security window (2025-07-21).

sbassett changed the task status from Open to In Progress.Jul 16 2025, 1:59 PM
sbassett triaged this task as Low priority.
sbassett changed Risk Rating from N/A to Low.

Change #1189231 had a related patch set uploaded (by Reedy; author: SomeRandomDeveloper):

[mediawiki/extensions/ExternalGuidance@master] SECURITY: Insert messages using .text() instead of .html()

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

Change #1189231 merged by jenkins-bot:

[mediawiki/extensions/ExternalGuidance@master] SECURITY: Insert messages using .text() instead of .html()

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

Change #1189244 had a related patch set uploaded (by Reedy; author: SomeRandomDeveloper):

[mediawiki/extensions/ExternalGuidance@REL1_44] SECURITY: Insert messages using .text() instead of .html()

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

Change #1189246 had a related patch set uploaded (by Reedy; author: SomeRandomDeveloper):

[mediawiki/extensions/ExternalGuidance@REL1_43] SECURITY: Insert messages using .text() instead of .html()

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

Change #1189246 abandoned by Reedy:

[mediawiki/extensions/ExternalGuidance@REL1_43] SECURITY: Insert messages using .text() instead of .html()

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

Change #1189244 merged by jenkins-bot:

[mediawiki/extensions/ExternalGuidance@REL1_44] SECURITY: Insert messages using .text() instead of .html()

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

This needs to be backported to REL1_43 and REL1_39:


Change #1193509 had a related patch set uploaded (by SBassett; author: SomeRandomDeveloper):

[mediawiki/extensions/ExternalGuidance@REL1_43] SECURITY: Insert messages using .text() instead of .html()

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

Change #1193510 had a related patch set uploaded (by SBassett; author: SomeRandomDeveloper):

[mediawiki/extensions/ExternalGuidance@REL1_39] SECURITY: Insert messages using .text() instead of .html()

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

Change #1193510 merged by jenkins-bot:

[mediawiki/extensions/ExternalGuidance@REL1_39] SECURITY: Insert messages using .text() instead of .html()

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

Change #1193509 merged by jenkins-bot:

[mediawiki/extensions/ExternalGuidance@REL1_43] SECURITY: Insert messages using .text() instead of .html()

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

Mstyles renamed this task from Stored XSS through system messages in ExternalGuidance to CVE-2025-62698: Stored XSS through system messages in ExternalGuidance.Oct 21 2025, 5:53 AM
Mstyles changed the visibility from "Custom Policy" to "Public (No Login Required)".
Mstyles changed the edit policy from "Custom Policy" to "All Users".