Recipient injection in emailjs exposes address parsing as a security boundary
Email libraries often sit between user-controlled text and an authenticated mail relay. That position makes the address parser part of the security boundary. CVE-2026-138293 affects emailjs versions 3.2.0 before 5.0.4, where the addressparser tokenizer can be tricked into producing hidden recipients through nested comments, semicolons, or backslash escapes. The issue is classified as CWE-20 and is fixed in 5.0.4.
The practical risk is message redirection and unintended disclosure. A workflow that accepts a recipient string for a password reset, invoice, support reply, or notification may believe it is sending to one address while the parser constructs another delivery set. The vulnerability description does not establish that every application is exploitable. The effect depends on where parsed addresses are used, whether callers add their own recipient allowlist, and how the SMTP relay handles duplicate or malformed headers.
Where the trust decision moved
Input validation traditionally focuses on the mailbox syntax a user sees. This case shows that tokenizer behavior also matters. Comments, quoted strings, escapes, and separators can change how a long address expression is interpreted. If an application validates the first visible address and then passes the full string to emailjs, the validation and delivery logic may operate on different models of the message.
The safest pattern separates authorization from formatting. First decide whether the requesting account may send to the normalized mailbox. Then construct the envelope and header recipients from the validated value. Do not pass a free-form address list from a web request directly into a mail parser. For systems that must support multiple recipients, parse first with the patched library, inspect every result, enforce a count limit, and reject ambiguous syntax.
Checks for deployed applications
Inventory services that import emailjs directly or through a framework wrapper. Lockfiles and bundled server code matter more than a package manifest that lists a range.
Review every call that passes a user-controlled recipient to send. Confirm that the destination was selected from an internal account record or checked against an explicit allowlist.
Search logs for unexpected secondary recipients, repeated envelope construction, or send failures that mention malformed comments and escapes. Retain the original input and the parsed result when diagnosing a disputed message.
After upgrading to 5.0.4 or later, test nested comments, semicolons, quoted strings, and backslash escapes against the application wrapper. A library update protects the parser, but it does not repair a workflow that already trusts an unvalidated free-form recipient list.
Scope and response
This is a parser defect with a confidentiality and integrity impact, not a remote code execution flaw. The CVE record rates the network attack vector with no required privileges, but applications can reduce exposure by treating recipient selection as an authorization decision. Operators should combine the upgrade with recipient allowlists, message-rate limits, and logging that records both the requested and actual delivery targets.
