Vulnerability · Published Oct 29, 2025 · Assigned by Go

CVE-2025-58186Lack of limit when parsing cookies can cause memory exhaustion in net/http

Medium 5.3

In plain English

A medium-severity security flaw in net/http from Go standard library. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 47% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)5.3Medium
Exploit odds (30 days)0.6%top 52.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.22go1.24.8-r0ALPINE-CVE-2025-58186
Alpine:v3.23go1.25.2-r0ALPINE-CVE-2025-58186
Alpine:v3.24go1.25.2-r0ALPINE-CVE-2025-58186
Debian:12golang-1.19no fix listedDEBIAN-CVE-2025-58186
Debian:13golang-1.24no fix listedDEBIAN-CVE-2025-58186
Gostdlib1.24.8, 1.25.2GO-2025-4012
Ubuntu:22.04:LTSgolang-1.17no fix listedUBUNTU-CVE-2025-58186
Ubuntu:22.04:LTSgolang-1.18no fix listedUBUNTU-CVE-2025-58186
Ubuntu:22.04:LTSgolang-1.20no fix listedUBUNTU-CVE-2025-58186
Ubuntu:22.04:LTSgolang-1.21no fix listedUBUNTU-CVE-2025-58186
Ubuntu:24.04:LTSgolang-1.21no fix listedUBUNTU-CVE-2025-58186
Ubuntu:22.04:LTSgolang-1.22no fix listedUBUNTU-CVE-2025-58186
Ubuntu:24.04:LTSgolang-1.22no fix listedUBUNTU-CVE-2025-58186
Ubuntu:22.04:LTSgolang-1.23no fix listedUBUNTU-CVE-2025-58186
Ubuntu:24.04:LTSgolang-1.23no fix listedUBUNTU-CVE-2025-58186
Ubuntu:25.10golang-1.23no fix listedUBUNTU-CVE-2025-58186
Ubuntu:26.04:LTSgolang-1.23no fix listedUBUNTU-CVE-2025-58186
Ubuntu:22.04:LTSgolang-1.24no fix listedUBUNTU-CVE-2025-58186
Ubuntu:24.04:LTSgolang-1.24no fix listedUBUNTU-CVE-2025-58186
Ubuntu:25.10golang-1.24no fix listedUBUNTU-CVE-2025-58186
Ubuntu:26.04:LTSgolang-1.24no fix listedUBUNTU-CVE-2025-58186
Ubuntu:22.04:LTSgolang-1.25no fix listedUBUNTU-CVE-2025-58186
Ubuntu:24.04:LTSgolang-1.25no fix listedUBUNTU-CVE-2025-58186
Ubuntu:25.10golang-1.25no fix listedUBUNTU-CVE-2025-58186
Ubuntu:26.04:LTSgolang-1.25no fix listedUBUNTU-CVE-2025-58186

Affected products (as reported)

VendorProductVersions
Go standard library net/http 0 – before 1.24.81.25.0 – before 1.25.2

References