{"id":"CVE-2025-59937","aliases":["CVE-2025-59937","GHSA-wpwj-69cm-q9c5","GO-2025-3988"],"related":["CGA-j39q-mwqm-5mrc"],"kind":"vulnerability","state":"published","title":"go-mail has insufficient address encoding when passing mail addresses to the SMTP client","summary":"go-mail is a comprehensive library for sending mails with Go. In versions 0.7.0 and below, 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, there is a possibility of wrong address routing or even ESMTP parameter smuggling. For successful exploitation, it is required that the user's code allows 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 users. This issue is fixed in version 0.7.1","summarySource":"cvelist","descriptions":[{"lang":"en","text":"go-mail is a comprehensive library for sending mails with Go. In versions 0.7.0 and below, 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, there is a possibility of wrong address routing or even ESMTP parameter smuggling. For successful exploitation, it is required that the user's code allows 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 users. This issue is fixed in version 0.7.1","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Insufficient address encoding when passing mail addresses to the SMTP client in github.com/wneessen/go-mail","format":"markdown","source":"go"},{"lang":"es","text":"go-mail es una completa biblioteca para enviar correos con Go. En las versiones 0.7.0 e inferiores, debido a un manejo incorrecto de los valores de mail.Address cuando una dirección de remitente o destinatario se pasa a los comandos MAIL FROM o RCPT TO correspondientes del cliente SMTP, existe la posibilidad de un enrutamiento de dirección incorrecto o incluso contrabando de parámetros ESMTP. Para una explotación exitosa, se requiere que el código del usuario permita la entrada arbitraria de direcciones de correo (es decir, a través de un formulario web o similar). Si solo se utilizan direcciones de correo estáticas (es decir, en un archivo de configuración) y las direcciones de correo en uso no consisten en partes locales entre comillas, esto no debería afectar a los usuarios. Este problema está solucionado en la versión 0.7.1","source":"nvd"}],"published":"2025-09-29T16:28:58.000Z","modified":"2026-10-09T09:10:00.213Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"}],"cwes":["CWE-88"],"affected":[{"ranges":[{"version":"< 0.7.1","status":"affected"}],"vendor":"wneessen","product":"go-mail","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.7.1"}],"ecosystem":"Go","package":"github.com/wneessen/go-mail","purl":"pkg:golang/github.com/wneessen/go-mail","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.7.1"}],"ecosystem":"Go","package":"github.com/wneessen/go-mail","purl":"pkg:golang/github.com/wneessen/go-mail","source":"go"},{"ranges":[{"status":"affected","fixed":"0.7.1"}],"vendor":"pebcak","product":"go-mail","cpe":"cpe:2.3:a:pebcak:go-mail:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/wneessen/go-mail/security/advisories/GHSA-wpwj-69cm-q9c5","tags":["advisory","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/wneessen/go-mail/issues/495","tags":["exploit","issue-tracking","report","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/wneessen/go-mail/pull/496","tags":["fix","issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/wneessen/go-mail/commit/42e92cfe027be04aff72921adb0f72f11d517479","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-59937","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/wneessen/go-mail","tags":["package"],"sources":["ghsa"]},{"url":"https://pkg.go.dev/vuln/GO-2025-3988","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-09-30T14:43:56.630Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-59937","url":"https://www.cve.org/CVERecord?id=CVE-2025-59937","licence":"CVE Terms of Use","modified":"2025-09-30T14:44:35.194Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wpwj-69cm-q9c5","url":"https://github.com/advisories/GHSA-wpwj-69cm-q9c5","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:28.963Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2025-3988","url":"https://pkg.go.dev/vuln/GO-2025-3988","licence":"CC-BY-4.0","modified":"2026-02-04T02:51:59.143Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-59937","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-59937","licence":"Public domain","modified":"2026-10-09T09:10:00.213Z"}],"updatedAt":"2026-11-25T22:59:05.334Z","epss":{"score":0.00542,"percentile":0.46952,"date":"2026-12-01T12:00:22.000Z"}}