CVE-2021-31525
JSON

5.9medium

golang.org/x/net/http/httpguts vulnerable to Uncontrolled Recursion

Severity
5.9medium CVSS:3.1 by NVD
Exploit likelihood
3.69% (higher than 90% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-h86h-8ppg-mxmhBIT-GOLANG-2021-31525GO-2022-0236

Description

net/http 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.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
golang.org/x/net (Go)before 0.0.0-20210428140749-89ef3d95e781GitHub Advisory Database, Go Vulnerability Database
stdlib (Go)before 1.15.12, from 1.16.0-0 before 1.16.4Go Vulnerability Database
golang gobefore 1.15.12, from 1.16.0 before 1.16.4NVD
fedoraproject fedora34NVD
golang (Bitnami)before 1.15.12, from 1.16.0 before 1.16.4Bitnami Vulnerability Database

All scores

GitHub5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD2.6low CVSS:2.0AV:N/AC:H/Au:N/C:N/I:N/A:P
Bitnami Vulnerability Databasemedium rating

Classification

What each source says

CVE List

net/http 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.

GitHub Advisory Database

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.

Go Vulnerability Database

A malicious HTTP server or client can cause the net/http client or server to panic.

ReadRequest and ReadResponse can hit an unrecoverable panic when reading a very large header (over 7MB on 64-bit architectures, or over 4MB on 32-bit ones). Transport and Client are vulnerable and the program can be made to crash by a malicious server. Server is not vulnerable by default, but can be if the default max header of 1MB is overridden by setting Server.MaxHeaderBytes to a higher value, in which case the program can be made to crash by a malicious client.

This also affects golang.org/x/net/http2/h2c and HeaderValuesContainsToken in golang.org/x/net/http/httpguts.

NVD (es)

net/http en Go versiones anteriores a 1.15.12 y versiones 1.16.x anteriores a 1.16.4, permite a atacantes remotos causar una denegación de servicio (pánico) por medio de un encabezado grande en los parámetros ReadRequest o ReadResponse. El Servidor, el Transporte y el Cliente pueden estar afectados en algunas configuraciones

References

https://groups.google.com/g/golang-announce/c/cu9SP4eSXMcadvisory, mailing-list, third-party-advisory, web
https://github.com/golang/go/issues/45710advisory, issue-tracking, patch, third-party-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ISRZZ6NY5R2TBYE72KZFOCO25TEUQTBF/vendor-advisory, web
https://security.gentoo.org/glsa/202208-02advisory, third-party-advisory, vendor-advisory, web
https://nvd.nist.gov/vuln/detail/CVE-2021-31525advisory, web
https://github.com/golang/gopackage
https://go.dev/cl/313069fix, web
https://go.dev/issue/45710report, web
https://go.googlesource.com/net/+/89ef3d95e781148a0951956029c92a211477f7f9fix, web
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ISRZZ6NY5R2TBYE72KZFOCO25TEUQTBFweb
https://pkg.go.dev/vuln/GO-2022-0236web

Related

Sources

SourceRecordLicence
CVE ListCVE-2021-31525 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-h86h-8ppg-mxmh changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2022-0236 changed 2026-02-04CC-BY-4.0
NVDCVE-2021-31525 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-GOLANG-2021-31525 changed 2026-09-08Apache-2.0