# CVE-2016-10034: zend-mail remote code execution via Sendmail adapter

> Remote attackers can execute arbitrary code by injecting commands via crafted email addresses in the Zend Mail Sendmail adapter.

- **Severity:** Critical 9.8 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Dec 2016
- **Updated:** 6 Aug 2024
- **Also known as:** GHSA-r9mw-gwx9-v3h5, MGASA-2017-0016

## What is CVE-2016-10034?

CVE-2016-10034 is a critical command injection vulnerability in n/a, published on 30 Dec 2016. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The setFrom function in the Sendmail adapter in the zend-mail component before 2.4.11, 2.5.x, 2.6.x, and 2.7.x before 2.7.2, and Zend Framework before 2.4.11 might allow remote attackers to pass extra parameters to the mail command and consequently execute arbitrary code via a \" (backslash double quote) in a crafted e-mail address.

Weakness: CWE-77 (Improper Neutralization of Special Elements used in a Command)

## Which versions are affected by CVE-2016-10034?

8 open source packages ship an affected version, including zendframework/zend-mail. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `zendframework/zend-mail` | Packagist | All versions | 2.4.11 |
| `zendframework/zend-mail` | Packagist | All versions | 2.4.11 |
| `zendframework/zend-mail` | Packagist | From 2.5 to 2.5.2 | None |
| `zendframework/zend-mail` | Packagist | From 2.5 to 2.5.2 | None |
| `zendframework/zend-mail` | Packagist | From 2.6 to 2.6.2 | None |
| `zendframework/zend-mail` | Packagist | From 2.6 to 2.6.2 | None |
| `zendframework/zend-mail` | Packagist | From 2.7 | 2.7.2 |
| `zendframework/zend-mail` | Packagist | From 2.7 | 2.7.2 |

Products: Zend Zend-Mail, Zend Zend Framework.

## How do I fix CVE-2016-10034?

Upgrade zendframework/zend-mail to a fixed version for your release line: 2.4.11 or 2.7.2.

## Is CVE-2016-10034 being exploited?

There is no known exploitation of CVE-2016-10034 in the wild and no public exploit code.

Public exploit code:

- Zend Framework / zend-mail < 2.4.11 - Remote Code Execution (exploitdb)
- PHPMailer < 5.2.20 / SwiftMailer < 5.4.5-DEV / Zend Framework / zend-mail < 2.4.11 - 'AIO' 'PwnScriptum' Remote Code Execution (exploitdb)
- PHPMailer < 5.2.20 with Exim MTA - Remote Code Execution (exploitdb)
- PHPMailer < 5.2.18 Remote Code Execution (github_poc): https://github.com/heikipikker/exploit-CVE-2016-10034

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2016-10034 and fix it if it is affected.

What it is: CVE-2016-10034 is a critical command injection vulnerability in n/a, published on 30 Dec 2016. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2016-10034 in the wild and no public exploit code.

Affected packages and fixed versions:
- zendframework/zend-mail (Packagist): affected all versions; fixed in 2.4.11
- zendframework/zend-mail (Packagist): affected all versions; fixed in 2.4.11
- zendframework/zend-mail (Packagist): affected from 2.5 up to 2.5.2; no fix listed
- zendframework/zend-mail (Packagist): affected from 2.5 up to 2.5.2; no fix listed
- zendframework/zend-mail (Packagist): affected from 2.6 up to 2.6.2; no fix listed
- zendframework/zend-mail (Packagist): affected from 2.6 up to 2.6.2; no fix listed
- zendframework/zend-mail (Packagist): affected from 2.7; fixed in 2.7.2
- zendframework/zend-mail (Packagist): affected from 2.7; fixed in 2.7.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2016-10034/ (Markdown: https://insights.sbomify.com/CVE-2016-10034/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2016-10034
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2016-10034
- OSV: https://osv.dev/vulnerability/CVE-2016-10034

---
From sbomify Insights: https://insights.sbomify.com/CVE-2016-10034/
Summaries are generated and may contain mistakes; the official description above is the record.
