# GHSA-g52p-86j5-xr8q: ZendFramework Potential Cross-site Scripting in Development Environment Error View Script

> An attacker can execute arbitrary scripts in a victim's browser via unescaped parameters in development mode error views.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 7 Jun 2024

## What is GHSA-g52p-86j5-xr8q?

GHSA-g52p-86j5-xr8q is a cross-site scripting vulnerability in zendframework/zendframework1, published on 7 Jun 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

The default error handling view script generated using `Zend_Tool` failed to escape request parameters when run in the "development" configuration environment, providing a potential XSS attack vector.

`Zend_Tool_Project_Context_Zf_ViewScriptFile` was patched such that the view script template now calls the `escape()` method on dumped request variables.

Zend Framework 1.11.4 includes a patch that adds escaping to the generated error/error.phtml view script, ensuring that request variables are escaped appropriately for the browser.
Do note, however, that this will not update any previously generated code. You will still need to follow the next advice for previously generated error view scripts.

## Which versions are affected by GHSA-g52p-86j5-xr8q?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `zendframework/zendframework1` | Packagist | From 1.0.0 | 1.11.4 |
| `zendframework/zendframework1` | Packagist | From 1.0.0 | 1.11.4 |

## How do I fix GHSA-g52p-86j5-xr8q?

Upgrade zendframework/zendframework1 to 1.11.4 or later.

## Is GHSA-g52p-86j5-xr8q being exploited?

There is no known exploitation of GHSA-g52p-86j5-xr8q in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-g52p-86j5-xr8q and fix it if it is affected.

What it is: GHSA-g52p-86j5-xr8q is a cross-site scripting vulnerability in zendframework/zendframework1, published on 7 Jun 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-g52p-86j5-xr8q in the wild and no public exploit code.

Affected packages and fixed versions:
- zendframework/zendframework1 (Packagist): affected from 1.0.0; fixed in 1.11.4
- zendframework/zendframework1 (Packagist): affected from 1.0.0; fixed in 1.11.4

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-g52p-86j5-xr8q/ (Markdown: https://insights.sbomify.com/GHSA-g52p-86j5-xr8q/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-g52p-86j5-xr8q

---
From sbomify Insights: https://insights.sbomify.com/GHSA-g52p-86j5-xr8q/
Summaries are generated and may contain mistakes; the official description above is the record.
