GO-2025-4012

Source
https://pkg.go.dev/vuln/GO-2025-4012
Import Source
https://vuln.go.dev/ID/GO-2025-4012.json
JSON Data
https://api.osv.dev/v1/vulns/GO-2025-4012
Aliases
Published
2025-10-29T21:50:05Z
Modified
2025-11-06T13:59:39.685338Z
Summary
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.

Database specific
{
    "url": "https://pkg.go.dev/vuln/GO-2025-4012",
    "review_status": "REVIEWED"
}
References
Credits
    • jub0bs

Affected packages

Go / stdlib

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.24.8
Introduced
1.25.0
Fixed
1.25.2

Ecosystem specific

{
    "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"
            ]
        }
    ]
}