{"id":"CVE-2026-104259","summary":"ModSecurity: removeComments Transformation Fails to Strip Adjacent Comments, Enabling WAF Rule Bypass","details":"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.","aliases":["BIT-modsecurity-2026-104259","BIT-modsecurity2-2026-104259","GHSA-qrch-pjfr-9g47"],"modified":"2026-11-27T06:56:06.684707142Z","published":"2026-11-09T21:37:00.048Z","database_specific":{"cna_assigner":"GitHub_M","cwe_ids":["CWE-670"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/104xxx/CVE-2026-104259.json"},"references":[{"type":"WEB","url":"https://github.com/owasp-modsecurity/ModSecurity/releases/tag/v2.9.15"},{"type":"WEB","url":"https://github.com/owasp-modsecurity/ModSecurity/releases/tag/v3.0.17"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/104xxx/CVE-2026-104259.json"},{"type":"ADVISORY","url":"https://github.com/owasp-modsecurity/ModSecurity/security/advisories/GHSA-qrch-pjfr-9g47"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-104259"},{"type":"FIX","url":"https://github.com/owasp-modsecurity/ModSecurity/commit/264f348ae1823cb71cead3650b74c165678a1d46"},{"type":"FIX","url":"https://github.com/owasp-modsecurity/ModSecurity/commit/49a65f471d3130b91f7fff9bfac9fe8dd9b97c44"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/owasp-modsecurity/modsecurity","events":[{"introduced":"0"},{"fixed":"151074aca78a416764b12ba1221e61a17a6c714d"},{"introduced":"c1cd668acb820824e791ba802396c60900eae9c1"},{"fixed":"1925753989ccce977cdaae417b55c9726c7cf02c"},{"fixed":"264f348ae1823cb71cead3650b74c165678a1d46"},{"fixed":"49a65f471d3130b91f7fff9bfac9fe8dd9b97c44"}],"database_specific":{"extracted_events":[{"range":[{"introduced":"0"},{"fixed":"2.9.15"}],"source":"AFFECTED_FIELD","strategy":"StringRangeExpression"},{"source":"AFFECTED_FIELD","strategy":"StringRangeExpression","range":[{"introduced":"3.0.0"},{"fixed":"3.0.17"}]},{"source":"REFERENCES_COMMIT","range":[{"fixed":"264f348ae1823cb71cead3650b74c165678a1d46"}]},{"range":[{"fixed":"49a65f471d3130b91f7fff9bfac9fe8dd9b97c44"}],"source":"REFERENCES_COMMIT"},{"source":"REFERENCES_TAG","original_tag":"v2.9.15","range":[{"fixed":"151074aca78a416764b12ba1221e61a17a6c714d"}]},{"source":"REFERENCES_TAG","original_tag":"v3.0.17","range":[{"fixed":"1925753989ccce977cdaae417b55c9726c7cf02c"}]}]}}],"versions":["v2.9.14","v3.0.16","v2.9.13","v3.0.15","v2.9.12","v2.9.11","v2.9.10","v2.9.9","v3.0.14","v3.0.13","v3.0.12","v3.0.11","v3.0.10","v3.0.9","v2.9.7","v2.9.6","v3.0.8","v3.0.7","v3.0.6","v2.9.5","v2.9.4","v3.0.5","v3.0.4","v2.9.3","v3.0.3","v3.0.2","v3.0.1","v3.0.0","v2.9.2","v2.9.1","v2.9.1-rc1","v2.9.0","v2.9.0-rc2","v2.9.0-rc1","v2.7.4"],"database_specific":{"vanir_signatures":[{"deprecated":false,"digest":{"line_hashes":["202122836514193154345534637951501939605","133104122808785052517467047972153404933","18403014409354985176589860182163824485","80390221611433042655094454244737484174","31701643716507315984075794353236711796","252111886007404248291986472810814348762","74580135900238923667206134302524463627","18890313154030873173129351316815346599","318089468848531841346110930657317614656","101840384259278922854582896702006291992","129021293761078989391968731218227673602","12585583621743588204736953142967562201","128304307327763600117827817291712775520","88879764568889400471042244569249161496"],"threshold":0.9},"id":"CVE-2026-104259-5613b812","signature_type":"Line","signature_version":"v1","source":"https://github.com/owasp-modsecurity/modsecurity/commit/49a65f471d3130b91f7fff9bfac9fe8dd9b97c44","target":{"file":"src/actions/transformations/remove_comments.cc"}},{"digest":{"function_hash":"196852077556833942779629326418321491269","length":1347},"id":"CVE-2026-104259-5dd3964b","signature_type":"Function","signature_version":"v1","source":"https://github.com/owasp-modsecurity/modsecurity/commit/49a65f471d3130b91f7fff9bfac9fe8dd9b97c44","target":{"function":"inplace","file":"src/actions/transformations/remove_comments.cc"},"deprecated":false},{"target":{"file":"apache2/re_tfns.c"},"deprecated":false,"digest":{"line_hashes":["75387750628947182766104478398153436443","328510958205499367754439006306049933219","18403014409354985176589860182163824485","178675538285570150774987523825907851134","50307940690726875897152364288359233798","15602561772537390961120552489857131856","53338939089708413140182333335245774420","334661620442043208677271398900175401732","97246155580574071342188854289417805778","129021293761078989391968731218227673602","12585583621743588204736953142967562201","128304307327763600117827817291712775520","88879764568889400471042244569249161496"],"threshold":0.9},"id":"CVE-2026-104259-97730e8d","signature_type":"Line","signature_version":"v1","source":"https://github.com/owasp-modsecurity/modsecurity/commit/264f348ae1823cb71cead3650b74c165678a1d46"},{"deprecated":false,"digest":{"function_hash":"67850261134852653930510267943829640721","length":1413},"id":"CVE-2026-104259-e054c58b","signature_type":"Function","signature_version":"v1","source":"https://github.com/owasp-modsecurity/modsecurity/commit/264f348ae1823cb71cead3650b74c165678a1d46","target":{"function":"msre_fn_removeComments_execute","file":"apache2/re_tfns.c"}}],"vanir_signatures_modified":"2026-11-14T07:06:32Z","source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-104259.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N"}]}