CVE-2025-61640
📋 TL;DR
This is a cross-site scripting (XSS) vulnerability in MediaWiki's RclToOrFromWidget.js component that allows attackers to inject malicious scripts into web pages. When exploited, it can enable session hijacking, data theft, or unauthorized actions on behalf of users. It affects MediaWiki instances running vulnerable versions that use the RCFilters feature.
💻 Affected Systems
- Wikimedia Foundation MediaWiki
⚠️ Risk & Real-World Impact
Worst Case
Attackers could steal administrator credentials, compromise user accounts, deface wikis, or distribute malware to visitors through persistent XSS payloads.
Likely Case
Attackers with access to edit pages could embed malicious scripts that execute in other users' browsers, potentially stealing session cookies or performing unauthorized actions.
If Mitigated
With proper input validation and output encoding, the risk is reduced to minimal, though the vulnerability still exists in the codebase.
🎯 Exploit Status
Exploitation requires the ability to inject malicious input into the affected widget, typically through page editing privileges. No public exploit code is currently available.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: MediaWiki 1.39.14, 1.43.4, or 1.44.1
Vendor Advisory: https://phabricator.wikimedia.org/T402075
Restart Required: No
Instructions:
1. Backup your MediaWiki installation and database. 2. Update MediaWiki to version 1.39.14, 1.43.4, or 1.44.1 depending on your current branch. 3. Clear browser caches and MediaWiki caches. 4. Verify the update completed successfully.
🔧 Temporary Workarounds
Disable RCFilters Feature
allTemporarily disable the Recent Changes filters feature to prevent exploitation of this vulnerability.
Add to LocalSettings.php: $wgRCFilters = false;
Implement Content Security Policy
allAdd a strict Content Security Policy header to mitigate XSS impact.
Add to web server config or LocalSettings.php: Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval';"
Adjust policy based on your specific needs
🧯 If You Can't Patch
- Restrict editing privileges to trusted users only
- Implement web application firewall rules to block XSS patterns
🔍 How to Verify
Check if Vulnerable:
Check MediaWiki version via Special:Version page or by examining the includes/DefaultSettings.php file for version number.
Check Version:
grep 'wgVersion' includes/DefaultSettings.php
Verify Fix Applied:
Verify version is 1.39.14, 1.43.4, or 1.44.1 or higher via Special:Version page.
📡 Detection & Monitoring
Log Indicators:
- Unusual JavaScript in page edits
- Multiple failed edit attempts with script tags
- Unexpected changes to RCFilters-related pages
Network Indicators:
- HTTP requests containing malicious script payloads in parameters
- Unusual traffic to RCFilters endpoints
SIEM Query:
source="mediawiki_logs" AND ("script" OR "javascript" OR "onerror" OR "onload") AND "RCFilters"