CVE-2024-40601

6.5 MEDIUM

📋 TL;DR

This CVE describes a Cross-Site Request Forgery (CSRF) vulnerability in the MediaWikiChat extension for MediaWiki. Attackers can trick authenticated users into performing unauthorized actions via the API modules. All MediaWiki installations using the vulnerable MediaWikiChat extension are affected.

💻 Affected Systems

Products:
  • MediaWiki with MediaWikiChat extension
Versions: MediaWiki through 1.42.1 with MediaWikiChat extension
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Requires MediaWikiChat extension to be installed and enabled. The vulnerability is in the extension's API modules.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could manipulate chat settings, delete conversations, or perform other administrative actions through authenticated users' sessions, potentially disrupting communication or modifying system behavior.

🟠

Likely Case

Attackers create malicious pages that trigger CSRF requests when visited by authenticated users, leading to unauthorized chat modifications or data manipulation.

🟢

If Mitigated

With proper CSRF protections and user awareness, impact is limited to unsuccessful exploitation attempts with no data compromise.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

CSRF attacks typically require social engineering to trick authenticated users into visiting malicious pages. The vulnerability is in API endpoints that lack proper CSRF protections.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check MediaWikiChat extension updates or MediaWiki 1.42.2+

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

Restart Required: No

Instructions:

1. Update MediaWiki to version 1.42.2 or later. 2. Alternatively, update the MediaWikiChat extension to a patched version if available separately. 3. Verify the fix by checking that CSRF tokens are required for API requests.

🔧 Temporary Workarounds

Disable MediaWikiChat Extension

all

Temporarily disable the vulnerable extension until patched

Edit LocalSettings.php and remove or comment out: wfLoadExtension('MediaWikiChat');

Implement CSRF Protection at Web Server Level

all

Add CSRF token validation via web server configuration or middleware

🧯 If You Can't Patch

  • Implement strict SameSite cookie policies and require CSRF tokens for all state-changing requests
  • Educate users about phishing risks and implement additional authentication for sensitive actions

🔍 How to Verify

Check if Vulnerable:

Check if MediaWiki version is 1.42.1 or earlier AND MediaWikiChat extension is installed/enabled. Review API endpoints for missing CSRF protections.

Check Version:

Check MediaWiki version via Special:Version page or by examining includes/DefaultSettings.php

Verify Fix Applied:

Verify that API requests now require valid CSRF tokens and test that unauthorized requests are rejected.

📡 Detection & Monitoring

Log Indicators:

  • Unusual API requests to MediaWikiChat endpoints without referrer validation
  • Multiple failed API requests indicating CSRF attempts

Network Indicators:

  • Requests to MediaWikiChat API endpoints from unexpected referrers or without CSRF tokens

SIEM Query:

source="mediawiki" AND (uri_path="/api.php" AND parameters CONTAINS "MediaWikiChat") AND (referrer NOT IN allowed_domains OR csrf_token="")

🔗 References

📤 Share & Export