GHSA-hc5c-r8m5-2gfh plone.restapi vulnerable to Stored Cross Site Scripting with SVG image in user portrait
An attacker can execute arbitrary scripts in victim browsers by uploading a malicious SVG as a user portrait, requiring the victim to view the profile.
- 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
What is GHSA-hc5c-r8m5-2gfh?
GHSA-hc5c-r8m5-2gfh is a cross-site scripting vulnerability in plone-restapi, 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
Impact
There is a stored cross site scripting vulnerability for SVG images uploaded in user portraits.
Note that a page that uses 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 SVG image as user portrait, and then trick a user into following a link to this portrait.
Patches
A patch will be released in plone.restapi 8.43.3. This version is good for Plone 6.0, and for Plone 5.2 on Python 3.
In plone.restapi 7 or earlier there was no @portrait endpoint yet, so there is nothing to fix in that version. It is still vulnerable to this attack, and needs a fix in Zope 4. These two vulnerabilities share the same CVE: CVE-2023-42458.
Workarounds
You could remove the portrait field from the member data schema, and possibly remove all portraits that are already in the database, but this seems a bit drastic.
Which versions are affected by GHSA-hc5c-r8m5-2gfh?
2 open source packages ship an affected version, including plone-restapi and plone.restapi.
| Package | Affected | Fixed in |
|---|---|---|
plone-restapi PyPI | From 8.0.0 | 8.43.3 |
plone.restapi PyPI | From 8.0.0 | 8.43.3 |
How do I fix GHSA-hc5c-r8m5-2gfh?
Upgrade plone-restapi to 8.43.3 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is GHSA-hc5c-r8m5-2gfh being exploited?
There is no known exploitation of GHSA-hc5c-r8m5-2gfh in the wild and no public exploit code.