Skip to main content
MediumSSLOWASP A02:2021CWE-319

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

  1. 1Remove h2c from the Alt-Svc header on any TLS-terminated listener.
  2. 2Advertise only h2 and h3 alternatives, both of which imply TLS.
  3. 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

nginx
add_header Alt-Svc 'h3=":443"; ma=86400' always;

Check what a host advertises

bash
curl -sI https://example.com/ | grep -i alt-svc

References

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.

See every ssl check

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.

Propose a checkHow a check is built

Scan your own site for alt-svc advertises cleartext http/2 (h2c)

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

Alt-Svc advertises cleartext HTTP/2 (h2c) fix | VulnRadar