GHSA-g57g-f23g-4646: Nodemailer Quoted Local-part Can Produce Malformed Vulnerability

MODERATE
CVSS 5.3
CWE-436 CWE-20
Published
Advisory Summary

GHSA-g57g-f23g-4646 is a MODERATE (CVSS 5.3) quoted local-part can produce malformed vulnerability (CWE-436: Interpretation Conflict) affecting Nodemailer libraries in the npm ecosystem. The issue involves quoted local-part can produce malformed envelope recipient through rfc 5322 comment parsing. Remediation is available by upgrading affected packages to version 10.0.9.

GHSA-g57g-f23g-4646 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-g57g-f23g-4646
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-436: Interpretation Conflict
Affected Product Nodemailer
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-g57g-f23g-4646

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

nodemailer fixed: 10.0.9
npm install nodemailer@10.0.9
Verify Direct and Transitive Dependencies

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

npm ls nodemailer

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-g57g-f23g-4646, inspect your project dependencies using npm:

npm ls nodemailer

Analyze the terminal output to locate any version of Nodemailer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.0.9), your application is affected.

Note: The npm ls nodemailer command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-436: Interpretation Conflict, where product a handles inputs or steps differently than product b, which causes a to perform incorrect actions based on its perception of b's state. In Nodemailer, 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

## Summary Nodemailer's address parser can produce an unexpected recipient address when an RFC 5322 comment follows the domain of an address whose local-part is a quoted string. For example: ```text "user"@example.com(x)evil.com ``` is parsed as: ```text { address: "user@example.com evil.com", name: "" } ``` The resulting address therefore contains additional attacker-controlled domain text separated by a literal space. The parsed `.address` value is subsequently propagated into the SMTP envelope: ```text src/addressparser/index.ts ↓ recipient.address ↓ src/mime-node/index.ts ↓ envelope.to ``` The envelope construction uses the parsed address without another strict address validation step. This appears to be a variant of the RFC 5322 comment parsing issue addressed by GHSA-cc9r-2j5m-2m83, but it follows a different parser path when the local-part is quoted. ## Reproduction Input: ```text "user"@example.com(x)evil.com ``` Observed parser output: ```text address: "user@example.com evil.com" name: "" ``` A second example: ```text "a"@b.com(c)d.com(e)f.com ``` produces: ```text address: "a@b.com d.com f.com" name: "" ``` For comparison, the corresponding unquoted form: ```text user@example.com(x)evil.com ``` takes a different code path and is handled by the existing protection differently. ## Technical Details The issue is caused by different parsing behavior for quoted and unquoted local-parts. The quoted-local-part variant allows the comment-separated trailing domain atoms to remain in the resulting `.address` value. That value is then used when constructing the message envelope: ```text envelope.to = recipients.map(to => to.address as string) ``` No additional strict recipient validation is performed at this boundary. ## Security Impact The confirmed impact is that attacker-controlled comment content can result in a malformed/ambiguous recipient address being accepted by the parser and propagated into `envelope.to`. The reporter did **not confirm successful delivery to an unintended recipient through a real SMTP server using this exact quoted-local-part variant**. The remaining question is how real SMTP servers and other Nodemailer transports handle an envelope recipient containing a value such as: ```text user@example.com evil.com ``` An end-to-end SMTP test is required to determine whether this parser behavior results in an exploitable delivery or recipient-validation bypass. ## Relationship to GHSA-cc9r-2j5m-2m83 This report is intended as a potential variant/follow-up to GHSA-cc9r-2j5m-2m83. The existing advisory addresses RFC 5322 comment handling in email domains. This report identifies a separate parser path involving quoted local-parts that can preserve additional domain-like content in the normalized address. Please evaluate whether this behavior is already covered by the existing fix or represents a remaining parser variant. ## Suggested Fix The parser should consistently reject or correctly terminate addresses containing trailing domain atoms after RFC 5322 comments, regardless of whether the local-part is quoted. In particular: ```text "user"@example.com(x)evil.com ``` should not result in: ```text user@example.com evil.com ``` The envelope-generation layer should also avoid assuming that a parser-produced address is safe for SMTP delivery without appropriate validation. ## Verification Status Confirmed: * Parser accepts the quoted-local-part variant. * Parser produces an address containing additional attacker-controlled text. * The resulting address is propagated into `envelope.to`. Not confirmed by reporter: * Successful delivery through a real SMTP server. * Delivery to an unintended recipient. * Exploitability against a specific downstream SMTP implementation.

GHSA-g57g-f23g-4646 Affected Nodemailer Versions

1 component(s)
Fixed Versions:
10.0.9
Product / Package Ecosystem Affected Versions Fixed Version
nodemailer
npm
≥ 9.1.0
< 10.0.9
10.0.9

References

Frequently Asked Questions

