# GHSA-mg7h-9qfx-4r83: ZendFramework Potential Proxy Injection Vulnerabilities

> Attackers can spoof IP addresses or host names via HTTP headers in Zend Framework, potentially bypassing security controls or leaking information.

- **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-mg7h-9qfx-4r83?

GHSA-mg7h-9qfx-4r83 is a 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

`Zend\Session\Validator\RemoteAddr` and `Zend\View\Helper\ServerUrl` were found to be improperly parsing HTTP headers for proxy information, which could potentially allow an attacker to spoof a proxied IP or host name.

In `Zend\Session\Validator\RemoteAddr`, if the client is behind a proxy server, the detection of the proxy URL was incorrect, and could lead to invalid results on subsequent lookups.

In `Zend\View\Helper\ServerUrl`, if the server lives behind a proxy, the helper would always generate a URL based on the proxy host, regardless of whether or not this was desired; additionally, it did not take into account the proxy port or protocol, if provided.

## Which versions are affected by GHSA-mg7h-9qfx-4r83?

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


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

## How do I fix GHSA-mg7h-9qfx-4r83?

Upgrade zendframework/zendframework to 2.0.5 or later.

## Is GHSA-mg7h-9qfx-4r83 being exploited?

There is no known exploitation of GHSA-mg7h-9qfx-4r83 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-mg7h-9qfx-4r83 and fix it if it is affected.

What it is: GHSA-mg7h-9qfx-4r83 is a 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-mg7h-9qfx-4r83 in the wild and no public exploit code.

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

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-mg7h-9qfx-4r83/ (Markdown: https://insights.sbomify.com/GHSA-mg7h-9qfx-4r83/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-mg7h-9qfx-4r83

---
From sbomify Insights: https://insights.sbomify.com/GHSA-mg7h-9qfx-4r83/
Summaries are generated and may contain mistakes; the official description above is the record.
