MEDIUM 5.4

CVE-2026-58031: MediaWiki API Sandbox XSS Vulnerability (CVSS 5.4)

A cross-site scripting (XSS) vulnerability exists in MediaWiki's API Sandbox interface. An authenticated user can inject malicious scripts that execute in another user's browser when they interact with the sandbox feature. The scripts run in the context of the MediaWiki site, allowing the attacker to steal session tokens, perform actions on behalf of the victim, or redirect them to malicious sites. This requires both user authentication and victim interaction, limiting its scope but still posing a meaningful risk to collaborative wiki environments.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.4 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Weaknesses (CWE)
CWE-79
Affected products
1 configuration(s)
Published / Modified
2026-07-01 / 2026-07-09

NVD description (verbatim)

Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in Wikimedia Foundation MediaWiki. This vulnerability is associated with program files resources/src/mediawiki.Special.Apisandbox/ApiSandboxLayout.Js. This issue affects MediaWiki: from 1.46.0-rc.0 before 1.46.0.

1 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-58031 is an improper input neutralization vulnerability (CWE-79) located in the ApiSandboxLayout.js resource file within MediaWiki's Special:ApiSandbox interface. The vulnerability allows authenticated attackers to inject arbitrary JavaScript that bypasses output encoding or content security controls. The flaw affects MediaWiki versions from 1.46.0-rc.0 up to (but not including) 1.46.0. With a CVSS 3.1 score of 5.4 (MEDIUM), the vector reflects the requirement for prior authentication and user interaction, though the cross-site nature (S:C) means injected scripts can access content across different security contexts within the same origin.

Business impact

Organizations running vulnerable MediaWiki instances face risk to their API development and documentation workflows. Attackers with edit or API access permissions could plant persistent XSS payloads in sandbox examples or requests, compromising users who test or review those sandboxed API calls. For public wikis with contributor communities, this could damage trust and require incident response. The impact is generally contained to users of that specific wiki instance, though critical wikis (internal developer documentation, public reference sites) may warrant faster remediation.

Affected systems

MediaWiki versions 1.46.0-rc.0 through versions prior to 1.46.0 are affected. This includes release candidates and any production or staging deployments using the 1.46 branch before the final 1.46.0 release. Administrators should check their MediaWiki version via the version file or Special:Version page. Earlier stable branches (1.45, 1.44, etc.) and later releases (1.46.0 and beyond) should be evaluated separately against vendor guidance.

Exploitability

Exploitability is moderate. The vulnerability requires an authenticated account on the MediaWiki instance—ruling out unauthenticated drive-by attacks—and also requires the victim to interact with a specially crafted API sandbox request or example. However, once those prerequisites are met, execution is reliable and does not depend on complex or user-unusual behavior. In collaborative environments where users regularly test API calls, social engineering to click a malicious sandbox link is plausible. The attack does not require elevated privileges; standard contributor status is sufficient.

Remediation

Update MediaWiki to version 1.46.0 or later, which contains the fix for this vulnerability. If you are currently on a 1.46 release candidate, upgrade to the stable 1.46.0 release. For organizations unable to update immediately, consider restricting access to Special:ApiSandbox via user permissions or disabling the feature temporarily if it is not critical to operations. Apply standard web application security practices: ensure Content Security Policy headers are properly configured, maintain up-to-date extensions, and review user permissions regularly.

Patch guidance

Wikimedia Foundation has addressed this vulnerability in MediaWiki 1.46.0. Administrators should obtain the latest stable release from the official MediaWiki download site or their package repository. Verify the integrity of the downloaded software using official checksums. Before deploying to production, test the update in a staging environment to ensure compatibility with existing extensions and configurations. Document the update in your change management system and communicate the security improvement to your team.

Detection guidance

Monitor web server logs for unusual activity targeting Special:ApiSandbox, particularly POST requests with suspicious parameters or script-like payloads in query strings. Review MediaWiki revision history and logs for unexpected edits to API sandbox documentation or example pages, especially insertions of script tags or event handlers. Implement application-level monitoring for JavaScript execution anomalies if your web application firewall supports MediaWiki inspection. Conduct periodic security audits of user accounts with API sandbox modification rights to identify compromised or unauthorized accounts.

Why prioritize this

Although the CVSS score is MEDIUM (5.4), this vulnerability affects the API development workflow—a critical tool for technical teams. Prioritize patching if your organization uses MediaWiki for internal API documentation or if your wiki accepts external contributors. The authentication requirement and user interaction prerequisite lower urgency for closed internal wikis with trusted users, but public or semi-public instances should be updated promptly. The fix is straightforward (a version upgrade), making this a good candidate for near-term patching cycles.

Risk score, explained

The CVSS 3.1 score of 5.4 reflects a MEDIUM severity rating due to the combination of factors: network accessibility (AV:N) and low attack complexity (AC:L) support broader attack surface, but the requirement for prior authentication (PR:L) and user interaction (UI:R) significantly constrain practical exploitability. Confidentiality and integrity impacts are low (C:L, I:L) because the attacker operates within the victim's browser context and the affected wiki, not gaining access to backend systems or data beyond what the victim already sees. No availability impact (A:N) is recorded. The cross-site scope (S:C) indicates the payload can escape the direct component and affect the wider application.

Frequently asked questions

Does this vulnerability affect MediaWiki versions before 1.46.0-rc.0?

No. According to the CVE description, only versions from 1.46.0-rc.0 through versions before 1.46.0 are affected. Stable releases in the 1.45 branch and earlier are not listed as vulnerable. However, you should consult the official MediaWiki security advisory to confirm coverage for your specific version and any backported patches.

Can this vulnerability be exploited without a user account on the wiki?

No. The CVSS vector includes PR:L (PR=Low), meaning the attacker must have authenticated credentials. Unauthenticated visitors cannot trigger the vulnerability. This significantly reduces risk on public wikis unless you have very permissive registration policies.

What should I do if I cannot upgrade immediately?

Consider temporarily restricting access to Special:ApiSandbox through user permission controls, or disable the feature if it is not essential to your operations. Ensure your web application firewall or reverse proxy logs and inspects requests to the sandbox endpoint. Review user permissions and audit accounts with modification rights. Plan an upgrade as soon as possible—this is not a long-term substitute for patching.

How does this differ from other XSS vulnerabilities?

This XSS is confined to the API Sandbox tool, not a site-wide input validation bypass. It requires authentication and user interaction, making it less severe than a reflected or stored XSS in user-facing content. However, it still poses a real risk in collaborative environments where technical users frequently test APIs and may be social-engineered to click malicious links.

This analysis is provided for informational purposes to support security decision-making. The vulnerability details, affected versions, and CVSS score are derived from the official CVE record and Wikimedia Foundation advisories. Security risk varies based on your specific MediaWiki configuration, user base, extensions, and network exposure. Always verify patch applicability and test updates in a non-production environment before deployment. Consult the vendor advisory for the most current remediation guidance. SEC.co and its authors assume no liability for decisions made on the basis of this analysis. Source: NVD (public-domain), retrieved 2026-08-10. Analysis generated by SEC.co (claude-haiku-4-5).