CVE-2023-42452 Mastodon vulnerable to Stored XSS through the translation feature
Attackers can inject malicious HTML via the translation feature, potentially executing scripts in victim browsers if CSP is bypassed.
- 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
What is CVE-2023-42452?
CVE-2023-42452 is a medium-severity cross-site scripting vulnerability in mastodon, published on 19 Sep 2023. 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
Mastodon is a free, open-source social network server based on ActivityPub. In versions on the 4.x branch prior to versions 4.0.10, 4.2.8, and 4.2.0-rc2, under certain conditions, attackers can abuse the translation feature to bypass the server-side HTML sanitization, allowing unescaped HTML to execute in the browser. The impact is limited thanks to Mastodon's strict Content Security Policy, blocking inline scripts, etc. However a CSP bypass or loophole could be exploited to execute malicious XSS. Furthermore, it requires user interaction, as this can only occur upon clicking the “Translate” button on a malicious post. Versions 4.0.10, 4.2.8, and 4.2.0-rc2 contain a patch for this issue.
Weakness: CWE-79
Which versions are affected by CVE-2023-42452?
1 open source package ship an affected version, including mastodon. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
mastodon Bitnami | From 4.0.0 | 4.0.10, 4.1.8 |
Products include Joinmastodon Mastodon.
How do I fix CVE-2023-42452?
Upgrade mastodon to a fixed version for your release line: 4.0.10 or 4.1.8.
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 CVE-2023-42452 being exploited?
There is no known exploitation of CVE-2023-42452 in the wild and no public exploit code.
Other vulnerabilities in mastodon
- CVE-2023-36460 Mastodon vulnerable to arbitrary file creation through media attachments
- CVE-2022-2166 Improper Restriction of Excessive Authentication Attempts in mastodon/mastodon
- CVE-2022-24307 Missing authorization in n/a
- CVE-2018-21018 Auth bypass in n/a
- CVE-2024-23832 Mastodon Remote user impersonation and takeover
Sources
Also known as BIT-mastodon-2023-42452, GHSA-2693-xr3m-jhqr.