CVE-2025-59937: Github.com/wneessen/go mail Go-mail Has Insufficient Address Encoding Vulnerability

HIGH
Advisory Identifier: GHSA-wpwj-69cm-q9c5
CWE-88
Published
Advisory Summary

CVE-2025-59937 is a HIGH go-mail has insufficient address encoding vulnerability (CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')) affecting Github.com/wneessen/go mail libraries in the Go ecosystem. The issue involves go-mail has insufficient address encoding when passing mail addresses to the smtp client. Remediation is available by upgrading affected packages to version 0.7.1.

CVE-2025-59937 at a Glance

CVE Identifier CVE-2025-59937
GHSA Identifier GHSA-wpwj-69cm-q9c5
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
Affected Product Github.com/wneessen/go mail
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2025-59937

To remediate this vulnerability, upgrade all affected Github.com/wneessen/go mail dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/wneessen/go-mail fixed: 0.7.1
Upgrade github.com/wneessen/go-mail to 0.7.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/wneessen/go-mail

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-59937, inspect your project dependencies for Github.com/wneessen/go mail:

inspect dependencies for github.com/wneessen/go-mail

Analyze the terminal output to locate any version of Github.com/wneessen/go mail in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.7.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection'), where the product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string. In Github.com/wneessen/go mail, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Due to incorrect handling of the `mail.Address` values when a sender- or recipient address is passed to the corresponding `MAIL FROM` or `RCPT TO` commands of the SMTP client, this could lead to a possible wrong address routing or even to ESMTP parameter smuggling. #### Vulnerability details Instead of making use of the `String()` method of `mail.Address`, which takes care of proper escaping and quotation of mail address, we used the `Address` value of the `mail.Address` which is the raw value when passing it to our SMTP client. This meant, if a mail address like this was set: `"toni.tester@example.com> ORCPT=admin@admin.com"@example.com` for a sender or recipient, instead of the correctly quoted/escaped address, the SMTP client would get the raw value passed which would translate into something like this being passed to the SMTP server: `RCPT TO:<toni.tester@example.com> ORCPT=admin@admin.com@example.com>`. Since ORCTP is a valid command for the SMTP server, the mail would be routed to the wrong address. Additionally, other SMTP commands could potientially be smuggled in using this method causing unexpected behaviour. #### Exploitation requirements For successful exploitation of this vulnerability it is required that the user's code is allowing for arbitrary mail address input (i. e. through a web form or similar). If only static mail addresses are used (i. e. in a config file) and the mail addresses in use do not consist of quoted local parts, this should not affect your code. ### Patches The vulnerability has been fixed with PR #496 and the fix has been shipped with the go-mail v0.7.1 release. Issue #495 holds the full report and discussion.

CVE-2025-59937 Affected Github.com/wneessen/go mail Versions

1 component(s)
Fixed Versions:
0.7.1
Product / Package Ecosystem Affected Versions Fixed Version
github.com/wneessen/go-mail
Go
< 0.7.1
0.7.1

References

Frequently Asked Questions

What is CVE-2025-59937?
CVE-2025-59937 is a security vulnerability in Github.com/wneessen/go mail involving go-mail has insufficient address encoding when passing mail addresses to the SMTP client under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection').
Which Github.com/wneessen/go mail versions are affected?
Affected versions include releases prior to 0.7.1 across affected packages: github.com/wneessen/go-mail.
What version fixes CVE-2025-59937?
Upgrading to 0.7.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/wneessen/go-mail affected?
Yes, github.com/wneessen/go-mail is affected in releases prior to 0.7.1. Upgrade your dependency to 0.7.1 or later.
What CWE is associated with CVE-2025-59937?
CVE-2025-59937 is classified under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') (The product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string.).
How can I check Go dependencies for CVE-2025-59937?
Run the dependency tree command: 'inspect dependencies for github.com/wneessen/go-mail'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wpwj-69cm-q9c5",
  "modified" : "2025-11-05T22:01:58Z",
  "published" : "2025-09-29T16:28:58Z",
  "aliases" : [ "CVE-2025-59937" ],
  "summary" : "go-mail has insufficient address encoding when passing mail addresses to the SMTP client",
  "details" : "### Impact\nDue to incorrect handling of the `mail.Address` values when a sender- or recipient address is passed to the corresponding `MAIL FROM` or `RCPT TO` commands of the SMTP client, this could lead to a possible wrong address routing or even to ESMTP parameter smuggling.\n\n#### Vulnerability details\nInstead of making use of the `String()` method of `mail.Address`, which takes care of proper escaping and quotation of mail address, we used the `Address` value of the `mail.Address` which is the raw value when passing it to our SMTP client.\n\nThis meant, if a mail address like this was set: `\"toni.tester@example.com> ORCPT=admin@admin.com\"@example.com` for a sender or recipient, instead of the correctly quoted/escaped address, the SMTP client would get the raw value passed which would translate into something like this being passed to the SMTP server: `RCPT TO:<toni.tester@example.com> ORCPT=admin@admin.com@example.com>`. \n\nSince ORCTP is a valid command for the SMTP server, the mail would be routed to the wrong address. Additionally, other SMTP commands could potientially be smuggled in using this method causing unexpected behaviour.\n\n#### Exploitation requirements\nFor successful exploitation of this vulnerability it is required that the user's code is allowing for arbitrary mail address input (i. e. through a web form or similar). If only static mail addresses are used (i. e. in a config file) and the mail addresses in use do not consist of quoted local parts, this should not affect your code.\n\n### Patches\nThe vulnerability has been fixed with PR #496 and the fix has been shipped with the go-mail v0.7.1 release.\n\nIssue #495 holds the full report and discussion.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/wneessen/go-mail"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.7.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/wneessen/go-mail/security/advisories/GHSA-wpwj-69cm-q9c5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-59937"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/wneessen/go-mail/issues/495"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/wneessen/go-mail/pull/496"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/wneessen/go-mail/commit/42e92cfe027be04aff72921adb0f72f11d517479"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/wneessen/go-mail"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2025-3988"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-88" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-29T16:28:58Z",
    "nvd_published_at" : "2025-09-29T23:15:31Z"
  }
}