# GHSA-qc7w-4567-84wv: Zendframework vulnerable to XXE/XEE attacks

> Attackers can exploit insecure XML parsing to read arbitrary files or cause denial of service via entity expansion in Zend Framework applications.

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

## What is GHSA-qc7w-4567-84wv?

GHSA-qc7w-4567-84wv is a vulnerability in zendframework/zendframework, published on 7 Jun 2024. It can be exploited over the network, with no action from the victim.

### Official description

Numerous components utilizing PHP's DOMDocument, SimpleXML, and xml_parse functionality are vulnerable to two types of attacks:

- XML eXternal Entity (XXE) Injection attacks. The above mentioned extensions are insecure by default, allowing external entities to be specified by adding a specific DOCTYPE element to XML documents and strings. By exploiting this vulnerability an application may be coerced to open arbitrary files and/or TCP connections.
- XML Entity Expansion (XEE) vectors, leading to Denial of Service vectors. XEE attacks occur when the XML DOCTYPE declaration includes XML entity definitions that contain either recursive or circular references; this leads to CPU and memory consumption, making Denial of Service exploits trivial to implement.

## Which versions are affected by GHSA-qc7w-4567-84wv?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `zendframework/zendframework` | Packagist | From 2.1.0 | 2.1.6 |
| `zendframework/zendframework` | Packagist | From 2.1.0 | 2.1.6 |
| `zendframework/zendframework` | Packagist | From 2.2.0 | 2.2.6 |
| `zendframework/zendframework` | Packagist | From 2.2.0 | 2.2.6 |

## How do I fix GHSA-qc7w-4567-84wv?

Upgrade zendframework/zendframework to a fixed version for your release line: 2.1.6 or 2.2.6.

## Is GHSA-qc7w-4567-84wv being exploited?

There is no known exploitation of GHSA-qc7w-4567-84wv in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-qc7w-4567-84wv and fix it if it is affected.

What it is: GHSA-qc7w-4567-84wv is a vulnerability in zendframework/zendframework, published on 7 Jun 2024. It can be exploited over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-qc7w-4567-84wv in the wild and no public exploit code.

Affected packages and fixed versions:
- zendframework/zendframework (Packagist): affected from 2.1.0; fixed in 2.1.6
- zendframework/zendframework (Packagist): affected from 2.1.0; fixed in 2.1.6
- zendframework/zendframework (Packagist): affected from 2.2.0; fixed in 2.2.6
- zendframework/zendframework (Packagist): affected from 2.2.0; fixed in 2.2.6

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-qc7w-4567-84wv/ (Markdown: https://insights.sbomify.com/GHSA-qc7w-4567-84wv/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-qc7w-4567-84wv

---
From sbomify Insights: https://insights.sbomify.com/GHSA-qc7w-4567-84wv/
Summaries are generated and may contain mistakes; the official description above is the record.
