Skip to content

Conversation

@AMoo-Miki
Copy link

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.

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 owasp-modsecurity#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.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Host' header missing when HTTP3 is in use prevents "SecRule REQUEST_HEADERS:Host" rules from being effective.

1 participant