CVE-2021-31525
Go vulnerability analysis and mitigation

Overview

A vulnerability was discovered in the Go programming language's net/http package affecting versions before 1.15.12 and 1.16.x before 1.16.4. The vulnerability, identified as CVE-2021-31525, was discovered by Guido Vranken as part of the Ethereum 2.0 bounty program and publicly disclosed on April 22, 2021 (GitHub Issue, Go Announce).

Technical details

The vulnerability affects the ReadRequest and ReadResponse functions in net/http when parsing very large HTTP header values (over 7MB on 64-bit architectures, or over 4MB on 32-bit ones). The issue can cause an unrecoverable panic due to stack overflow from recursion. The vulnerability also impacts golang.org/x/net/http2/h2c and HeaderValuesContainsToken in golang.org/x/net/http/httpguts. The CVSS score for this vulnerability is 5.9 (Medium), with the vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H (Ubuntu CVE).

Impact

The vulnerability can lead to a denial of service condition through program crashes. Transport and Client components are vulnerable and can be exploited by a malicious server. While the Server component is not vulnerable by default due to a 1MB header limit, it becomes vulnerable if Server.MaxHeaderBytes is set to a higher value, allowing exploitation by malicious clients (CVE Mitre).

Exploitability

The vulnerability can be exploited remotely by sending HTTP requests with very large headers. The attack complexity is considered high, requires no privileges or user interaction, but has an unchanged scope. While the vulnerability allows for remote exploitation, there are no reported instances of this vulnerability being exploited in the wild (Ubuntu CVE).

Mitigation and workarounds

The vulnerability was fixed in Go versions 1.15.12 and 1.16.4. Users are advised to upgrade to these versions or later. The fix is also available in golang.org/x/net@v0.0.0-20210428140749-89ef3d95e781 for the affected x/net components. For systems that cannot be immediately updated, maintaining the default Server.MaxHeaderBytes limit of 1MB provides partial protection against server-side exploitation (Go Announce).

Additional resources


SourceThis report was generated using AI

Related Go vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-56865HIGH8.4
  • Go logoGo
  • kyverno-1.18
NoYesAug 13, 2026
CVE-2026-56864HIGH7.5
  • Go logoGo
  • grafana-image-renderer-5.10
NoYesAug 13, 2026
CVE-2026-56862HIGH7.5
  • Go logoGo
  • golang-src
NoYesAug 13, 2026
CVE-2026-56859HIGH7.5
  • Go logoGo
  • crossplane-provider-aws-kinesis-fips
NoYesAug 13, 2026
CVE-2026-56860MEDIUM5.9
  • Go logoGo
  • coder-2.29
NoYesAug 13, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management