# GHSA-gc5h-6jx9-q2qh: eZ Platform Admin UI vulnerable to DOM-based Cross-site Scripting in file upload widget

> Authenticated users can execute arbitrary scripts via DOM-based XSS in the file upload widget by tricking editors into uploading maliciously named files.

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

## What is GHSA-gc5h-6jx9-q2qh?

GHSA-gc5h-6jx9-q2qh is a cross-site scripting vulnerability in ezsystems/ezplatform-admin-ui, published on 31 Jul 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

### Impact
The file upload widget is vulnerable to XSS payloads in filenames. Access permission to upload files is required. As such, in most cases only authenticated editors and administrators will have the required permission. It is not persistent, i.e. the payload is only executed during the upload. In effect, an attacker will have to trick an editor/administrator into uploading a strangely named file. The fix ensures XSS is escaped.

### Patches
See "Patched versions". Commit: https://github.com/ezsystems/ezplatform-admin-ui/commit/7a9f991b200fa5a03d49cd07f50577c8bc90a30b

### Workarounds
None.

### References
- https://developers.ibexa.co/security-advisories/ibexa-sa-2024-004-dom-based-xss-in-file-upload
- https://github.com/ezsystems/ezplatform-admin-ui/commit/7a9f991b200fa5a03d49cd07f50577c8bc90a30b
- https://github.com/ibexa/admin-ui/security/advisories/GHSA-qm44-wjm2-pr59

### Credit
This vulnerability was discovered and reported to Ibexa by Alec Romano: https://github.com/4rdr
We thank them for reporting it responsibly to us.

How to report security issues:
https://doc.ibexa.co/en/latest/infrastructure_and_maintenance/security/reporting_issues/

## Which versions are affected by GHSA-gc5h-6jx9-q2qh?

2 open source packages ship an affected version, including ezsystems/ezplatform-admin-ui.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ezsystems/ezplatform-admin-ui` | Packagist | From 3.3.0 | 3.3.39 |
| `ezsystems/ezplatform-admin-ui` | Packagist | From 3.3.0 | 3.3.39 |

## How do I fix GHSA-gc5h-6jx9-q2qh?

Upgrade ezsystems/ezplatform-admin-ui to 3.3.39 or later.

## Is GHSA-gc5h-6jx9-q2qh being exploited?

There is no known exploitation of GHSA-gc5h-6jx9-q2qh in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-gc5h-6jx9-q2qh and fix it if it is affected.

What it is: GHSA-gc5h-6jx9-q2qh is a cross-site scripting vulnerability in ezsystems/ezplatform-admin-ui, published on 31 Jul 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-gc5h-6jx9-q2qh in the wild and no public exploit code.

Affected packages and fixed versions:
- ezsystems/ezplatform-admin-ui (Packagist): affected from 3.3.0; fixed in 3.3.39
- ezsystems/ezplatform-admin-ui (Packagist): affected from 3.3.0; fixed in 3.3.39

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-gc5h-6jx9-q2qh/ (Markdown: https://insights.sbomify.com/GHSA-gc5h-6jx9-q2qh/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-gc5h-6jx9-q2qh

---
From sbomify Insights: https://insights.sbomify.com/GHSA-gc5h-6jx9-q2qh/
Summaries are generated and may contain mistakes; the official description above is the record.
