GHSA-cxqf-vgrr-xxrv: ModSecurity: HTML decoder missing entities, leading to evasion
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, t:htmlEntityDecode recognizes only a small subset of named HTML entities, so rules that depend on the transformation can inspect different bytes than a browser or backend. Attackers can encode ASCII separators and operators with unhandled entity names, including aliases, to bypass rules that depend on the transformation. The v3 decoder also accepts prefix matches instead of requiring an exact entity-token length, which can transform invalid longer names into different bytes. This issue is fixed in versions 2.9.15 and 3.0.17.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ModSecurityto a version that resolves this vulnerability.Fixed in 2.9.15 - Upgrade
Upgrade
ModSecurityto a version that resolves this vulnerability.Fixed in 3.0.17
Event History
Frequently Asked Questions
Which deployments are exposed to this evasion technique?
Deployments using ModSecurity versions before 2.9.15 or 3.0.17 are affected when they have rules that rely on the t:htmlEntityDecode transformation to inspect request content.
What does an attacker need to do to bypass affected rules?
An attacker can encode ASCII separators or operators using named HTML entities that the decoder does not handle, including aliases. In version 3, prefix matching can also cause invalid longer entity names to be decoded into different bytes.
Is this a vulnerability in the protected application itself?
The issue is in ModSecurity's HTML entity decoding and can cause the WAF to inspect bytes that differ from those interpreted by a browser or backend. The resulting impact depends on whether relevant rules rely on t:htmlEntityDecode.
What versions resolve the issue?
Upgrade ModSecurity 2.x to 2.9.15 or later, or ModSecurity 3.x to 3.0.17 or later.