Vulnerability DatabaseCVE-2026-104259

CVE-2026-104259: 
ModSecurity vulnerability analysis and mitigation

Overview

CVE-2026-104259 is a WAF rule bypass vulnerability in ModSecurity, an open-source web application firewall engine for Apache, IIS, and Nginx. The flaw exists in the t:removeComments transformation, which fails to correctly strip adjacent inline comments, allowing attackers to obfuscate SQLi/XSS payloads and bypass WAF detection rules. Affected versions are ModSecurity v2 prior to 2.9.15 and ModSecurity v3 from 3.0.0 up to (but not including) 3.0.17. The vulnerability was published on November 9, 2026, and carries a CVSS v3.1 base score of 5.4 (Medium) (GitHub Advisory).

Technical details

The root cause is an always-incorrect control flow implementation (CWE-670) in both msre_fn_removeComments_execute in apache2/re_tfns.c (v2) and inplace() in src/actions/transformations/remove_comments.cc (v3). When a comment terminator (*/ or -->) is encountered, the code advances the index past the terminator and immediately copies the next character to the output buffer without re-evaluating it as a potential new comment start. This means adjacent comments like /*A*//*B*/ are not fully stripped — the second comment leaks through as /*B*/. Additionally, when a comment closer is the last content in the input, the same copy operation reads one byte beyond the end of the input buffer, constituting an out-of-bounds read. The fix removes the premature character copy, allowing the main loop to re-evaluate the position on its next iteration (GitHub Advisory, v3 Fix Commit, v2 Fix Commit).

Impact

The primary impact is a WAF rule bypass: attackers can craft payloads using adjacent inline comments (e.g., /**/UNION/**/SELECT/**/) that survive the t:removeComments transformation and reach downstream rule matching or the backend application unmodified, enabling SQLi or XSS attacks that would otherwise be blocked. A secondary impact is an out-of-bounds read when a comment closer is the final content in the input buffer, which could potentially be leveraged for information disclosure or instability. The confidentiality and integrity impacts are rated Low, and there is no direct availability impact (GitHub Advisory).

Exploitability

No public proof-of-concept exploit code or in-the-wild exploitation has been reported as of the publication date. The NVD SSVC assessment classifies exploitation as "none" and the vulnerability as not automatable, reflecting the requirement for high attack complexity. The EPSS score is approximately 0.0022 (0.22%), indicating a low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog (GitHub Advisory).

Exploitation steps

  1. Identify target: Confirm the target web application is protected by ModSecurity v2 < 2.9.15 or v3 < 3.0.17 with WAF rules that use the t:removeComments transformation (e.g., OWASP CRS rules targeting SQLi or XSS).
  2. Craft obfuscated payload: Construct a payload using adjacent inline comments to split attack keywords, such as UNION/**//**/SELECT for SQL injection or <scr/**//**/ipt> for XSS. The adjacent comments cause the second comment to survive stripping.
  3. Deliver payload: Submit the crafted payload in an HTTP request parameter (GET or POST) to the target application, e.g., GET /index.php?q=UNION%2F%2A%2A%2F%2F%2A%2A%2FSELECT.
  4. Bypass WAF: ModSecurity's t:removeComments transformation strips only the first comment, leaving the second intact. The transformed value (e.g., UNION/**/SELECT) does not match the WAF's detection pattern for UNIONSELECT, so the rule is not triggered.
  5. Reach backend: The obfuscated payload is forwarded to the backend application, where the database or browser interprets the comments as whitespace, effectively executing the intended SQLi or XSS attack (GitHub Advisory).

Indicators of compromise

  • Network: HTTP requests containing patterns of adjacent SQL/HTML inline comments in query parameters or POST bodies, such as /**//**/, UNION/**//**/SELECT, or <!--...--><!--...--> sequences targeting endpoints protected by ModSecurity.
  • Logs: ModSecurity audit logs showing requests with adjacent comment patterns that were not blocked (i.e., no deny action triggered) despite containing SQLi or XSS keywords; absence of expected t:removeComments transformation debug log entries stripping all comments.
  • Application Logs: Backend database or application error logs indicating unexpected SQL syntax or query anomalies consistent with injected SQL keywords that bypassed WAF filtering.

Mitigation and workarounds

Upgrade ModSecurity to the patched versions: v2.9.15 or v3.0.17, both released on September 29, 2026. These releases remove the premature character copy after comment terminators, ensuring adjacent comments are fully stripped and eliminating the out-of-bounds read. No configuration-based workaround is available; upgrading is the only reliable remediation. Organizations using OWASP CRS rules that rely on t:removeComments should prioritize this update (v2.9.15 Release, v3.0.17 Release).

Community reactions

The vulnerability was discovered and reported by researcher HEXER365 and coordinated through the ModSecurity private security repository before public disclosure via GitHub Security Advisory GHSA-qrch-pjfr-9g47. The fix was developed by maintainer airween. No significant broader media coverage or notable social media discussion has been identified beyond standard CVE tracking and aggregator sites (GitHub Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

modsecurity-apache

Affected

sid

modsecurity-apache

Affected

trixie

modsecurity-apache

Affected

Ubuntu

Unknown

bionic (esm-apps)

modsecurity-apache

Unknown

devel

modsecurity

Unknown

focal (esm-apps)

modsecurity

Unknown

jammy

modsecurity

Unknown

jammy (esm-apps)

modsecurity

Unknown

noble

modsecurity

Unknown

noble (esm-apps)

modsecurity

Unknown

resolute

modsecurity

Unknown

RHEL / CentOS

Affected

RHEL 8

Not Affected

RHEL 9

Not Affected

RHEL 10

Not Affected

Source: This report was generated using AI

Related ModSecurity vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-73856HIGH8.6
  • ModSecurity logoModSecurity
  • modsecurity
NoYesNov 05, 2026
CVE-2026-73857HIGH7.5
  • ModSecurity logoModSecurity
  • modsecurity
NoYesNov 09, 2026
CVE-2026-61812MEDIUM6.3
  • ModSecurity logoModSecurity
  • cpe:2.3:a:owasp:modsecurity
NoYesNov 09, 2026
CVE-2026-104259MEDIUM5.4
  • ModSecurity logoModSecurity
  • modsecurity
NoYesNov 09, 2026
CVE-2026-61813LOW3.7
  • ModSecurity logoModSecurity
  • modsecurity
NoYesNov 05, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management