Denial of Service in net/http due to Improper 100-Continue Handling
Summary
CVE-2024-24791: Denial of service due to improper 100-continue handling in net/http. Affects stdlib across 2 version ranges.
< 1.21.12
>= 1.22.0-0, < 1.22.5
Fixed in 1.21.12 or 1.22.5, depending on the release line you run. How to fix ↓
Also tracked for
- golang · Bitnami
- golang-1.15 · Debian:11
The same CVE-2024-24791 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Go standard library (stdlib) package 'net/http' provides functionality for building HTTP servers and clients. It includes the 'Client' type, which allows making HTTP requests. The vulnerability affects versions 0.0.0 to 1.21.12 and 1.22.0-0 to 1.22.5 of the 'net/http' package. This package is widely used in Go applications for handling HTTP communication.
Vulnerability Detail
The vulnerability arises from the mishandling of the 'Expect: 100-continue' header by the HTTP/1.1 client in 'net/http'. When a server responds to a request with this header and a non-informational (200 or higher) status, the client connection can be left in an invalid state. Subsequent requests sent on the connection will fail, leading to a denial of service. An attacker can exploit this by sending 'Expect: 100-continue' requests to a 'net/http/httputil.ReverseProxy' proxy, causing non-informational responses from the backend and leaving the proxy with invalid connections.
How To Fix
Latest published version: go1.25.5 as of 22 Oct 2026
go get stdlib@vgo1.25.5
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
< 1.21.121.21.12go get stdlib@v1.21.12 -
>= 1.22.0-0, < 1.22.51.22.5go get stdlib@v1.22.5
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
There is no known workaround for this vulnerability. Updating the 'net/http' package to the fixed versions is the recommended solution.
Conclusion
The 'net/http' package in Go's standard library is vulnerable to a denial of service attack due to improper handling of the 'Expect: 100-continue' header. By updating to the fixed versions, developers can mitigate the risk of this vulnerability and ensure the proper functioning of their HTTP clients and servers.
See every vulnerability recorded for stdlib →
FAQ
The vulnerability can be exploited to cause a denial of service by sending specially crafted requests to a 'net/http/httputil.ReverseProxy' proxy. This can lead to the failure of subsequent requests using the same connection.
Versions 0.0.0 to 1.21.12 and 1.22.0-0 to 1.22.5 of the 'net/http' package are affected.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. It analyzes your Gopkg.lock file and provides real-time alerts for open-source vulnerabilities.
No, there is no known workaround for this vulnerability. Updating the 'net/http' package to the fixed versions is the recommended solution.
There are no known public exploits for this vulnerability at the time of writing. However, it is important to apply the fix to prevent potential exploitation.
References
Related vulnerabilities
Recent vulnerabilities recorded for stdlib.