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.
{
"url": "https://pkg.go.dev/vuln/GO-2025-4012",
"review_status": "REVIEWED"
}{
"imports": [
{
"path": "net/http",
"symbols": [
"Client.Do",
"Client.Get",
"Client.Head",
"Client.Post",
"Client.PostForm",
"Get",
"Head",
"ParseCookie",
"Post",
"PostForm",
"Request.Cookie",
"Request.Cookies",
"Request.CookiesNamed",
"Response.Cookies",
"readCookies",
"readSetCookies"
]
}
]
}