CVE-2021-31525: Input Validation

Published Apr 22, 2021
·
Updated

A vulnerability was detected in net/http of the Go standard library when parsing very large HTTP header values, causing a crash and subsequent denial of service. This vulnerability affects both clients and servers written in Go, however, servers are only vulnerable if the value of MaxHeaderBytes has been increased from the default.

Other sources

Golang Go is vulnerable to a denial of service, caused by a flaw in net/http. By sending a specially-crafted header to ReadRequest or ReadResponse. Server, Transport, and Client, a remote attacker could exploit this vulnerability to cause a (panic) denial of service condition.

IBM

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.

GitHub

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.

ReadRequest and ReadResponse in net/http 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.

Reference: https://github.com/golang/go/issues/45710

Red Hat

Affected Software

26 affected componentsFixes available
redhat/heketi<0:10.4.0-2.el7
0:10.4.0-2.el7
redhat/openshift-serverless-clients<0:0.22.0-3.el8
0:0.22.0-3.el8
redhat/openshift-serverless-clients<0:0.23.2-1.el8
0:0.23.2-1.el8
redhat/ignition<0:2.9.0-4.rhaos4.7.git1d56dc8.el8
0:2.9.0-4.rhaos4.7.git1d56dc8.el8
redhat/cri-o<0:1.21.2-8.rhaos4.8.git8d4264e.el8
0:1.21.2-8.rhaos4.8.git8d4264e.el8
redhat/ignition<0:2.9.0-7.rhaos4.8.el8
0:2.9.0-7.rhaos4.8.el8
redhat/openshift<0:4.8.0-202107300027.p0.git.38b3ecc.assembly.stream.el8
0:4.8.0-202107300027.p0.git.38b3ecc.assembly.stream.el8
redhat/openshift-clients<0:4.8.0-202107292313.p0.git.1077b05.assembly.stream.el7
0:4.8.0-202107292313.p0.git.1077b05.assembly.stream.el7
redhat/containernetworking-plugins<0:0.8.6-3.rhaos4.6.el7
0:0.8.6-3.rhaos4.6.el7
redhat/cri-tools<0:1.21.0-3.el8
0:1.21.0-3.el8
redhat/golang-github-prometheus-promu<0:0.5.0-4.git642a960.el8
0:0.5.0-4.git642a960.el8
redhat/etcd<0:3.3.23-3.1.el8
0:3.3.23-3.1.el8
redhat/kubevirt<0:4.9.0-287.el8
0:4.9.0-287.el8
go/golang.org/x/net<0.0.0-20210428140749-89ef3d95e781
0.0.0-20210428140749-89ef3d95e781
redhat/golang<1.17.0
1.17.0
redhat/golang<1.16.4
1.16.4
redhat/golang<1.15.12
1.15.12
IBM Data Virtualization on Cloud Pak for Data<=3.0
IBM Watson Query on Cloud Pak for Data<=2.2
IBM Watson Query on Cloud Pak for Data<=2.1
IBM Watson Query on Cloud Pak for Data<=2.0
IBM Data Virtualization on Cloud Pak for Data<=1.8
IBM Data Virtualization on Cloud Pak for Data<=1.7
Golang Go<1.15.12
Golang Go>=1.16.0<1.16.4
Fedoraproject Fedora=34

Event History

Apr 22, 2021
CVE Published
12:00 AM
May 7, 2021
Data Sourced
via Red Hat·04:49 PM
DescriptionSeverityAffected Software
May 27, 2021
CVE Published
via MITRE·12:17 PM
Data Sourced
via MITRE·12:17 PM
Description
May 24, 2022
Advisory Published
via GitHub·07:03 PM
Aug 15, 2025
Data Sourced
via IBM·03:29 PM
DescriptionAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2021-31525?

CVE-2021-31525 is a vulnerability in net/http of the Go standard library that allows remote attackers to cause a denial of service.

2

Which software is affected by CVE-2021-31525?

The vulnerability affects net/http in Go before 1.15.12 and 1.16.x before 1.16.4.

3

How does CVE-2021-31525 impact servers?

Servers written in Go are vulnerable to CVE-2021-31525 only if the value of MaxHeaderBytes has been increased, which is not the default configuration.

4

How can I fix CVE-2021-31525?

To fix CVE-2021-31525, upgrade to Go version 1.15.12 or 1.16.4.

5

Where can I find more information about CVE-2021-31525?

More information about CVE-2021-31525 can be found on the NIST National Vulnerability Database (NVD) and the official Go GitHub page.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203
CVE-2021-31525 - Input Validation - SecAlerts