{"id":"CVE-2026-104259","aliases":["DEBIAN-CVE-2026-104259","EUVD-2026-120509","GHSA-qrch-pjfr-9g47","UBUNTU-CVE-2026-104259"],"status":"published","title":"ModSecurity: removeComments Transformation Fails to Strip Adjacent Comments, Enabling WAF Rule Bypass","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.","severity":{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00223,"percentile":0.12962,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-670"],"published":"2026-10-06T00:00:00Z","modified":"2026-11-10T10:45:53Z","affected":[{"source":"osv","ecosystem":"Debian:12","package":"modsecurity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.0.10-1","3.0.11-1","3.0.12-1","3.0.12-1.1","3.0.12-1.1~exp1","3.0.13-1","3.0.14-1","3.0.15-1","3.0.16-1","3.0.9-1","3.0.9-1+deb12u1","3.0.9-1+deb12u2"]},{"source":"osv","ecosystem":"Debian:13","package":"modsecurity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.0.14-1","3.0.14-1+deb13u1","3.0.14-1+deb13u2","3.0.15-1","3.0.16-1"]},{"source":"osv","ecosystem":"Debian:14","package":"modsecurity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.0.14-1","3.0.15-1","3.0.16-1"]},{"source":"osv","ecosystem":"Debian:12","package":"modsecurity-apache","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.9.10-1","2.9.11-1","2.9.12-2","2.9.13-1","2.9.7-1","2.9.7-1+deb12u1","2.9.7-1+deb12u2","2.9.8-1","2.9.8-1.1","2.9.9-1"]},{"source":"osv","ecosystem":"Debian:13","package":"modsecurity-apache","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.9.11-1","2.9.11-1+deb13u1","2.9.12-2","2.9.13-1"]},{"source":"osv","ecosystem":"Debian:14","package":"modsecurity-apache","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.9.11-1","2.9.12-2","2.9.13-1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:14.04:LTS","package":"modsecurity-apache","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.7.4-1","2.7.5-1","2.7.7-1","2.7.7-1ubuntu1","2.7.7-2","2.7.7-2ubuntu0.1~esm1","2.7.7-2ubuntu0.1~esm2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"modsecurity-apache","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.9.0-1","2.9.0-1ubuntu0.1~esm1","2.9.0-1ubuntu0.1~esm2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"modsecurity-apache","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.9.1-3","2.9.2-1","2.9.2-1ubuntu0.1~esm1","2.9.2-1ubuntu0.1~esm2"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"modsecurity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.0.3-1","3.0.4-1","3.0.4-1build1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"modsecurity-apache","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.9.3-1","2.9.3-1ubuntu0.1","2.9.3-1ubuntu0.1+esm1"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"modsecurity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.0.4-2","3.0.6-1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"modsecurity-apache","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.9.3-3","2.9.5-1","2.9.5-1ubuntu0.1~esm1","2.9.5-1ubuntu0.1~esm2"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"modsecurity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.0.10-1","3.0.11-1","3.0.12-1","3.0.12-1.1build1","3.0.12-1.1build2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:24.04:LTS","package":"modsecurity-apache","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.9.7-1","2.9.7-1build2","2.9.7-1build3","2.9.7-1ubuntu0.24.04.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"modsecurity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.0.14-1build2","3.0.15-1","3.0.16-1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"modsecurity-apache","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.9.12-2build1","2.9.13-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"modsecurity","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.0.14-1build1","3.0.14-1build2"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"modsecurity-apache","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.9.12-2","2.9.12-2build1"]}],"products":[{"vendor":"owasp-modsecurity","product":"modsecurity"}],"references":[{"url":"https://github.com/owasp-modsecurity/ModSecurity/security/advisories/GHSA-qrch-pjfr-9g47","tags":["x_refsource_CONFIRM","advisory","report"]},{"url":"https://github.com/owasp-modsecurity/ModSecurity/commit/264f348ae1823cb71cead3650b74c165678a1d46","tags":["x_refsource_MISC","fix"]},{"url":"https://github.com/owasp-modsecurity/ModSecurity/commit/49a65f471d3130b91f7fff9bfac9fe8dd9b97c44","tags":["x_refsource_MISC","fix"]},{"url":"https://github.com/owasp-modsecurity/ModSecurity/releases/tag/v2.9.15","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/owasp-modsecurity/ModSecurity/releases/tag/v3.0.17","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/104xxx/CVE-2026-104259.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-104259","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-104259","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2026-104259","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-104259","tags":["report"]},{"url":"https://modsecurity.org/20260928/security-update-digest-overview-of-recent-advisory-fixes-2026-september/","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2026-104259","title":"ModSecurity: removeComments Transformation Fails to Strip Adjacent Comments, Enabling WAF Rule Bypass","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.","status":"published","published":"2026-11-09T21:37:00.048Z","modified":"2026-11-10T19:07:18.936Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-670"],"updated_at":"2026-11-09T22:35:08.46461Z"}],"euvd":[{"id":"EUVD-2026-120509","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.","status":"published","published":"2026-11-09T21:37:00Z","modified":"2026-11-10T19:07:18Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-09T23:18:32.235826Z"}],"nvd":[{"id":"CVE-2026-104259","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.","status":"published","published":"2026-11-09T22:18:22.16Z","modified":"2026-11-10T19:17:41.593Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium","assessor":"secondary"}],"cwes":["CWE-670"],"updated_at":"2026-11-09T23:16:05.865626Z"}],"osv":[{"id":"CVE-2026-104259","title":"ModSecurity: removeComments Transformation Fails to Strip Adjacent Comments, Enabling WAF Rule Bypass","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.","status":"published","published":"2026-11-09T21:37:00.048Z","modified":"2026-11-11T13:19:37.456183881Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-670"],"updated_at":"2026-11-11T03:22:04.464623Z"},{"id":"DEBIAN-CVE-2026-104259","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.","status":"published","published":"2026-11-09T22:18:22.16Z","modified":"2026-11-11T09:47:44.241233701Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-10T05:22:46.487299Z"},{"id":"UBUNTU-CVE-2026-104259","description":"[GHSA-qrch-pjfr-9g47: t:removeComments mishandles the character after a comment terminator, bypassing rules]","status":"published","published":"2026-10-06T00:00:00Z","modified":"2026-10-17T12:58:42.313503255Z","updated_at":"2026-11-02T16:55:59.130573Z"}]}}
