# GHSA-gff2-p6vm-3p8g: ZendFramework potential remote code execution in zend-mail via Sendmail adapter

> Attackers can execute arbitrary commands on the server by injecting parameters into the sendmail program via unsanitized email addresses.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 Jun 2024

## What is GHSA-gff2-p6vm-3p8g?

GHSA-gff2-p6vm-3p8g is a command injection vulnerability in zendframework/zendframework, published on 7 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

When using the zend-mail component to send email via the `Zend\Mail\Transport\Sendmail transport`, a malicious user may be able to inject arbitrary parameters to the system sendmail program. The attack is performed by providing additional quote characters within an address; when unsanitized, they can be interpreted as additional command line arguments, leading to the vulnerability.

## Which versions are affected by GHSA-gff2-p6vm-3p8g?

2 open source packages ship an affected version, including zendframework/zendframework.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `zendframework/zendframework` | Packagist | From 2.0.0 | 2.4.11 |
| `zendframework/zendframework` | Packagist | From 2.0.0 | 2.4.11 |

## How do I fix GHSA-gff2-p6vm-3p8g?

Upgrade zendframework/zendframework to 2.4.11 or later.

## Is GHSA-gff2-p6vm-3p8g being exploited?

There is no known exploitation of GHSA-gff2-p6vm-3p8g in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-gff2-p6vm-3p8g and fix it if it is affected.

What it is: GHSA-gff2-p6vm-3p8g is a command injection vulnerability in zendframework/zendframework, published on 7 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-gff2-p6vm-3p8g in the wild and no public exploit code.

Affected packages and fixed versions:
- zendframework/zendframework (Packagist): affected from 2.0.0; fixed in 2.4.11
- zendframework/zendframework (Packagist): affected from 2.0.0; fixed in 2.4.11

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/GHSA-gff2-p6vm-3p8g/ (Markdown: https://insights.sbomify.com/GHSA-gff2-p6vm-3p8g/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-gff2-p6vm-3p8g

---
From sbomify Insights: https://insights.sbomify.com/GHSA-gff2-p6vm-3p8g/
Summaries are generated and may contain mistakes; the official description above is the record.
