# GHSA-8rqh-vxpr-x77p: plone.restapi: Stored XSS by spoofing mime type

> Stored XSS in Plone REST API allows attackers to execute scripts in viewers' browsers via unsanitized RichText fields.

- **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:** 17 Jul 2026

## What is GHSA-8rqh-vxpr-x77p?

GHSA-8rqh-vxpr-x77p is a cross-site scripting vulnerability in plone-restapi, published on 17 Jul 2026. 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

A stored XSS affecting RichText fields. RichTextValue.output returns the raw, unsanitized stored value whenever the stored mimeType equals the outputMimeType. Because the safe-HTML output type (`text/x-html-safe`) is the type that signifies "already sanitized", any value whose stored mimeType equals it bypasses the safe_html transform entirely on render. The transform itself is sound — it correctly strips `on*` event-handler attributes and `javascript:/data:` URIs; the defect is that it is never invoked for these values. The unsanitized value is then emitted via `tal:content="structure ..."`, which performs no escaping, so the payload executes in the viewer's browser. 

This can be a problem when a RichText field is wrongly defined in code with a `mimeType` and `outputMimeType` that are the same, or when the REST API is used to the same effect.

This is the same vulnerability as reported in `plone.app.textfield`:
https://github.com/plone/plone.app.textfield/security/advisories/GHSA-4r4f-gg25-rmg5

### Patches
The problem has been patched:

* For Plone 6.0 and 6.2, upgrade `plone.restapi` to 9.15.6.
* For Plone 6.2, upgrade `plone.restapi` to 10.0.1.

This will prevent abusing the REST API to store wrong rich text values.

This will **not** prevent XSS from rich text fields that already have wrong values.  For that, you will need a patched `plone.app.textfield` version. See the `plone.app.textfield` advisory linked above for versions.

### Workarounds
There is no known workaround.

## Which versions are affected by GHSA-8rqh-vxpr-x77p?

4 open source packages ship an affected version, including plone-restapi and plone.restapi.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `plone-restapi` | PyPI | All versions | 9.15.6 |
| `plone-restapi` | PyPI | From 10.0.0 | 10.0.1 |
| `plone.restapi` | PyPI | All versions | 9.15.6 |
| `plone.restapi` | PyPI | From 10.0.0 | 10.0.1 |

## How do I fix GHSA-8rqh-vxpr-x77p?

Upgrade plone-restapi to a fixed version for your release line: 9.15.6 or 10.0.1.

## Is GHSA-8rqh-vxpr-x77p being exploited?

There is no known exploitation of GHSA-8rqh-vxpr-x77p in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-8rqh-vxpr-x77p and fix it if it is affected.

What it is: GHSA-8rqh-vxpr-x77p is a cross-site scripting vulnerability in plone-restapi, published on 17 Jul 2026. 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-8rqh-vxpr-x77p in the wild and no public exploit code.

Affected packages and fixed versions:
- plone-restapi (PyPI): affected all versions; fixed in 9.15.6
- plone-restapi (PyPI): affected from 10.0.0; fixed in 10.0.1
- plone.restapi (PyPI): affected all versions; fixed in 9.15.6
- plone.restapi (PyPI): affected from 10.0.0; fixed in 10.0.1

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-8rqh-vxpr-x77p/ (Markdown: https://insights.sbomify.com/GHSA-8rqh-vxpr-x77p/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-8rqh-vxpr-x77p

---
From sbomify Insights: https://insights.sbomify.com/GHSA-8rqh-vxpr-x77p/
Summaries are generated and may contain mistakes; the official description above is the record.
