CVE-2022-29904

9.8 CRITICAL

📋 TL;DR

This CVE describes an SQL injection vulnerability in the SemanticDrilldown extension for MediaWiki. Attackers can exploit certain '-' and '_' constraints to execute arbitrary SQL commands. All MediaWiki installations using vulnerable versions of SemanticDrilldown are affected.

💻 Affected Systems

Products:
  • MediaWiki SemanticDrilldown extension
Versions: MediaWiki through 1.37.2 (before commit e688bdba6434591b5dff689a45e4d53459954773)
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Requires SemanticDrilldown extension to be installed and enabled.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise allowing data theft, modification, or deletion; potential privilege escalation to administrative access; remote code execution if database permissions allow.

🟠

Likely Case

Unauthorized data access and extraction from MediaWiki database, potentially exposing user information, page content, and configuration data.

🟢

If Mitigated

Limited impact if proper input validation and database permissions are enforced, though SQL injection could still expose some data.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

SQL injection vulnerabilities are commonly exploited; specific exploit details may not be publicly available but the vulnerability type is well-understood.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Commit e688bdba6434591b5dff689a45e4d53459954773 or later

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

Restart Required: No

Instructions:

1. Update SemanticDrilldown extension to commit e688bdba6434591b5dff689a45e4d53459954773 or later. 2. Apply the patch from gerrit.wikimedia.org/r/c/mediawiki/extensions/SemanticDrilldown/+/785213. 3. Clear any caches if applicable.

🔧 Temporary Workarounds

Disable SemanticDrilldown extension

all

Temporarily disable the vulnerable extension until patching is possible

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

Implement WAF rules

all

Add web application firewall rules to block SQL injection patterns

🧯 If You Can't Patch

  • Implement strict input validation for all user inputs to SemanticDrilldown
  • Apply principle of least privilege to database user accounts used by MediaWiki

🔍 How to Verify

Check if Vulnerable:

Check SemanticDrilldown extension version: grep -r 'SemanticDrilldown' /path/to/mediawiki/extensions/

Check Version:

Check MediaWiki version: grep 'wgVersion' /path/to/mediawiki/includes/DefaultSettings.php

Verify Fix Applied:

Verify extension is updated to commit e688bdba6434591b5dff689a45e4d53459954773 or later

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple failed login attempts or unusual parameter patterns in web server logs

Network Indicators:

  • HTTP requests containing SQL injection patterns in parameters
  • Unusual database connection patterns

SIEM Query:

search 'web_server_logs' AND ('sql' OR 'union' OR 'select' OR '--' OR ';') AND 'SemanticDrilldown'

🔗 References

📤 Share & Export