# GHSA-52cw-pvq9-9m5v: Silverstripe uses TinyMCE which allows svg files linked in object tags

> Silverstripe CMS allows SVG files with JavaScript in object tags via TinyMCE, enabling XSS attacks against authenticated users.

- **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 2024

## What is GHSA-52cw-pvq9-9m5v?

GHSA-52cw-pvq9-9m5v is a cross-site scripting vulnerability in silverstripe/framework, published on 17 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
TinyMCE v6 has a configuration value `convert_unsafe_embeds` set to `false` which allows svg files containing javascript to be used in `<object>` or `<embed>` tags, which can be used as a vector for XSS attacks.

Note that `<embed>` tags are not allowed by default.

After patching the default value of `convert_unsafe_embeds` will be set to `true`. This means that `<object>` tags will be converted to iframes instead the next time the page is saved, which may break any pages that rely upon previously saved `<object>` tags. Developers can override this configuration if desired to revert to the original behaviour.

We reviewed the potential impact of this vulnerability within the context of Silverstripe CMS. We concluded this is a medium impact vulnerability given how TinyMCE is used by Silverstripe CMS.

### References:
- https://www.silverstripe.org/download/security-releases/ss-2024-001
- https://github.com/advisories/GHSA-5359-pvf2-pw78

## Which versions are affected by GHSA-52cw-pvq9-9m5v?

2 open source packages ship an affected version, including silverstripe/framework.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `silverstripe/framework` | Packagist | All versions | 5.2.16 |
| `silverstripe/framework` | Packagist | All versions | 5.2.16 |

## How do I fix GHSA-52cw-pvq9-9m5v?

Upgrade silverstripe/framework to 5.2.16 or later.

## Is GHSA-52cw-pvq9-9m5v being exploited?

There is no known exploitation of GHSA-52cw-pvq9-9m5v in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-52cw-pvq9-9m5v and fix it if it is affected.

What it is: GHSA-52cw-pvq9-9m5v is a cross-site scripting vulnerability in silverstripe/framework, published on 17 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-52cw-pvq9-9m5v in the wild and no public exploit code.

Affected packages and fixed versions:
- silverstripe/framework (Packagist): affected all versions; fixed in 5.2.16
- silverstripe/framework (Packagist): affected all versions; fixed in 5.2.16

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-52cw-pvq9-9m5v/ (Markdown: https://insights.sbomify.com/GHSA-52cw-pvq9-9m5v/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-52cw-pvq9-9m5v

---
From sbomify Insights: https://insights.sbomify.com/GHSA-52cw-pvq9-9m5v/
Summaries are generated and may contain mistakes; the official description above is the record.
