/

CVE-2026-82659

Severity:

HIGH RISK

(7.1)

External File/URL Access (CWE-73) in Nodemailer Library

CVE-2026-82659

Awaiting Analysis

Vulnerability type

Category:

External Control of File Name or Path

CWE:

CWE-73

Impact:

Arbitrary File Read and Server-Side Request Forgery

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Nodemailer fails to apply its file and URL access restrictions to message-level raw content, allowing authenticated attackers to supply file paths or URLs that bypass the intended controls. The resulting content may be read from the server or fetched from internal or external services and then included in messages sent to attacker-controlled recipients.

Affected context

This issue affects Nodemailer deployments that:

  • Permit authenticated users or applications to submit raw message content
  • Rely on disableFileAccess or disableUrlAccess for sandboxing
  • Process message-level path or href properties without applying those restrictions

Risk is higher when the mail service can access sensitive local files, cloud metadata endpoints, internal services, or privileged network segments.

Exploit preconditions

  • Attack surface: Message composition and raw-message processing
  • Required access: Authenticated access capable of submitting or influencing raw message fields
  • Trigger point: Message creation or delivery when a path or href property is resolved
  • Why exploitation is possible: Access-control flags are not consistently propagated to message-level raw options, allowing attacker-supplied file or URL references to bypass the intended sandbox

Why this happens

The vulnerability results from inconsistent enforcement of security options across nested or alternate message representations.

Although Nodemailer provides flags intended to disable file and URL access, the message-level raw option does not apply those restrictions when resolving attacker-controlled path or href properties.

This maps to CWE-73: External Control of File Name or Path, because externally influenced resource names or locations are used without consistently enforcing the expected trust and access boundaries.

Potential impact

  • Attackers may read arbitrary files accessible to the mail process
  • The server may make requests to internal services or cloud metadata endpoints
  • Sensitive response content could be delivered to attacker-controlled recipients
  • Internal network information or credentials may be exposed
  • The mail service could be used as a pivot into protected infrastructure

General mitigation guidance

Mitigation generally focuses on enforcing resource-access restrictions consistently across every message representation and processing path.

Common defensive patterns include:

  • Applying file and URL access policies to raw and nested message options
  • Disallowing externally supplied paths and URLs by default
  • Allowlisting approved directories, schemes, hosts, and destinations when access is required
  • Resolving local paths against a controlled directory and rejecting traversal or ambiguous references
  • Restricting outbound network access from mail-processing services
  • Running the mail process with least-privilege filesystem and network permissions
  • Separating message submission privileges from infrastructure-level access

How teams detect issues like this

Organizations can identify similar risks through:

  • Static analysis for user-controlled path, href, file, and URL values reaching message construction
  • Code review checks confirming security flags are propagated through raw and nested message paths
  • Tests that verify disabled file and URL access remains effective for every supported message format
  • Egress policies and alerts for mail services contacting private addresses, metadata endpoints, or unexpected destinations
  • Filesystem monitoring for sensitive-file reads by the mail process

Automated security review tools may help identify missing validation and inconsistent policy enforcement.

Sources

SourceLink
github.comgithub.com/nodemailer/nodemailer/security/advisories/GHSA-p6gq-j5cr-w38f
vulncheck.comvulncheck.com/advisories/nodemailer-before-9.0.1-file-read-and-ssrf-via-raw-option

Frequently asked

questions

It can be exploitable through a network-facing mail submission workflow when an authenticated user can influence raw message properties. The practical scope depends on which users can submit messages and what resources the server can access.

Authentication is generally required, along with permission to create or modify messages containing the relevant raw fields. The attacker also benefits from the service being able to read sensitive files or reach protected network destinations.

Enforce file and URL access restrictions uniformly for raw and nested message options, while defaulting to deny and using narrowly scoped allowlists for any required resource access.

Treat message fields as untrusted input, test security controls across every parsing and composition path, restrict filesystem and network privileges, and monitor unexpected file reads and outbound requests.

Find out what's already
exploitable in your codebase.