CVE-2025-48866
Executive Summary
CVE-2025-48866 is a high-severity (CVSS 7.5) denial of service (DoS) vulnerability in ModSecurity, an open-source Web Application Firewall (WAF) engine for Apache, IIS, and Nginx. The flaw resides in the sanitiseArg (and its alias sanitizeArg) action. An attacker can craft HTTP requests with an excessive number of arguments, causing the WAF to consume excessive resources and leading to a denial of service. This vulnerability is similar to GHSA-859r-vvv8-rm8r/CVE-2025-47947. The issue is fixed in version 2.9.10. As a workaround, avoid using rules that contain the sanitiseArg or sanitizeArg action.
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
This vulnerability affects the ModSecurity open-source project. Organizations using ModSecurity as a WAF component in their infrastructure are at risk. The package is typically deployed as a library or module integrated into web servers (Apache, Nginx, IIS). The supply chain risk is moderate, as the vulnerability is in the core engine and can be triggered by any HTTP request, regardless of the upstream application.
CVSS Breakdown & Threat Level
- CVSS Score: 7.5 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Attack Vector (AV): Network (N) - Exploitable remotely.
- Attack Complexity (AC): Low (L) - No special conditions required.
- Privileges Required (PR): None (N) - No authentication needed.
- User Interaction (UI): None (N) - No user action required.
- Scope (S): Unchanged (U) - Impact is confined to the vulnerable component.
- Confidentiality (C): None (N) - No data exposure.
- Integrity (I): None (N) - No data modification.
- Availability (A): High (H) - Complete loss of availability (DoS).
Threat Level: High. The vulnerability is remotely exploitable with low complexity and no authentication, making it attractive for attackers to disrupt web services.
Deep Dive & Mechanics
The vulnerability is in the sanitiseArg action within ModSecurity's rule engine. This action is used to sanitize (remove or replace) specific arguments from HTTP requests. The flaw occurs when a rule using sanitiseArg is triggered by a request containing an excessive number of arguments. The internal data structures used to track and process these arguments are not properly bounded, leading to uncontrolled memory allocation or CPU consumption.
Root Cause: The sanitiseArg action iterates over all arguments in the request. When a request contains a very large number of arguments (e.g., thousands), the iteration and associated memory operations become exponential or unbounded, causing the WAF process to hang, crash, or consume all available resources.
Attack Vector: An attacker sends a specially crafted HTTP request (GET or POST) with a large number of parameters (e.g., ?a=1&b=2&c=3... repeated thousands of times). If any active rule uses sanitiseArg (or sanitizeArg), the WAF will attempt to process all arguments, leading to DoS.
Similarity to CVE-2025-47947: This CVE is explicitly noted as similar to GHSA-859r-vvv8-rm8r/CVE-2025-47947, which likely affects a different action or a similar pattern in the same codebase.
Vulnerable vs. Patched Code
Vulnerable Code (ModSecurity < 2.9.10):
The vulnerable code is in the sanitiseArg function. The exact location is in the ModSecurity source, likely in modsecurity.c or a related file. The function iterates over arguments without a limit.
// Pseudocode of vulnerable logic
void sanitiseArg(request_rec *r, const char *arg_name) {
// Iterate over all arguments in the request
for (int i = 0; i < r->args_count; i++) {
// Process each argument
// No limit on the number of arguments
process_arg(r->args[i]);
}
}
Patched Code (ModSecurity >= 2.9.10): The patched code introduces a limit on the number of arguments processed.
// Pseudocode of patched logic
#define MAX_SANITISE_ARGS 1000
void sanitiseArg(request_rec *r, const char *arg_name) {
// Limit the number of arguments to process
int max_args = (r->args_count > MAX_SANITISE_ARGS) ? MAX_SANITISE_ARGS : r->args_count;
for (int i = 0; i < max_args; i++) {
// Process each argument
process_arg(r->args[i]);
}
}
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A target running ModSecurity < 2.9.10 with at least one rule using
sanitiseArgorsanitizeArg. - Network access to the target.
Exploitation Steps:
- Identify a target web application protected by ModSecurity.
- Craft an HTTP request with a large number of parameters (e.g., 10,000+).
- Send the request to the target.
Example Payload (using curl):
# Generate a request with 10000 parameters
params=""
for i in $(seq 1 10000); do
params="${params}¶m${i}=value${i}"
done
curl -v "http://target.com/?${params}"
Expected Outcome: The ModSecurity process will consume excessive CPU/memory, potentially crashing or causing the web server to become unresponsive.
Blue Team (Defense & Detection)
Detection:
- Monitor for HTTP requests with an abnormally high number of parameters (e.g., > 1000).
- Use the detection rules provided below.
Mitigation:
- Immediately upgrade to ModSecurity 2.9.10 or later.
- If upgrade is not possible, remove or comment out any rules that use
sanitiseArgorsanitizeArg. - Implement rate limiting on the web server or upstream load balancer to limit the number of requests per IP.
- Use a Web Application Firewall (WAF) that is not vulnerable (e.g., a cloud WAF) in front of the vulnerable instance.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests with > 1000 parameters in the query string or POST body.
- Repeated requests from the same IP with a high parameter count.
- System IOCs:
- High CPU usage by the ModSecurity process (e.g.,
mod_security2.soormodsecurity). - Out-of-memory (OOM) killer events targeting the web server process.
- Web server logs showing timeouts or crashes.
- High CPU usage by the ModSecurity process (e.g.,
- Log IOCs:
- ModSecurity audit logs showing
sanitiseArgaction being triggered on requests with a large number of arguments. - Apache/Nginx error logs with messages like
ModSecurity: Out of memoryorSegmentation fault.
- ModSecurity audit logs showing
Detection Engineering
YARA Rule
rule CVE_2025_48866_ModSecurity_DoS {
meta:
description = "Detects potential exploitation of CVE-2025-48866 by identifying HTTP requests with excessive parameters"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-48866"
strings:
$http_get = "GET"
$http_post = "POST"
$param_pattern = /[?&][a-zA-Z0-9_]+=/
condition:
(($http_get at 0 or $http_post at 0) and #param_pattern > 1000)
}
Sigma Rule
title: CVE-2025-48866 ModSecurity DoS via Excessive Arguments
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects HTTP requests with an excessive number of parameters, indicating potential exploitation of CVE-2025-48866.
author: Valters IT
date: 2025/04/10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-uri-query|re: '([?&][a-zA-Z0-9_]+=){1000,}'
condition: selection
falsepositives:
- Legitimate applications that send many parameters (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-48866 ModSecurity DoS via Excessive Arguments"; flow:to_server; content:"?"; http_uri; pcre:"/([?&][a-zA-Z0-9_]+=){1000,}/Ri"; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade ModSecurity to version 2.9.10 or later.
- Remove vulnerable rules: If upgrade is not possible, remove or comment out any rules that use
sanitiseArgorsanitizeArg. - Implement input validation: Limit the number of parameters accepted by your web application.
Long-term Measures:
- Regularly update ModSecurity and other security components.
- Monitor for new CVEs and apply patches promptly.
- Use a layered security approach (e.g., cloud WAF, rate limiting, intrusion detection).
Workaround:
- Avoid using rules that contain the
sanitiseArg(orsanitizeArg) action.
Valters IT
Securing Digital Frontiers