# GHSA-8w54-22w9-3g8f: Cross-site Scripting and Open Redirect in Products.CMFPlone

> Cache poisoning allows attackers to inject XSS and open redirects into Plone image views, affecting visitors who access the poisoned cached page.

- **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:** 28 Jan 2022

## What is GHSA-8w54-22w9-3g8f?

GHSA-8w54-22w9-3g8f is a cross-site scripting vulnerability in Products.CMFPlone, published on 28 Jan 2022. 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

### Impact
Plone is vulnerable to reflected cross site scripting and open redirect when an attacker can get a compromised version of the image_view_fullscreen page in a cache, for example in Varnish.
The technique is known as cache poisoning.
Any later visitor can get redirected when clicking on a link on this page.
Usually only anonymous users are affected, but this depends on your cache settings.

### Patches
No patch is available for the Products.CMFPlone 4 series.
Versions 5.0 and higher are not affected, but two other packages used by these versions are affected.

`plone.app.contenttypes` has the same problem in all versions, see [advisory](https://github.com/plone/plone.app.contenttypes/security/advisories/GHSA-f7qw-5fgj-247x).
In Plone 5.0-5.2, the default Products.ATContentTypes version has the same problem. See [advisory](https://github.com/plone/Products.ATContentTypes/security/advisories/GHSA-g4c2-ghfg-g5rh).
Plone 5.2.7 and 6.0.0a3 will be released today and will include these fixes.

For all unpatched versions of the three packages, you can use the following workaround.

### Workaround
Make sure the image_view_fullscreen page is not stored in the cache.
In Plone:

* Login as Manager and go to Site Setup.
* Go to the 'Caching' control panel. If this does not exist, or 'Enable caching' is not checked, you should normally not be vulnerable.
* Click on the tab 'Caching operations'.
* Under 'Legacy template mappings' locate the ruleset 'Content item view'.
* From the last column ('Templates')  remove 'image_view_fullscreen'.
* Click on Save.

### Reporter
This vulnerability was responsibly disclosed to the Plone Security Team by Gustav Hansen, F-Secure Consulting. Thank you!

### For more information
If you have any questions or comments about this advisory, email us at [security@plone.org](mailto:security@plone.org)
This is also the correct address to use when you want to report a possible vulnerability.
See [our security report policy](https://plone.org/security/report).

## Which versions are affected by GHSA-8w54-22w9-3g8f?

2 open source packages ship an affected version, including Products.CMFPlone and products-cmfplone.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `Products.CMFPlone` | PyPI | All versions | 5.0.0 |
| `products-cmfplone` | PyPI | All versions | 5.0.0 |

## How do I fix GHSA-8w54-22w9-3g8f?

Upgrade Products.CMFPlone to 5.0.0 or later.

## Is GHSA-8w54-22w9-3g8f being exploited?

There is no known exploitation of GHSA-8w54-22w9-3g8f in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-8w54-22w9-3g8f and fix it if it is affected.

What it is: GHSA-8w54-22w9-3g8f is a cross-site scripting vulnerability in Products.CMFPlone, published on 28 Jan 2022. 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-8w54-22w9-3g8f in the wild and no public exploit code.

Affected packages and fixed versions:
- Products.CMFPlone (PyPI): affected all versions; fixed in 5.0.0
- products-cmfplone (PyPI): affected all versions; fixed in 5.0.0

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-8w54-22w9-3g8f/ (Markdown: https://insights.sbomify.com/GHSA-8w54-22w9-3g8f/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-8w54-22w9-3g8f

---
From sbomify Insights: https://insights.sbomify.com/GHSA-8w54-22w9-3g8f/
Summaries are generated and may contain mistakes; the official description above is the record.
