You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
net/http: lack of limit when parsing cookies can cause memory exhaustion (CVE-2025-58186) #75672
Despite HTTP headers having a default limit of 1 MB, the number of cookies that can be parsed did 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.
net/http now limits the number of cookies accepted to 3000, which can be adjusted using the httpcookiemaxnum GODEBUG option.
Change https://go.dev/cl/709840 mentions this issue: [release-branch.go1.24] net/http: add httpcookiemaxnum GODEBUG option to limit number of cookies parsed
Change https://go.dev/cl/709849 mentions this issue: [release-branch.go1.25] net/http: add httpcookiemaxnum GODEBUG option to limit number of cookies parsed
changed the title [-]security: fix CVE-2025-58186[/-][+]net/http: lack of limit when parsing cookies can cause memory exhaustion (CVE-2025-58186)[/+]on Oct 7, 2025
Activity
neild commentedon Oct 1, 2025
@gopherbot please open backport issues for this security fix
gopherbot commentedon Oct 1, 2025
Backport issue(s) opened: #75706 (for 1.24), #75707 (for 1.25).
Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.
gopherbot commentedon Oct 7, 2025
Change https://go.dev/cl/709840 mentions this issue:
[release-branch.go1.24] net/http: add httpcookiemaxnum GODEBUG option to limit number of cookies parsedgopherbot commentedon Oct 7, 2025
Change https://go.dev/cl/709849 mentions this issue:
[release-branch.go1.25] net/http: add httpcookiemaxnum GODEBUG option to limit number of cookies parsedgopherbot commentedon Oct 7, 2025
Change https://go.dev/cl/709855 mentions this issue:
net/http: add httpcookiemaxnum GODEBUG option to limit number of cookies parsed[release-branch.go1.24] net/http: add httpcookiemaxnum GODEBUG option…
[release-branch.go1.25] net/http: add httpcookiemaxnum GODEBUG option…
net/http: add httpcookiemaxnum GODEBUG option to limit number of cook…
[-]security: fix CVE-2025-58186[/-][+]net/http: lack of limit when parsing cookies can cause memory exhaustion (CVE-2025-58186)[/+][release-branch.go1.24] net/http: add httpcookiemaxnum GODEBUG option…
[release-branch.go1.24] net/http: add httpcookiemaxnum GODEBUG option…
[release-branch.go1.25] net/http: add httpcookiemaxnum GODEBUG option…
[release-branch.go1.25] net/http: add httpcookiemaxnum GODEBUG option…