Commit 92c9e6b
committed
Add HTTP/3 Host header support for ModSecurity
ModSecurity cannot see the Host header in HTTP/3 requests because HTTP/3 uses the `:authority` pseudo-header, which nginx parses into `r->headers_in.server` but doesn't add to the headers list.
This commit:
- Adds `NGX_HTTP_VERSION_30` case to `http_version` switch
- Manually extracts Host from `r->headers_in.server` for HTTP/3 requests
- Adds Host header to ModSecurity transaction before processing other headers
Fixes #305 false positives from OWASP CRS rule 920280 (Missing Host Header) on HTTP/3 connections.
Tested with nginx 1.29.3 and ModSecurity 3.0.13.1 parent fd28e6a commit 92c9e6b
1 file changed
+20
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
180 | 185 | | |
181 | 186 | | |
182 | 187 | | |
| |||
212 | 217 | | |
213 | 218 | | |
214 | 219 | | |
215 | | - | |
216 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
217 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
218 | 236 | | |
219 | 237 | | |
220 | 238 | | |
| |||
0 commit comments