CVE-2025-61766
Executive Summary
CVE-2025-61766 is a denial-of-service (DoS) vulnerability in the Bucket extension for MediaWiki. The flaw allows an unauthenticated attacker to trigger infinite recursion by crafting a query that uses the != comparator. This leads to exhaustion of PHP's call stack and increased memory consumption, potentially crashing the web server or making the wiki unavailable. The vulnerability affects all versions prior to 1.0.0. No public exploit code or proof-of-concept is currently available, but the attack vector is straightforward and requires no authentication.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
The Bucket extension is a third-party MediaWiki extension, not part of the core MediaWiki distribution. Administrators who have manually installed this extension from sources like GitHub or the MediaWiki extension repository are at risk. The fix is available in version 1.0.0, which should be obtained from the official repository. There is no known compromise of the package distribution channel.
CVSS Breakdown & Threat Level
- CVSS Score: 6.5 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: None
- Availability Impact: High
The vulnerability is easy to exploit remotely without authentication, making it a significant availability risk for any MediaWiki instance using the vulnerable extension.
Deep Dive & Mechanics
The Bucket extension provides a structured data storage and retrieval mechanism for MediaWiki articles. It allows users to define "buckets" and query them using various comparators (e.g., =, !=, <, >). The vulnerability lies in the query parser's handling of the != (not equal) comparator.
When a user submits a query like bucket_field != value, the extension's code recursively processes the condition. Due to a missing base case or improper termination condition, the recursion does not stop when the comparison is evaluated. Instead, it repeatedly calls itself, each time consuming a stack frame and allocating memory for intermediate results. This leads to:
- PHP Call Stack Exhaustion: PHP has a configurable maximum nesting level (
xdebug.max_nesting_levelorzend.max_input_nesting_level). Once exceeded, the script terminates with a fatal error. - Memory Exhaustion: Each recursive call may allocate memory for temporary data structures, leading to increased memory consumption. If the recursion is deep enough, the server may run out of memory, causing the web server process to be killed.
The attack can be triggered by a simple HTTP request to a MediaWiki page that processes a bucket query with the != comparator. No authentication is required if the wiki allows public access to pages using the Bucket extension.
Vulnerable vs. Patched Code
The vulnerable code likely resides in the query evaluation function of the Bucket extension. A simplified representation:
Vulnerable Code (Pre-1.0.0):
function evaluateCondition($field, $comparator, $value) {
if ($comparator == '!=') {
// Missing base case - recursively calls itself
return !evaluateCondition($field, '=', $value);
}
// ... other comparators
}
Patched Code (1.0.0):
function evaluateCondition($field, $comparator, $value) {
if ($comparator == '!=') {
// Properly evaluate the not-equal condition without recursion
$actualValue = getFieldValue($field);
return $actualValue != $value;
}
// ... other comparators
}
The patch replaces the recursive call with a direct comparison, eliminating the infinite recursion.
Exploitation & Lab Setup
Red Team (Attack Simulation)
- Identify Target: Find a MediaWiki instance running the Bucket extension. This can be done by checking the page source for references to
extensions/Bucketor by probing known endpoints. - Craft Payload: Send a GET or POST request to a page that uses a bucket query with the
!=comparator. For example:https://target-wiki/index.php?title=Special:BucketQuery&field=test&comparator=!=&value=anything - Trigger DoS: The server will enter infinite recursion, consuming resources. Multiple concurrent requests can accelerate the denial of service.
Example curl command:
curl -v "https://target-wiki/index.php?title=Special:BucketQuery&field=test&comparator=!=&value=anything"
Blue Team (Defense & Detection)
- Monitor Resource Usage: Watch for spikes in PHP-FPM or Apache worker memory and CPU usage.
- Web Server Logs: Look for repeated requests to
Special:BucketQuerywithcomparator=!=in the query string. - PHP Error Logs: Check for "Maximum function nesting level" or "Allowed memory size exhausted" errors.
- Rate Limiting: Implement rate limiting on the
Special:BucketQueryendpoint to prevent abuse. - WAF Rules: Create a rule to block requests containing
comparator=!=in the query string.
Indicators of Compromise (IOCs)
- Network: HTTP requests to
Special:BucketQuerywithcomparator=!=parameter. - Logs: PHP error logs containing "Maximum function nesting level" or "Allowed memory size exhausted".
- System: High CPU and memory usage by PHP-FPM or Apache processes.
- File: Presence of the Bucket extension directory (
extensions/Bucket) in the MediaWiki installation.
Detection Engineering
YARA Rule
rule CVE_2025_61766_Bucket_Extension {
meta:
description = "Detects vulnerable Bucket extension files for MediaWiki"
author = "Valters IT"
date = "2025-04-10"
hash = "unknown"
strings:
$vuln_func = "evaluateCondition" ascii wide nocase
$vuln_recursion = "!evaluateCondition" ascii wide nocase
condition:
$vuln_func and $vuln_recursion
}
Sigma Rule
title: CVE-2025-61766 Bucket Extension DoS Attempt
id: 8f7a3b2c-1d4e-5f6a-7b8c-9d0e1f2a3b4c
status: experimental
description: Detects attempts to exploit infinite recursion in MediaWiki Bucket extension
author: Valters IT
date: 2025/04/10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-uri-query|contains: "comparator=!="
condition: selection
falsepositives:
- Legitimate use of the `!=` comparator in non-recursive contexts (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-61766 MediaWiki Bucket Extension DoS Attempt"; flow:to_server; content:"comparator=!="; http_uri; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Upgrade the Bucket extension to version 1.0.0 or later.
- Workaround: If upgrading is not possible, disable the Bucket extension by removing or renaming the
extensions/Bucketdirectory. - Mitigation: Implement a Web Application Firewall (WAF) rule to block requests containing
comparator=!=in the query string. - Monitoring: Enable detailed logging for PHP errors and web server access logs to detect exploitation attempts.
- Rate Limiting: Apply rate limiting to the
Special:BucketQueryendpoint to reduce the impact of a DoS attack.
Valters IT
DevSecOps & Cyber Threat Intelligence