What is GHSA-g57g-f23g-4646?
GHSA-g57g-f23g-4646 is a security vulnerability in Nodemailer involving Quoted local-part can produce malformed envelope recipient through RFC 5322 comment parsing under CWE-436: Interpretation Conflict.
Which Nodemailer versions are affected?
Affected versions include releases prior to 10.0.9 across affected packages: nodemailer.
What version fixes GHSA-g57g-f23g-4646?
Upgrading to 10.0.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nodemailer affected?
Yes, nodemailer is affected in releases prior to 10.0.9. Upgrade your dependency to 10.0.9 or later.
What is the CVSS score of GHSA-g57g-f23g-4646?
GHSA-g57g-f23g-4646 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with GHSA-g57g-f23g-4646?
GHSA-g57g-f23g-4646 is classified under CWE-436: Interpretation Conflict (Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.).
How can I check npm dependencies for GHSA-g57g-f23g-4646?
Run the dependency tree command: 'npm ls nodemailer'. 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-g57g-f23g-4646",
  "modified" : "2026-09-29T23:44:04Z",
  "published" : "2026-09-29T23:44:04Z",
  "aliases" : [ ],
  "summary" : "Nodemailer: Quoted local-part can produce malformed envelope recipient through RFC 5322 comment parsing",
  "details" : "## Summary\n\nNodemailer's address parser can produce an unexpected recipient address when an RFC 5322 comment follows the domain of an address whose local-part is a quoted string.\n\nFor example:\n\n```text\n\"user\"@example.com(x)evil.com\n```\n\nis parsed as:\n\n```text\n{\n  address: \"user@example.com evil.com\",\n  name: \"\"\n}\n```\n\nThe resulting address therefore contains additional attacker-controlled domain text separated by a literal space.\n\nThe parsed `.address` value is subsequently propagated into the SMTP envelope:\n\n```text\nsrc/addressparser/index.ts\n        ↓\nrecipient.address\n        ↓\nsrc/mime-node/index.ts\n        ↓\nenvelope.to\n```\n\nThe envelope construction uses the parsed address without another strict address validation step.\n\nThis appears to be a variant of the RFC 5322 comment parsing issue addressed by GHSA-cc9r-2j5m-2m83, but it follows a different parser path when the local-part is quoted.\n\n## Reproduction\n\nInput:\n\n```text\n\"user\"@example.com(x)evil.com\n```\n\nObserved parser output:\n\n```text\naddress: \"user@example.com evil.com\"\nname: \"\"\n```\n\nA second example:\n\n```text\n\"a\"@b.com(c)d.com(e)f.com\n```\n\nproduces:\n\n```text\naddress: \"a@b.com d.com f.com\"\nname: \"\"\n```\n\nFor comparison, the corresponding unquoted form:\n\n```text\nuser@example.com(x)evil.com\n```\n\ntakes a different code path and is handled by the existing protection differently.\n\n## Technical Details\n\nThe issue is caused by different parsing behavior for quoted and unquoted local-parts.\n\nThe quoted-local-part variant allows the comment-separated trailing domain atoms to remain in the resulting `.address` value.\n\nThat value is then used when constructing the message envelope:\n\n```text\nenvelope.to = recipients.map(to => to.address as string)\n```\n\nNo additional strict recipient validation is performed at this boundary.\n\n## Security Impact\n\nThe confirmed impact is that attacker-controlled comment content can result in a malformed/ambiguous recipient address being accepted by the parser and propagated into `envelope.to`.\n\nThe reporter did **not confirm successful delivery to an unintended recipient through a real SMTP server using this exact quoted-local-part variant**.\n\nThe remaining question is how real SMTP servers and other Nodemailer transports handle an envelope recipient containing a value such as:\n\n```text\nuser@example.com evil.com\n```\n\nAn end-to-end SMTP test is required to determine whether this parser behavior results in an exploitable delivery or recipient-validation bypass.\n\n## Relationship to GHSA-cc9r-2j5m-2m83\n\nThis report is intended as a potential variant/follow-up to GHSA-cc9r-2j5m-2m83.\n\nThe existing advisory addresses RFC 5322 comment handling in email domains. This report identifies a separate parser path involving quoted local-parts that can preserve additional domain-like content in the normalized address.\n\nPlease evaluate whether this behavior is already covered by the existing fix or represents a remaining parser variant.\n\n## Suggested Fix\n\nThe parser should consistently reject or correctly terminate addresses containing trailing domain atoms after RFC 5322 comments, regardless of whether the local-part is quoted.\n\nIn particular:\n\n```text\n\"user\"@example.com(x)evil.com\n```\n\nshould not result in:\n\n```text\nuser@example.com evil.com\n```\n\nThe envelope-generation layer should also avoid assuming that a parser-produced address is safe for SMTP delivery without appropriate validation.\n\n## Verification Status\n\nConfirmed:\n\n* Parser accepts the quoted-local-part variant.\n* Parser produces an address containing additional attacker-controlled text.\n* The resulting address is propagated into `envelope.to`.\n\nNot confirmed by reporter:\n\n* Successful delivery through a real SMTP server.\n* Delivery to an unintended recipient.\n* Exploitability against a specific downstream SMTP implementation.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "nodemailer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.1.0"
      }, {
        "fixed" : "10.0.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nodemailer/nodemailer/security/advisories/GHSA-g57g-f23g-4646"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nodemailer/nodemailer/commit/2f36eb1aa1dd33e312411dc9b888548e14db54ee"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nodemailer/nodemailer"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nodemailer/nodemailer/releases/tag/v10.0.9"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-436" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-29T23:44:04Z",
    "nvd_published_at" : null
  }
}