/

CVE-2026-93012

Severity:

CRITICAL RISK

(9.8)

OS Command Injection (CWE-78) in Email::Sender Sendmail

CVE-2026-93012

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

CRITICAL RISK

(9.8)

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

Email::Sender::Transport::Sendmail can allow arbitrary command execution on Windows when envelope addresses are incorporated into a shell command. An attacker who controls sender or recipient address data may execute commands with the privileges of the sending process when the message is transmitted.

Affected context

The vulnerability occurs in Email::Sender::Transport::Sendmail on Windows systems before the affected behavior was corrected. On MSWin32, the transport combines the envelope sender and recipients into a command string that is passed through a shell. When no explicit envelope is supplied, Email::Sender::Simple may derive these values from the From, To, and Cc headers, making attacker-controlled message addresses relevant to exploitation.

Exploit preconditions

  • Attack surface: Email sending through the Sendmail transport on Windows
  • Required access: Ability to influence an envelope address or, when the envelope is omitted, relevant From, To, or Cc header values
  • Trigger point: Message transmission through the Windows _sendmail_pipe path
  • Why exploitation is possible: Address data is incorporated into a shell-interpreted command string rather than being passed as safely separated process arguments

Why this happens

The underlying bug is command construction from untrusted address data. On Windows, the transport passes a single command string to open(), allowing shell metacharacters or command syntax contained in envelope addresses to be interpreted by the operating system. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly called OS command injection. Other platforms use a list-form invocation, which avoids this specific shell interpretation pattern.

Potential impact

  • An attacker could execute arbitrary commands on the sending host
  • The sending process could be used to access local files, credentials, or services
  • The application account could be compromised
  • Malicious activity could affect downstream mail workflows or connected systems
  • A compromised service could be used for lateral movement, depending on its privileges and network access

General mitigation guidance

Mitigation focuses on preventing message-derived address data from becoming shell syntax.

Common defensive patterns include:

  • Using direct process execution with separated argument lists rather than shell-interpreted command strings
  • Treating envelope and header addresses as untrusted input, even when they originate from a message model
  • Applying strict address parsing, normalization, and allowlist-based validation before invoking external mail transports
  • Separating transport configuration from user-controlled message fields
  • Running mail-sending processes with the minimum filesystem, network, and operating-system privileges
  • Applying platform-specific security policies that prevent unnecessary shell access

These controls reduce exposure without relying solely on input filtering.

How teams detect issues like this

Detection can include static analysis and review rules that flag:

  • Construction of shell command strings from email headers or envelope addresses
  • Use of open() or equivalent APIs in command-string mode
  • External process execution where user-controlled values are concatenated into arguments
  • Platform-specific branches that invoke a shell instead of a list-form process API

Code review should trace address data from message creation through transport invocation. Runtime monitoring can also alert on unexpected child processes spawned by mail-sending services, while CI policy checks can prohibit shell-based process execution for untrusted values. Automated code review tools may help identify these patterns.

Sources

SourceLink
github.comgithub.com/rjbs/Email-Sender/commit/9a587bc9ff4edae13239190c2651da2c76b1e72c.patch
metacpan.orgmetacpan.org/release/RJBS/Email-Sender-2.602/changes
openwall.comopenwall.com/lists/oss-security/2026/09/21/8

Frequently asked

questions

It can be exploitable through an application that accepts attacker-controlled message addresses and sends mail using the vulnerable Windows transport. Remote exploitability depends on how the application exposes message creation and whether it permits those address values to reach the transport.

The attacker needs a way to influence an envelope sender or recipient, or the relevant From, To, or Cc headers when no explicit envelope is provided. They do not necessarily need operating-system access if an exposed application accepts and sends attacker-controlled messages.

Avoid passing address data through a shell. Use a direct process-execution interface with separately supplied arguments, together with strict parsing and validation of address fields.

Treat all message metadata as untrusted, prohibit command-string construction from external data, review platform-specific process-launching code, and run mail services with least privilege and suitable monitoring.

Find out what's already
exploitable in your codebase.