Skip to main content
Vulnerability Database/CVE-2026-96874

CVE-2026-96874: MediaWiki Cargo Extension XSS Vulnerability

CVE-2026-96874 is a stored cross-site scripting flaw in the MediaWiki Cargo extension that enables attackers to inject malicious scripts into web pages. This article covers technical details, affected versions through 3.9.4, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-96874 Overview

CVE-2026-96874 is a stored cross-site scripting (XSS) vulnerability in the MediaWiki Cargo extension. The flaw stems from improper neutralization of user input during web page generation [CWE-79]. Authenticated attackers with low privileges can inject malicious scripts that persist in Cargo-generated content. When other users render the affected pages, the injected payload executes in their browser context.

The issue affects the MediaWiki Cargo extension through version 3.9.4. Cargo is widely deployed on wiki farms to store and query structured data from wiki templates.

Critical Impact

Authenticated users can store malicious JavaScript that executes against visitors of Cargo-rendered pages, enabling session theft, account takeover, and defacement within the wiki context.

Affected Products

  • MediaWiki Cargo extension versions through 3.9.4
  • Wikis running Cargo with user-contributed template data
  • MediaWiki installations granting low-privileged edit rights

Discovery Timeline

  • 2026-09-25 - CVE-2026-96874 published to the National Vulnerability Database
  • 2026-09-29 - Record last updated in NVD

Technical Details for CVE-2026-96874

Vulnerability Analysis

The Cargo extension stores structured data defined inside wiki templates and renders this data back through query results, tables, and dynamic views. The extension fails to sanitize attacker-controlled input before including it in generated HTML. An authenticated editor can craft Cargo field values containing HTML or JavaScript that survive storage and are reflected to every subsequent viewer of the Cargo-rendered output.

Because the payload is persistent, exploitation does not require social engineering of a specific link. Any visitor loading the affected page triggers execution. The attacker leverages existing low-privilege edit rights, which is typical for community-driven wikis that allow authenticated contributions.

In-browser execution runs under the wiki origin. This exposes session cookies not marked HttpOnly, CSRF tokens, and any administrative functionality accessible through the victim's session. Attackers can escalate by targeting administrators who view Cargo query pages during normal moderation work.

Root Cause

The root cause is missing or insufficient output encoding in the Cargo extension's rendering path for structured field values. Content that should be treated as text data is emitted into HTML without contextual escaping, which allows <script> tags and event-handler attributes to execute. The upstream fix is tracked in the Wikimedia Gerrit change and the Wikimedia Phabricator task T435207.

Attack Vector

Exploitation requires network access to the wiki and a low-privileged authenticated account. The attacker edits a page that writes to a Cargo table, placing a script payload in a field that is later rendered by Cargo query output. When any user, including administrators, loads a page that queries that data, the browser parses and executes the payload. No user interaction beyond normal page viewing is required.

The vulnerability is described in prose only; no verified proof-of-concept code is published. Refer to the Wikimedia advisory links above for implementation-level technical details.

Detection Methods for CVE-2026-96874

Indicators of Compromise

  • Cargo table rows containing <script>, javascript:, or on*= event-handler strings in text fields
  • Unexpected outbound requests from administrator browsers to attacker-controlled domains after viewing Cargo pages
  • Wiki edit history showing low-privileged accounts modifying Cargo-backed templates with HTML-like payloads
  • Content Security Policy (CSP) violation reports originating from Cargo query result pages

Detection Strategies

  • Query the Cargo database tables directly for field values containing HTML tags or JavaScript URI schemes
  • Review MediaWiki recentchanges logs for edits by newly registered accounts touching Cargo-defined templates
  • Enable and monitor CSP violation reporting to catch script execution attempts in rendered Cargo output
  • Compare rendered page HTML against expected template output to identify injected markup

Monitoring Recommendations

  • Alert on new or modified Cargo template edits performed by accounts below trusted editor level
  • Log administrator sessions that load Cargo query pages immediately after suspicious low-privileged edits
  • Track anomalous cookie access or XHR traffic from authenticated wiki sessions
  • Retain MediaWiki access logs and correlate them with Cargo table write operations

How to Mitigate CVE-2026-96874

Immediate Actions Required

  • Upgrade the MediaWiki Cargo extension to a release later than 3.9.4 that includes the Gerrit fix
  • Audit existing Cargo tables for stored payloads and purge or sanitize any malicious entries
  • Rotate session secrets and force reauthentication for privileged accounts if exploitation is suspected
  • Restrict edit rights on Cargo-backed templates to trusted editor groups until patching completes

Patch Information

The upstream patch is published in the Wikimedia Gerrit change 1328631 and tracked in Phabricator task T435207. Administrators should pull the latest Cargo release from the official MediaWiki extension distribution and redeploy. After upgrading, run php maintenance/update.php to apply any schema changes and clear the parser cache so previously rendered pages regenerate with the fixed output encoding.

Workarounds

  • Enforce a strict Content Security Policy that blocks inline scripts on wiki pages
  • Temporarily disable the Cargo extension on sites that cannot patch immediately
  • Limit account creation and require manual approval before granting edit privileges on Cargo templates
  • Mark session cookies as HttpOnly and Secure to reduce the impact of script execution
bash
# Example: restrict Cargo template editing in LocalSettings.php
$wgNamespaceProtection[NS_TEMPLATE] = ['editprotected'];
$wgGroupPermissions['user']['editprotected'] = false;
$wgGroupPermissions['sysop']['editprotected'] = true;

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.