GHSA-m7vp-hqwv-7m5x: Github.com/spiffe/spire Unbounded Memory Usage On Exposed Vulnerability

HIGH
Published
Advisory Summary

GHSA-m7vp-hqwv-7m5x is a HIGH unbounded memory usage on exposed vulnerability (General Security Weakness) affecting Github.com/spiffe/spire libraries in the Go ecosystem. The issue involves unbounded memory usage on exposed http/2 (non-grpc) endpoints. Remediation is available by upgrading affected packages to version 1.0.3, 1.1.3.

GHSA-m7vp-hqwv-7m5x at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-m7vp-hqwv-7m5x
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Github.com/spiffe/spire
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-m7vp-hqwv-7m5x

To remediate this vulnerability, upgrade all affected Github.com/spiffe/spire dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/spiffe/spire fixed: 1.0.3
Upgrade github.com/spiffe/spire to 1.0.3
github.com/spiffe/spire fixed: 1.1.3
Upgrade github.com/spiffe/spire to 1.1.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/spiffe/spire

How to Check if You Are Affected

To determine whether your application is affected by GHSA-m7vp-hqwv-7m5x, inspect your project dependencies for Github.com/spiffe/spire:

inspect dependencies for github.com/spiffe/spire

Analyze the terminal output to locate any version of Github.com/spiffe/spire in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Github.com/spiffe/spire, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 - https://github.com/golang/go/issues/50058 - https://go-review.googlesource.com/c/go/+/370574/ - https://nvd.nist.gov/vuln/detail/CVE-2021-44716

GHSA-m7vp-hqwv-7m5x Affected Github.com/spiffe/spire Versions

2 component(s)
Fixed Versions:
1.0.31.1.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/spiffe/spire
Go
< 1.0.3
1.0.3
github.com/spiffe/spire
Go
≥ 1.1.0
< 1.1.3
1.1.3

References

Frequently Asked Questions

What is GHSA-m7vp-hqwv-7m5x?
GHSA-m7vp-hqwv-7m5x is a security vulnerability in Github.com/spiffe/spire involving Unbounded memory usage on exposed HTTP/2 (non-gRPC) endpoints under General Security Weakness.
Which Github.com/spiffe/spire versions are affected?
Affected versions include releases prior to 1.0.3, 1.1.3 across affected packages: github.com/spiffe/spire.
What version fixes GHSA-m7vp-hqwv-7m5x?
Upgrading to 1.0.3, 1.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/spiffe/spire affected?
Yes, github.com/spiffe/spire is affected in releases prior to 1.0.3, 1.1.3. Upgrade your dependency to 1.0.3, 1.1.3 or later.
What CWE is associated with GHSA-m7vp-hqwv-7m5x?
GHSA-m7vp-hqwv-7m5x is classified under General Security Weakness.
How can I check Go dependencies for GHSA-m7vp-hqwv-7m5x?
Run the dependency tree command: 'inspect dependencies for github.com/spiffe/spire'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m7vp-hqwv-7m5x",
  "modified" : "2022-01-11T16:45:39Z",
  "published" : "2022-01-12T22:33:04Z",
  "aliases" : [ ],
  "summary" : "Unbounded memory usage on exposed HTTP/2 (non-gRPC) endpoints",
  "details" : "### Impact\nThe 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:\n- OIDC Discovery Provider\n- K8s Workload Registrar in webhook mode\n\nThe following endpoints are vulnerable _when enabled_:\n- SPIRE server bundle endpoint (i.e. Federation API)\n\nThe following endpoints are _NOT_ vulnerable, since HTTP/2 support in go is not enabled on non-TLS protected endpoints:\n- SPIRE server/agent metrics endpoint when configured for Prometheus\n- SPIRE server/agent health endpoints\n- SPIRE server/agent profiling endpoints\n\n### Patches\nSPIRE 1.0.3 and 1.1.3 have been released with an upgraded Go toolchain which patches the vulnerability\n\n### Workarounds\nThe 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.\n\nThe 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.\n\n### References\n- https://github.com/golang/go/issues/50058\n- https://go-review.googlesource.com/c/go/+/370574/\n- https://nvd.nist.gov/vuln/detail/CVE-2021-44716\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/spiffe/spire"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/spiffe/spire"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.1.0"
      }, {
        "fixed" : "1.1.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/spiffe/spire/security/advisories/GHSA-m7vp-hqwv-7m5x"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-10T22:07:35Z",
    "nvd_published_at" : null
  }
}