# GHSA-m8fw-p3cr-6jqc: Cross-Site Scripting in CKEditor4 WordCount Plugin

> Cross-site scripting in CKEditor4 WordCount plugin allows attackers to inject scripts when switching to source mode, requiring user interaction and specific configuration.

- **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:** 25 Jul 2023

## What is GHSA-m8fw-p3cr-6jqc?

GHSA-m8fw-p3cr-6jqc is a cross-site scripting vulnerability in typo3/cms-rte-ckeditor, published on 25 Jul 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

> ### CVSS: `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N/E:F/RL:O/RC:C` (4.4) 

### Problem
The [WordCount](https://ckeditor.com/cke4/addon/wordcount) plugin ([`npm:ckeditor-wordcount-plugin`](https://www.npmjs.com/package/ckeditor-wordcount-plugin)) for CKEditor4 is vulnerable to cross-site scripting when switching to the source code mode. This plugin is enabled via the `Full.yaml` configuration present, but is not active in the default configuration.

In default scenarios, exploiting this vulnerability requires a valid backend user account. However, if custom plugins are used on the website frontend, which accept and reflect rich-text content submitted by users, no authentication is required.

### Solution
Update to TYPO3 versions 9.5.42 ELTS, 10.4.39 ELTS, 11.5.30 that fix the problem described above.

### Credits
Thanks to Sybille Peters who reported this issue, and to TYPO3 core & security team member Oliver Hader who fixed the issue.

### References
* [TYPO3-CORE-SA-2023-004](https://typo3.org/security/advisory/typo3-core-sa-2023-004)
* https://github.com/w8tcha/CKEditor-WordCount-Plugin/security/advisories/GHSA-q9w4-w667-qqj4

## Which versions are affected by GHSA-m8fw-p3cr-6jqc?

6 open source packages ship an affected version, including typo3/cms-rte-ckeditor.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `typo3/cms-rte-ckeditor` | Packagist | From 10.0.0 | 10.4.39 |
| `typo3/cms-rte-ckeditor` | Packagist | From 10.0.0 | 10.4.39 |
| `typo3/cms-rte-ckeditor` | Packagist | From 11.0.0 | 11.5.30 |
| `typo3/cms-rte-ckeditor` | Packagist | From 11.0.0 | 11.5.30 |
| `typo3/cms-rte-ckeditor` | Packagist | From 9.5.0 | 9.5.42 |
| `typo3/cms-rte-ckeditor` | Packagist | From 9.5.0 | 9.5.42 |

## How do I fix GHSA-m8fw-p3cr-6jqc?

Upgrade typo3/cms-rte-ckeditor to a fixed version for your release line: 10.4.39, 11.5.30 or 9.5.42.

## Is GHSA-m8fw-p3cr-6jqc being exploited?

There is no known exploitation of GHSA-m8fw-p3cr-6jqc in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-m8fw-p3cr-6jqc and fix it if it is affected.

What it is: GHSA-m8fw-p3cr-6jqc is a cross-site scripting vulnerability in typo3/cms-rte-ckeditor, published on 25 Jul 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 GHSA-m8fw-p3cr-6jqc in the wild and no public exploit code.

Affected packages and fixed versions:
- typo3/cms-rte-ckeditor (Packagist): affected from 10.0.0; fixed in 10.4.39
- typo3/cms-rte-ckeditor (Packagist): affected from 10.0.0; fixed in 10.4.39
- typo3/cms-rte-ckeditor (Packagist): affected from 11.0.0; fixed in 11.5.30
- typo3/cms-rte-ckeditor (Packagist): affected from 11.0.0; fixed in 11.5.30
- typo3/cms-rte-ckeditor (Packagist): affected from 9.5.0; fixed in 9.5.42
- typo3/cms-rte-ckeditor (Packagist): affected from 9.5.0; fixed in 9.5.42

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-m8fw-p3cr-6jqc/ (Markdown: https://insights.sbomify.com/GHSA-m8fw-p3cr-6jqc/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-m8fw-p3cr-6jqc

---
From sbomify Insights: https://insights.sbomify.com/GHSA-m8fw-p3cr-6jqc/
Summaries are generated and may contain mistakes; the official description above is the record.
