CVE-2023-45290: Memory exhaustion in multipart form parsing in net/textproto and net/http
Summary
CVE-2023-45290: Memory exhaustion in multipart form parsing in net/textproto and net/http. Affects stdlib across 2 version ranges.
< 1.21.8
>= 1.22.0-0, < 1.22.1
Fixed in 1.21.8 or 1.22.1, depending on the release line you run. How to fix ↓
Also tracked for
- golang · Bitnami
- golang-1.15 · Debian:11
The same CVE-2023-45290 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The package under scrutiny is the Go standard library (stdlib), specifically the net/textproto and net/http packages. The net/textproto package provides support for parsing and generating textual protocols, while the net/http package provides HTTP client and server implementations. These packages are widely used in Go applications for handling network communication. However, a vulnerability has been discovered in the multipart form parsing functionality of these packages.
Vulnerability Detail
The vulnerability arises when parsing a multipart form using the affected packages. The issue is that the limits on the total size of the parsed form were not applied to the memory consumed while reading a single form line. This allows an attacker to craft malicious input with very long lines, leading to the allocation of arbitrarily large amounts of memory. As a result, this can potentially cause memory exhaustion, impacting the availability and performance of the affected application. The vulnerability has been assigned the CVE identifier CVE-2023-45290.
How To Fix
Latest published version: go1.25.5 as of 22 Oct 2026
go get stdlib@vgo1.25.5
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
< 1.21.81.21.8go get stdlib@v1.21.8 -
>= 1.22.0-0, < 1.22.11.22.1go get stdlib@v1.22.1
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
There is no specific workaround mentioned for this vulnerability. However, as a general best practice, it is advisable to implement input validation and sanitization to mitigate the risk of malicious inputs. Additionally, monitoring and limiting the resources allocated for form parsing can help mitigate the impact of memory exhaustion attacks.
Conclusion
In conclusion, the Go standard library's net/textproto and net/http packages are vulnerable to a memory exhaustion issue in multipart form parsing. This vulnerability can be mitigated by updating to version 1.22.1 or later. It is important to promptly apply the fix to prevent potential memory exhaustion attacks. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for stdlib →
FAQ
The vulnerability can lead to memory exhaustion, potentially causing the affected application to become unresponsive or crash due to excessive memory consumption.
You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your Gopkg.lock file, and Vulert will analyze it for any open-source vulnerabilities, including this one.
No, not all versions are affected. The vulnerability was introduced in version 1.22.0-0 and fixed in version 1.22.1. Therefore, versions prior to 1.22.0-0 and versions from 1.22.1 onwards are not vulnerable.
There is no known public exploit for this vulnerability at the time of this report. However, it is important to apply the fix as soon as possible to prevent potential exploitation.
While input validation is a good security practice, it alone may not be sufficient to mitigate this vulnerability. It is recommended to update to the fixed version of the Go standard library to ensure proper mitigation.
References
Related vulnerabilities
Recent vulnerabilities recorded for stdlib.