Go Vulnerability Database
GO-2025-4012
Lack of limit when parsing cookies can cause memory exhaustion in net/http
Details
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.
Affected packages
| Ecosystem | Package | Affected versions |
|---|---|---|
| Go | stdlib | All versions before 1.24.8 (fixed in 1.24.8) From 1.25.0 before 1.25.2 (fixed in 1.25.2) |