CVE-2023-29141

9.8 CRITICAL

📋 TL;DR

This vulnerability in MediaWiki allows attackers to trigger automatic IP blocking by manipulating the X-Forwarded-For HTTP header. It affects MediaWiki instances that process untrusted headers, potentially enabling denial-of-service attacks against legitimate users. All MediaWiki installations within the affected version ranges are vulnerable if they accept X-Forwarded-For headers from untrusted sources.

💻 Affected Systems

Products:
  • MediaWiki
Versions: Before 1.35.10, 1.36.x through 1.38.x before 1.38.6, 1.39.x before 1.39.3
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability requires MediaWiki to be configured to use X-Forwarded-For headers (common in reverse proxy setups).

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers can block legitimate users, administrators, or entire IP ranges from accessing the wiki, causing complete denial of service for affected users.

🟠

Likely Case

Targeted blocking of specific users or IP addresses, disrupting legitimate access to the wiki platform.

🟢

If Mitigated

If proper header validation or IP filtering is in place, the impact is limited to potential logging anomalies with no service disruption.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires sending crafted HTTP requests with malicious X-Forwarded-For headers.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.35.10, 1.38.6, 1.39.3 or later

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

Restart Required: No

Instructions:

1. Backup your MediaWiki installation. 2. Update to patched version using your package manager or manual download. 3. Run update.php if database schema changes are needed.

🔧 Temporary Workarounds

Filter X-Forwarded-For Headers

all

Configure web server or reverse proxy to strip or validate X-Forwarded-For headers from untrusted sources.

# Apache: SetEnvIf X-Forwarded-For "^.*$" bad_header=1
# Nginx: proxy_set_header X-Forwarded-For $remote_addr;

Disable Auto-block Feature

all

Temporarily disable MediaWiki's auto-block functionality until patched.

# In LocalSettings.php: $wgBlockDisablesLogin = false;

🧯 If You Can't Patch

  • Implement strict IP validation at reverse proxy/load balancer level
  • Monitor and audit auto-block logs for suspicious patterns

🔍 How to Verify

Check if Vulnerable:

Check MediaWiki version against affected ranges. Review if $wgUsePrivateIPs or similar settings enable X-Forwarded-For processing.

Check Version:

php maintenance/run.php ./includes/DefaultSettings.php | grep wgVersion

Verify Fix Applied:

Confirm MediaWiki version is 1.35.10+, 1.38.6+, or 1.39.3+. Test with crafted X-Forwarded-For headers to ensure no auto-block occurs.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected auto-block entries in MediaWiki logs
  • Multiple IP blocks from single source IP
  • X-Forwarded-For header patterns matching internal IPs

Network Indicators:

  • HTTP requests with spoofed X-Forwarded-For headers
  • Rapid succession of blocking events

SIEM Query:

source="mediawiki.log" AND "autoblock" AND ("X-Forwarded-For" OR "xff")

🔗 References

📤 Share & Export