Page MenuHomePhabricator

CVE-2025-62670: Stored XSS through a system message in FlexDiagrams
Closed, ResolvedPublicSecurity

Description

The flexdiagrams-drawio-saveinfo system message is inserted as HTML by the FlexDiagrams extension, allowing for stored XSS.

Reproduction steps

  1. Create a Drawio diagram
  2. Go to /w/index.php?title=Drawio:Test2&action=editdiagram&uselang=x-xss (make sure to adjust the name of the diagram page, as it has to exist for the vulnerability to work)

image.png (591×197 px, 20 KB)

Cause

The message is retrieved in the text output mode and inserted through an HtmlSnippet:
https://gerrit.wikimedia.org/g/mediawiki/extensions/FlexDiagrams/+/1ba4aff57096626b3ddb386d8c23c7c384613513/resources/ext.flexdiagrams.drawio.js#116

Additional info

Details

Author Affiliation
Wikimedia Communities

Event Timeline

Patch:

flexdiagrams-drawio-saveinfo doesn't contain any HTML, and neither should $( '#wpSave' ).attr( 'value' ), so removing the HtmlSnippet should be fine.

@Yaron_Koren thanks for merging the patch. Please make sure to use git am to apply my patch next time when uploading it. The commit message 'Simplify code for "Please save" notice for Drawio diagrams' is missing a "SECURITY:" prefix and does not sufficiently state that the commit contains a security fix.

Also the message should have mentioned this task.

Mstyles renamed this task from Stored XSS through a system message in FlexDiagrams to CVE-2025-62670: Stored XSS through a system message in FlexDiagrams.Oct 18 2025, 5:03 AM
Mstyles changed the visibility from "Custom Policy" to "Public (No Login Required)".
Mstyles changed the edit policy from "Custom Policy" to "All Users".