CVE-2026-39841: Stored XSS through list fields on Cargo's page values and Special:CargoTables
Closed, ResolvedPublicSecurity

Description

Through storing arbitrary HTML to a Cargo table's list field, it is possible to achieve a stored XSS on Special:CargoTables and action=pagevalues.

Reproduction steps

  1. Create Template:XSS with the following contents:
{{#cargo_declare:_table=ListXss
|Items=List (,) of String
}}
{{#cargo_store:_table=ListXss
|Items=<script>alert('xss')</script>
}}
  1. Create the table for Template:XSS
  2. Null-edit Template:XSS to insert the row
  3. Go to Special:CargoTables/XSS or Template:XSS?action=pagevalues
  4. An alert box is displayed on page load.

Cause

In CargoQueryDisplayer, combined list field values are entity-decoded in case the item delimiter could be affected. However, the individual items that are being formatted do not get encoded, and non-Wikitext field types do not run through the wikitext parser.

Additional information

Cargo 3.8.6 (e89d34e)

Details

Author Affiliation
Wikimedia Communities
Related Changes in Gerrit:

Event Timeline

Alex44019 updated the task description. (Show Details)
sbassett subscribed.

Happy to include this in the next supplemental security release once the patch is reviewed/merged.

Change #1237973 had a related patch set uploaded (by Alex44019; author: Alex44019):

[mediawiki/extensions/Cargo@master] SECURITY: Properly handle escaping of list field items

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

Change #1237973 merged by jenkins-bot:

[mediawiki/extensions/Cargo@master] SECURITY: Properly handle escaping of list field items

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

ASanford-WMF renamed this task from Stored XSS through list fields on Cargo's page values and Special:CargoTables to CVE-2026-39841: Stored XSS through list fields on Cargo's page values and Special:CargoTables.Apr 7 2026, 8:05 PM
ASanford-WMF changed the visibility from "Custom Policy" to "Public (No Login Required)".Apr 7 2026, 8:18 PM