# CVE-2023-42458: Zope vulnerable to Stored Cross Site Scripting with SVG images

> Attackers can inject malicious scripts via uploaded SVG images, leading to code execution when users view them.

- **Severity:** Low 3.7 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N`)
- **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:** 21 Sep 2023
- **Updated:** 13 Feb 2025
- **Also known as:** GHSA-wm8q-9975-xh5v, PYSEC-2026-2077

## What is CVE-2023-42458?

CVE-2023-42458 is a low-severity cross-site scripting vulnerability in zopefoundation Zope, published on 21 Sep 2023. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

Zope is an open-source web application server. Prior to versions 4.8.10 and 5.8.5, there is a stored cross site scripting vulnerability for SVG images. Note that an image tag with an SVG image as source is never vulnerable, even when the SVG image contains malicious code. To exploit the vulnerability, an attacker would first need to upload an image, and then trick a user into following a specially crafted link. Patches are available in Zope 4.8.10 and 5.8.5. As a workaround, make sure the "Add Documents, Images, and Files" permission is only assigned to trusted roles. By default, only the Manager has this permission.

Weakness: CWE-80 (Improper Neutralization of Script-Related HTML Tags in a Web Page), CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2023-42458?

5 open source packages ship an affected version, including zope and Zope. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `zope` | PyPI | All versions | 4.8.10, 5.8.5 |
| `zope` | PyPI | All versions | 4.8.10 |
| `zope` | PyPI | From 5.8.0 | 5.8.5 |
| `Zope` | PyPI | All versions | 4.8.10 |
| `Zope` | PyPI | From 5.8.0 | 5.8.5 |

Products: Zope Zope.

## How do I fix CVE-2023-42458?

Upgrade zope to a fixed version for your release line: 4.8.10 or 5.8.5.

## Is CVE-2023-42458 being exploited?

There is no known exploitation of CVE-2023-42458 in the wild and no public exploit code.

## Other vulnerabilities in zopefoundation Zope

- [CVE-2000-0062](https://insights.sbomify.com/CVE-2000-0062/): Zope DTML implementation Improper Authentication (critical 10.0)
- [CVE-2021-32674](https://insights.sbomify.com/CVE-2021-32674/): Remote Code Execution via traversal in TAL expressions (high 8.8)
- [CVE-2000-1211](https://insights.sbomify.com/CVE-2000-1211/): Zope does not properly perform security registration for legacy names (high 7.5)
- [CVE-2002-0170](https://insights.sbomify.com/CVE-2002-0170/): Zope does not properly verify the access for objects with proxy roles (high 7.5)
- [CVE-2002-0688](https://insights.sbomify.com/CVE-2002-0688/): ZCatalog plug-in for Zope allows anonymous users to bypass access restrictions (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-42458 and fix it if it is affected.

What it is: CVE-2023-42458 is a low-severity cross-site scripting vulnerability in zopefoundation Zope, published on 21 Sep 2023. 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 CVE-2023-42458 in the wild and no public exploit code.

Affected packages and fixed versions:
- zope (PyPI): affected all versions; fixed in 4.8.10, 5.8.5
- zope (PyPI): affected all versions; fixed in 4.8.10
- zope (PyPI): affected from 5.8.0; fixed in 5.8.5
- Zope (PyPI): affected all versions; fixed in 4.8.10
- Zope (PyPI): affected from 5.8.0; fixed in 5.8.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/CVE-2023-42458/ (Markdown: https://insights.sbomify.com/CVE-2023-42458/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-42458
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-42458
- OSV: https://osv.dev/vulnerability/CVE-2023-42458

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-42458/
Summaries are generated and may contain mistakes; the official description above is the record.
