# GHSA-9j5w-2cqc-cwj9: Magento LTS vulnerable to Stored XSS via TinyMCE WYSIWYG Editor

> Stored XSS in Magento LTS TinyMCE editor allows attackers to execute scripts in victim browsers, potentially leading to account takeover.

- **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:** 8 Dec 2023

## What is GHSA-9j5w-2cqc-cwj9?

GHSA-9j5w-2cqc-cwj9 is a cross-site scripting vulnerability in openmage/magento-lts, published on 8 Dec 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

From HackerOne report [#1948040](https://hackerone.com/reports/1948040) by Halit AKAYDIN (hltakydn)

### Impact
_What kind of vulnerability is it? Who is impacted?_

The TinyMCE WYSIWYG editor fails to filter scripts when rendering the HTML in specially crafted HTML tags.

### Patches
_Has the problem been patched? What versions should users upgrade to?_

This vulnerability was fixed in version 20.2.0 by upgrading TinyMCE to a recent version in https://github.com/OpenMage/magento-lts/pull/3220

### Workarounds
_Is there a way for users to fix or remediate the vulnerability without upgrading?_

The WYSIWYG editor features could be disabled in the configuration. Possibly some WAF appliances would filter this attack.

### References
_Are there any links users can visit to find out more?_

The attack is simply an exploit of the "onmouseover" attribute of an `img` element as described on [OWASP XSS Filter Evasion](https://cheatsheetseries.owasp.org/cheatsheets/XSS_Filter_Evasion_Cheat_Sheet.html)

## Which versions are affected by GHSA-9j5w-2cqc-cwj9?

2 open source packages ship an affected version, including openmage/magento-lts.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openmage/magento-lts` | Packagist | All versions | 20.2.0 |
| `openmage/magento-lts` | Packagist | All versions | 20.2.0 |

## How do I fix GHSA-9j5w-2cqc-cwj9?

Upgrade openmage/magento-lts to 20.2.0 or later.

## Is GHSA-9j5w-2cqc-cwj9 being exploited?

There is no known exploitation of GHSA-9j5w-2cqc-cwj9 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-9j5w-2cqc-cwj9 and fix it if it is affected.

What it is: GHSA-9j5w-2cqc-cwj9 is a cross-site scripting vulnerability in openmage/magento-lts, published on 8 Dec 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-9j5w-2cqc-cwj9 in the wild and no public exploit code.

Affected packages and fixed versions:
- openmage/magento-lts (Packagist): affected all versions; fixed in 20.2.0
- openmage/magento-lts (Packagist): affected all versions; fixed in 20.2.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-9j5w-2cqc-cwj9/ (Markdown: https://insights.sbomify.com/GHSA-9j5w-2cqc-cwj9/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-9j5w-2cqc-cwj9

---
From sbomify Insights: https://insights.sbomify.com/GHSA-9j5w-2cqc-cwj9/
Summaries are generated and may contain mistakes; the official description above is the record.
