ModSecurity Flaws Let Attackers Bypass WAF Protection and Potentially Execute Code

ModSecurity has disclosed multiple security flaws that could let attackers bypass request-inspection rules, evade file-upload protections, cause denial-of-service conditions, and potentially execute code in vulnerable deployments.

The advisories, published September 30, include high-severity issues affecting multipart request parsing and the ModSecurity v3 XML request-body processor.

Organizations using ModSecurity alongside the OWASP Core Rule Set should urgently review configurations, update available packages, and add compensating controls where patches are not yet available.

OWASP ModSecurity Flaws

The most severe WAF-bypass issue, tracked as GHSA-5pww-8rfg-9crf, stems from ModSecurity’s multipart parser not supporting RFC 2231 parameter extensions.

The flaw affects ModSecurity versions 3.0.0 and later, and the advisory listed no patched version at the time of disclosure. It carries a CVSS score of 8.6.

The issue centers on the filename* parameter used in multipart Content-Disposition headers. ModSecurity and associated OWASP Core Rule Set rules inspect the ordinary filename= value, but RFC-compliant application frameworks may instead prioritize the RFC 2231-encoded filename*= value.

An attacker could submit an upload request that presents a harmless-looking file name to the WAF while causing the backend application to process a dangerous extension.

For example, ModSecurity may observe safe.jpg, while a Go, Python, Node.js, or Java backend resolves the file name as shell.php. This disconnect can bypass filename-extension rules such as CRS rules 920120, 922100, and 922110.

If the application stores the uploaded file in a web-accessible directory and permits server-side script execution, the bypass could ultimately result in remote code execution.

PHP’s native multipart processing does not decode filename* in the same manner, but common parsers in Go, Flask/Werkzeug, FastAPI/Starlette, Node.js, and Java environments are listed as affected by the advisory.

A separate high-severity vulnerability, CVE-2026-73857, affects the XML request-body processor in libmodsecurity3 versions before 3.0.17. The flaw is caused by an uninitialized pointer dereference in the XML-into-ARGS SAX end-element callback.

A remote, unauthenticated attacker could trigger the issue using one crafted HTTP request, potentially causing a ModSecurity-protected web server worker to write a constant value to an attacker-controlled address.

The advisory describes this as a restricted write-what-where primitive, with possible effects ranging from denial of service and memory disclosure to execution-flow redirection and potential remote code execution.

The vulnerable code path is only reachable when SecParseXmlIntoArgs is configured as On or OnlyArgs; the setting is disabled by default. ModSecurity v3.0.15 and v3.0.16 are affected, while version 3.0.17 is identified as the patched release.

The newly disclosed advisories also cover malformed Base64 handling, adjacent-comment removal failures, PCRE2 regular-expression match-limit errors, and response-body inspection bypasses.

Individually, these flaws can cause ModSecurity transformations or matching logic to produce incomplete or incorrect inspection results, letting malicious payloads slip past rules designed to detect attacks.

These failures matter because WAF protection depends on the firewall and the backend application interpreting the same request identically. Any parser discrepancy, transformation error, or fail-open matching behavior creates an evasion opportunity.

Mitigation

Administrators should upgrade libmodsecurity3 to 3.0.17 where applicable and keep ModSecurity rulesets current. For the XML flaw, SecParseXmlIntoArgs should remain Off unless there is a documented operational requirement to enable it.

Applications should normalize filenames independently, reject executable extensions, validate file content using allowlisted formats, generate server-side file names, and store uploads outside web-accessible paths.

These measures reduce the risk that an RFC 2231 filename discrepancy becomes a direct path to web-shell deployment or code execution.

Join 16,000+ SOC teams using ANY.RUN to streamline threat investigations and reduce manual effort. Explore for your team 

Tamilselvan
Tamilselvanhttps://cyberpress.org/
Tamilselvan is an Investigative cybersecurity journalist dedicated to breaking stories on ransomware cartels, data breaches, and state-sponsored espionage.

Trending News

Related Stories