GHSA-m7vp-hqwv-7m5x Unbounded memory usage on exposed HTTP/2 (non-gRPC) endpoints
Attackers can cause denial of service via unbounded memory usage in SPIRE HTTP/2 endpoints using the vulnerable Go net/http package.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-m7vp-hqwv-7m5x?
GHSA-m7vp-hqwv-7m5x is a denial of service vulnerability in github.com/spiffe/spire, published on 12 Jan 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Impact
The net/http Go package has a reported vulnerability tracked under CVE-2021-44716 which allows attacker controlled HTTP/2 requests to trigger unbounded memory usage in HTTP/2 endpoints. gRPC endpoints are not vulnerable as they rely on their own HTTP/2 implementation instead of the net/http package. HTTP/2 endpoints consuming the net/http package within SPIRE server and agent (or other components in this repository) that are on by default include the following:
- OIDC Discovery Provider
- K8s Workload Registrar in webhook mode
The following endpoints are vulnerable when enabled:
- SPIRE server bundle endpoint (i.e. Federation API)
The following endpoints are NOT vulnerable, since HTTP/2 support in go is not enabled on non-TLS protected endpoints:
- SPIRE server/agent metrics endpoint when configured for Prometheus
- SPIRE server/agent health endpoints
- SPIRE server/agent profiling endpoints
Patches
SPIRE 1.0.3 and 1.1.3 have been released with an upgraded Go toolchain which patches the vulnerability
Workarounds
The vulnerability can be worked around entirely by including the http2server=0 value in the GODEBUG environment variable (see https://github.com/golang/go/issues/50058). This turns off HTTP/2 support on all non-gRPC endpoints. They will still function with HTTP/1.1.
The risk associated with this vulnerability can be somewhat mitigated by limiting the exposure of the endpoints in question. If necessary, vulnerable components or endpoints that are optionally configured can be disabled temporarily.
References
Which versions are affected by GHSA-m7vp-hqwv-7m5x?
4 open source packages ship an affected version, including github.com/spiffe/spire.
| Package | Affected | Fixed in |
|---|---|---|
github.com/spiffe/spire Go | All versions | 1.0.3 |
github.com/spiffe/spire Go | All versions | 1.0.3 |
github.com/spiffe/spire Go | From 1.1.0 | 1.1.3 |
github.com/spiffe/spire Go | From 1.1.0 | 1.1.3 |
How do I fix GHSA-m7vp-hqwv-7m5x?
Upgrade github.com/spiffe/spire to a fixed version for your release line: 1.0.3 or 1.1.3.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is GHSA-m7vp-hqwv-7m5x being exploited?
There is no known exploitation of GHSA-m7vp-hqwv-7m5x in the wild and no public exploit code.