All vulnerabilities

Servers and applications

CVE-2026-104259

removeComments Transformation Fails to Strip Adjacent Comments, Enabling WAF Rule Bypass

Severity
Medium 5.4
Published
30 Sept 2026
Last changed
10 Nov 2026
Added to UpHeron
3 Nov 2026
Fixed in
2.9.15, 3.0.17
Exploit chance
0.2% in the next 30 daysHigher than 13% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Always-incorrect control flow (CWE-670)
Attack
Over the network · Only under certain conditions · No login needed · No user action needed
Attacker can
Read some data · Change some data
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N
Also known as
GHSA-qrch-pjfr-9g47
Sources
CVE Program, Project advisories (GitHub)

Description

inplace() in src/actions/transformations/remove_comments.cc fails to remove a second comment immediately adjacent to a first, allowing SQLi/XSS payloads using inline-comment obfuscation (e.g. //UNION//SELECT/**/) to survive t:removeComments and reach downstream rule matching or the application unmodified.

When one comment closes, the character immediately following */ is copied to output literally instead of being re-evaluated as the possible start of a new comment (/).

The same input[j] = input[i] also reads one byte past the end of the buffer when the comment closer is the last content in the input: i += 2 (or i += 3 for the --> closer) can make i == input_len before that read. apache2/re_tfns.c's msre_fn_removeComments_execute has the identical pattern.

  • WAF rule bypass (CWE-670): attackers using t:removeComments in bypass payloads like //UNION//SELECT/**/ can defeat comment-stripping-dependent detection rules.
From owasp-modsecurity/ModSecurity's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
ModSecurityServers and applications · cna:owasp-modsecurity|modsecurity
  • Every version before 2.9.15
  • From 3.0.0 before 3.0.17
ModSecurityServers and applications · github:owasp-modsecurity/modsecurity
  • Every version before 3.0.17
  • Every version before 2.9.15

About ModSecurity

web application firewall (WAF) module

From Wikidata, CC0 1.0.
Docker Hub pulls
7,086,565Docker Hub, 15 Nov 2026
GitHub stars
9,872GitHub, 15 Nov 2026
Forks
1,761GitHub, 15 Nov 2026
Latest release
v3.0.17GitHub, 15 Nov 2026
Released
29 Sept 2026GitHub
Developer
Trustwave HoldingsWikidata
License
Apache Software License 2.0Wikidata
Written in
CWikidata
First published on GitHub
2 Feb 2011GitHub

References

  • CVE.org https://www.cve.org/CVERecord?id=CVE-2026-104259
  • GitHub Advisory Database https://github.com/advisories/GHSA-qrch-pjfr-9g47
  • github.com https://github.com/owasp-modsecurity/ModSecurity/security/advisories/GHSA-qrch-pjfr-9g47