CVE-2025-61642

N/A Unknown

📋 TL;DR

This CVE describes a cross-site scripting (XSS) vulnerability in MediaWiki's HTML form components that allows attackers to inject malicious scripts into web pages. The vulnerability affects MediaWiki installations running affected versions, potentially compromising user sessions and data. Users who visit pages with maliciously crafted form elements could be impacted.

💻 Affected Systems

Products:
  • Wikimedia Foundation MediaWiki
Versions: MediaWiki versions from * before 1.39.14, 1.43.4, 1.44.1
Operating Systems: All operating systems running MediaWiki
Default Config Vulnerable: ⚠️ Yes
Notes: Affects specific HTML form components (CodexHTMLForm.php and HTMLButtonField.php). All MediaWiki installations using affected versions are vulnerable regardless of configuration.

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could steal session cookies, perform actions as authenticated users, redirect to malicious sites, or deface wiki pages by injecting persistent scripts.

🟠

Likely Case

Session hijacking, credential theft, or limited page defacement through reflected XSS attacks targeting users who interact with malicious form inputs.

🟢

If Mitigated

With proper Content Security Policy (CSP) headers and input validation, impact is reduced to minor UI manipulation or blocked entirely.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

XSS vulnerabilities typically have low exploitation complexity. The vulnerability is in form handling components, making exploitation straightforward for attackers who can submit malicious input.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: MediaWiki 1.39.14, 1.43.4, or 1.44.1

Vendor Advisory: https://phabricator.wikimedia.org/T402313

Restart Required: No

Instructions:

1. Backup your MediaWiki installation and database. 2. Download the patched version from mediawiki.org. 3. Replace affected files (includes/htmlform/CodexHTMLForm.php, includes/htmlform/fields/HTMLButtonField.php) or perform a full upgrade. 4. Verify the fix by checking version and testing form functionality.

🔧 Temporary Workarounds

Implement Content Security Policy

all

Add CSP headers to restrict script execution sources and mitigate XSS impact

Add to web server config: Content-Security-Policy: default-src 'self'; script-src 'self'

Input Validation Filter

all

Add custom input validation for form fields to sanitize user input

Implement in LocalSettings.php or extensions to sanitize form inputs

🧯 If You Can't Patch

  • Implement Web Application Firewall (WAF) rules to block XSS payloads in form submissions
  • Disable or restrict access to affected form components if not critical

🔍 How to Verify

Check if Vulnerable:

Check MediaWiki version and compare against affected versions. Review includes/htmlform/CodexHTMLForm.php and includes/htmlform/fields/HTMLButtonField.php for proper input sanitization.

Check Version:

Check LocalSettings.php or run: php maintenance/showSiteStats.php | grep 'MediaWiki'

Verify Fix Applied:

Verify MediaWiki version is 1.39.14, 1.43.4, or 1.44.1 or higher. Test form submissions with XSS payloads to ensure they are properly sanitized.

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to form endpoints with script tags or JavaScript payloads
  • Multiple failed form submissions with encoded characters

Network Indicators:

  • HTTP requests containing <script>, javascript:, or encoded XSS payloads in form parameters

SIEM Query:

source="web_server_logs" AND (uri_path="*htmlform*" OR uri_path="*CodexHTMLForm*" OR uri_path="*HTMLButtonField*") AND (request_body CONTAINS "<script>" OR request_body CONTAINS "javascript:")

🔗 References

📤 Share This