CVE-2024-24784: Comments in display names incorrectly handled in net/mail
Summary
CVE-2024-24784: Comments in display names are incorrectly handled in net/mail. 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-2024-24784 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 net/mail package is a part of the Go standard library and provides functionality for parsing and formatting email addresses. It includes functions for parsing address lists, headers, and individual addresses. The package is widely used in Go applications for email-related operations.
Vulnerability Detail
The ParseAddressList function in the net/mail package incorrectly handles comments (text within parentheses) within display names. This deviation from conforming address parsers can lead to different trust decisions being made by programs using different parsers. This vulnerability can potentially be exploited to manipulate email addresses and deceive email clients or servers.
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
As a temporary workaround, developers can manually sanitize and validate email addresses before using them in their applications. This can involve removing any comments within display names or using a different email parsing library that correctly handles comments.
Conclusion
The vulnerability in the net/mail package's handling of comments in display names can lead to trust decisions being made based on different parsers, potentially resulting in email address manipulation and deception. Developers should update their applications to the fixed versions of Go and consider implementing additional email address validation measures. For further support on vulnerability remediation, contact DevNack.com.
See every vulnerability recorded for stdlib →
FAQ
This vulnerability can potentially be exploited to manipulate email addresses and deceive email clients or servers. It can lead to trust decisions being made based on different parsers, which can result in security risks or incorrect email handling.
Versions of Go prior to 1.21.8 and 1.22.1 are affected by this vulnerability. Developers should update to these versions or later to mitigate the issue.
There are no known instances of this vulnerability being actively exploited at the time of this report. However, it is important to promptly update affected applications to prevent potential exploitation.
Yes, using a different email parsing library that correctly handles comments can be a workaround for this vulnerability. However, it is still recommended to update to the fixed versions of Go to ensure overall security.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities, using Gopkg.lock to analyze dependencies without requiring access to the code or installation.
References
Related vulnerabilities
Recent vulnerabilities recorded for stdlib.