CVE-2025-58186 Lack of limit when parsing cookies can cause memory exhaustion in net/http
An attacker can cause memory exhaustion in Go HTTP servers by sending numerous small cookies, leading to denial of service.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-58186?
CVE-2025-58186 is a medium-severity denial of service vulnerability in Go standard library net/http, published on 29 Oct 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Despite HTTP headers having a default limit of 1MB, the number of cookies that can be parsed does not have a limit. By sending a lot of very small cookies such as "a=;", an attacker can make an HTTP server allocate a large amount of structs, causing large memory consumption.
Which versions are affected by CVE-2025-58186?
2 open source packages ship an affected version, including golang and stdlib.
| Package | Affected | Fixed in |
|---|---|---|
golang Bitnami | All versions | 1.24.8, 1.25.2 |
stdlib Go | All versions | 1.24.8, 1.25.2 |
How do I fix CVE-2025-58186?
Upgrade golang to a fixed version for your release line: 1.24.8 or 1.25.2.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2025-58186 being exploited?
There is no known exploitation of CVE-2025-58186 in the wild and no public exploit code.
Sources
Also known as AZL-69140, AZL-69254, AZL-78911, AZL-98670, BELL-CVE-2025-58186, BIT-golang-2025-58186 and 284 more.