CVE-2021-31525 — Vulnerability in golang.org/x/net — CVE Details
golang.org/x/net/http/httpguts vulnerable to Uncontrolled Recursion
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (3.69%). Schedule for your next planned update.
Does your project use an affected golang.org/x/net version?
Paste your go.sum to check it for CVE-2021-31525 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
golang.org/x/net/http/httpguts in Go before 1.15.12 and 1.16.x before 1.16.4 allows remote attackers to cause a denial of service (panic) via a large header to ReadRequest or ReadResponse. Server, Transport, and Client can each be affected in some configurations.
Advisory Timeline
- First published May 24, 2022 (1647 days ago).
- Last revised September 10, 2026 — 1569 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
go get golang.org/x/net@v0.0.0-20210428140749-89ef3d95e781
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: Go (1).
| Package | Fixed In |
|---|---|
| golang.org/x/net Go · Affected: All versions | 0.0.0-20210428140749-89ef3d95e781 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-674
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 5.9 score means for each attack dimension.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://nvd.nist.gov/vuln/detail/CVE-2021-31525ADVISORY
- https://github.com/golang/go/issues/45710WEB
- https://github.com/golang/goPACKAGE
- https://go.dev/cl/313069WEB
- https://go.dev/issue/45710WEB
- https://go.googlesource.com/net/+/89ef3d95e781148a0951956029c92a211477f7f9WEB
- https://groups.google.com/g/golang-announce/c/cu9SP4eSXMcWEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ISRZZ6NY5R2TBYE72KZFOCO25TEUQTBFWEB
- https://pkg.go.dev/vuln/GO-2022-0236WEB
- https://security.gentoo.org/glsa/202208-02WEB
Frequently Asked Questions
- What is CVE-2021-31525?
- golang.org/x/net/http/httpguts vulnerable to Uncontrolled Recursion. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 5.9/10).
- How do I check if my project is affected by CVE-2021-31525?
- CVE-2021-31525 affects golang.org/x/net. It has a 3.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2021-31525 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This places it in the top 10% of EPSS-scored vulnerabilities — 90.5% of tracked vulnerabilities score at or below it, so it is substantially more likely to be exploited than most tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2026-42506
Invoking incorrect handling of namespaced elements in foreign content in golang.org/x/net/html
- CVE-2026-39821
Invoking failure to reject ASCII-only Punycode-encoded labels in golang.org/x/net/idna
- CVE-2026-42502
Invoking incorrect handling of HTML elements in foreign content in golang.org/x/net/html
- CVE-2026-25680
Invoking denial of service when parsing arbitrary HTML in golang.org/x/net/html
- CVE-2026-25681
Invoking incorrect handling of character references in DOCTYPE nodes in golang.org/x/net/html
- CVE-2026-27136
Invoking duplicate attributes can cause XSS in golang.org/x/net/html
- CVE-2026-46600
Parsing an invalid SVCB or HTTPS RR can panic in golang.org/x/net/dns/dnsmessage
- CVE-2026-78659
HTTP/2 server memory exhaustion due to Trailer headers in net/http