# GHSA-gqqf-g5r7-84vf: TYPO3 HTML Sanitizer Bypasses Cross-Site Scripting Protection

> Attackers can bypass XSS protection in TYPO3 via malicious HTML comments, potentially executing scripts in victim browsers.

- **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:** 15 Sep 2022

## What is GHSA-gqqf-g5r7-84vf?

GHSA-gqqf-g5r7-84vf is a cross-site scripting vulnerability in typo3/cms-core, published on 15 Sep 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

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

### Problem
Due to a parsing issue in upstream package [`masterminds/html5`](https://packagist.org/packages/masterminds/html5), malicious markup used in a sequence with special HTML comments cannot be filtered and sanitized. This allows to by-pass the cross-site scripting mechanism of [`typo3/html-sanitizer`](https://github.com/TYPO3/html-sanitizer).

### Solution
Update to TYPO3 version 7.6.58 ELTS, 8.7.48 ELTS, 9.5.37 ELTS, 10.4.32 or 11.5.16 that fix the problem described above.

### Credits
Thanks to David Klein who reported this issue, and to TYPO3 security team member Oliver Hader who fixed the issue.

### References
* [TYPO3-CORE-SA-2022-011](https://typo3.org/security/advisory/typo3-core-sa-2022-011)
* [GHSA-47m6-46mj-p235](https://github.com/TYPO3/html-sanitizer/security/advisories/GHSA-47m6-46mj-p235)

## Which versions are affected by GHSA-gqqf-g5r7-84vf?

10 open source packages ship an affected version, including typo3/cms-core.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `typo3/cms-core` | Packagist | From 10.0.0 | 10.4.32 |
| `typo3/cms-core` | Packagist | From 10.0.0 | 10.4.32 |
| `typo3/cms-core` | Packagist | From 11.0.0 | 11.5.16 |
| `typo3/cms-core` | Packagist | From 11.0.0 | 11.5.16 |
| `typo3/cms-core` | Packagist | From 7.0.0 | 7.6.58 |
| `typo3/cms-core` | Packagist | From 7.0.0 | 7.6.58 |
| `typo3/cms-core` | Packagist | From 8.0.0 | 8.7.48 |
| `typo3/cms-core` | Packagist | From 8.0.0 | 8.7.48 |
| `typo3/cms-core` | Packagist | From 9.0.0 | 9.5.37 |
| `typo3/cms-core` | Packagist | From 9.0.0 | 9.5.37 |

## How do I fix GHSA-gqqf-g5r7-84vf?

Upgrade typo3/cms-core to a fixed version for your release line: 10.4.32, 11.5.16, 7.6.58 or 8.7.48.

## Is GHSA-gqqf-g5r7-84vf being exploited?

There is no known exploitation of GHSA-gqqf-g5r7-84vf in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-gqqf-g5r7-84vf and fix it if it is affected.

What it is: GHSA-gqqf-g5r7-84vf is a cross-site scripting vulnerability in typo3/cms-core, published on 15 Sep 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-gqqf-g5r7-84vf in the wild and no public exploit code.

Affected packages and fixed versions:
- typo3/cms-core (Packagist): affected from 10.0.0; fixed in 10.4.32
- typo3/cms-core (Packagist): affected from 10.0.0; fixed in 10.4.32
- typo3/cms-core (Packagist): affected from 11.0.0; fixed in 11.5.16
- typo3/cms-core (Packagist): affected from 11.0.0; fixed in 11.5.16
- typo3/cms-core (Packagist): affected from 7.0.0; fixed in 7.6.58
- typo3/cms-core (Packagist): affected from 7.0.0; fixed in 7.6.58
- typo3/cms-core (Packagist): affected from 8.0.0; fixed in 8.7.48
- typo3/cms-core (Packagist): affected from 8.0.0; fixed in 8.7.48
- typo3/cms-core (Packagist): affected from 9.0.0; fixed in 9.5.37
- typo3/cms-core (Packagist): affected from 9.0.0; fixed in 9.5.37

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-gqqf-g5r7-84vf/ (Markdown: https://insights.sbomify.com/GHSA-gqqf-g5r7-84vf/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-gqqf-g5r7-84vf

---
From sbomify Insights: https://insights.sbomify.com/GHSA-gqqf-g5r7-84vf/
Summaries are generated and may contain mistakes; the official description above is the record.
