How to fix: Alt-Svc advertises cleartext HTTP/2 (h2c)
An HTTPS response advertises an alternative service using the h2c protocol identifier. h2c is HTTP/2 over plain TCP, with no TLS at all.
Why it matters
A client that follows the advertisement moves the connection off TLS, so subsequent requests, cookies included, travel in cleartext while the address bar still shows the original https:// origin. It is a downgrade the server itself is asking for, and because Alt-Svc entries are cached for the header's ma= duration, one response can redirect a client's traffic for hours.
Alt-Svc is meant to point clients at a better transport for the same origin, normally h2 or h3, both of which run over TLS. h2c has no TLS at all and is only defined for prior-knowledge or Upgrade-based connections. Browsers do not act on an h2c advertisement, which limits real-world exposure, but non-browser HTTP clients and proxies do, and the header is usually there because a reverse proxy was configured to advertise its own backend protocol to the world.
How to fix it
- 1Remove h2c from the Alt-Svc header on any TLS-terminated listener.
- 2Advertise only h2 and h3 alternatives, both of which imply TLS.
- 3Check the reverse proxy configuration: h2c in Alt-Svc usually means the backend protocol setting is being echoed outward rather than kept internal.
Code examples
Advertise HTTP/3 only
add_header Alt-Svc 'h3=":443"; ma=86400' always;Check what a host advertises
curl -sI https://example.com/ | grep -i alt-svcReferences
Detected automatically by VulnRadar. The check id is ssl-alt-svc-cleartext-h2c, stable across every scan so you can filter or diff on it.
More ssl checks
- HighSecure Cookie Set on HTTP Endpoint
- CriticalSite Served Over Unencrypted HTTP
- InfoExpect-CT Header Not Present
- LowHTTPS Served on Non-Standard Port
- InfoX-HTTP-Method-Override / X-Forwarded-Method Header in Response
- InfoHSTS Present on HTTP Response (SSL-Strip Indicator)
- MediumMixed-Protocol Content (HTTPS Page Loading HTTP Resources)
- LowHSTS declared in a meta tag, where browsers ignore it
Questions
- How severe is Alt-Svc advertises cleartext HTTP/2 (h2c)?
- VulnRadar rates this medium severity in the ssl category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id ssl-alt-svc-cleartext-h2c, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Alt-Svc advertises cleartext HTTP/2 (h2c) map to?
- It maps to CWE-319. In the OWASP Top 10 it falls under A02:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.