GO-2026-7029: Unbounded memory allocation during BDAT transaction in github.com/emersion/go-smtp
Published 2026-11-23 · Updated 2026-11-23
Summary
A vulnerability in github.com/emersion/go-smtp allows remote clients to bypass connection line length limits during BDAT transactions. Software maintainers using affected versions of github.com/emersion/go-smtp should upgrade to version 0.25.1 to prevent denial of service caused by unbounded memory allocation.
Who is affected
Applications integrating github.com/emersion/go-smtp to handle SMTP connections are susceptible to unbounded memory consumption and denial of service. The vulnerability is triggered when a remote client sends another command between two BDAT commands before a BDAT LAST chunk or error occurs. This behavior causes Conn.handleBdat to bypass the Server.MaxLineLength restriction, allowing large payloads to be processed without line length limits.
Exploitability
CVSS vector and base score details are not provided for this flaw, and EPSS metrics are currently not available. The vulnerability is not documented as actively exploited according to the CISA Known Exploited Vulnerabilities catalog.
Remediation
- Upgrade github.com/emersion/go-smtp to fixed version 0.25.1 or higher.
- Rebuild and redeploy applications to ensure the update takes effect in production environments.
How to check your project
- Check project go.mod and go.sum files for github.com/emersion/go-smtp versions from 0.15.0 up to 0.25.0.
- Execute go list -m github.com/emersion/go-smtp in your Go workspace to inspect the currently resolved dependency version.
Automated analysis of the published advisory data, generated 2026-11-23. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| Go | github.com/emersion/go-smtp |
>= 0.15.0, < 0.25.1 | 0.25.1 | go get github.com/emersion/[email protected] |
FAQ
What specific mechanism causes this vulnerability?
Conn.handleBdat disables the line length limit on the reader while reading a BDAT chunk and only restores it on an error or on the final BDAT LAST chunk. Sending an intermediate command between BDAT commands bypasses Server.MaxLineLength.
Is there a documented workaround available?
Not documented. Remediation requires updating the dependency to a non-vulnerable version.
Has this vulnerability been actively exploited in the wild?
Active exploitation is not documented; the vulnerability is marked as 'no' in the CISA Known Exploited Vulnerabilities catalog.
Original advisory description
References
- FIX https://github.com/emersion/go-smtp/commit/eb903bcc09670a2b04a7b5f210c29c465289df1a
- REPORT https://github.com/golang/vulndb/issues/7029
- WEB https://github.com/emersion/go-smtp/releases/tag/v0.25.1
Source records: GO-2026-7029 (OSV.dev).