CVE-2021-43785 Cross Site Scripting Vulnerability in @joeattardi/emoji-button
Attackers can inject malicious scripts via custom emoji URLs or i18n strings, leading to code execution in the browser.
- 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-2021-43785?
CVE-2021-43785 is a high-severity cross-site scripting vulnerability in joeattardi emoji-button, published on 26 Nov 2021. 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
@joeattardi/emoji-button is a Vanilla JavaScript emoji picker component. In affected versions there are two vectors for XSS attacks: a URL for a custom emoji, and an i18n string. In both of these cases, a value can be crafted such that it can insert a `script` tag into the page and execute malicious code.
Weakness: CWE-79
Which versions are affected by CVE-2021-43785?
2 open source packages ship an affected version, including @joeattardi/emoji-button. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
@joeattardi/emoji-button npm | All versions | 4.6.2 |
@joeattardi/emoji-button npm | All versions | 4.6.2 |
Products include Emoji Button Project Emoji Button.
How do I fix CVE-2021-43785?
Upgrade @joeattardi/emoji-button to 4.6.2 or later.
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-2021-43785 being exploited?
There is no known exploitation of CVE-2021-43785 in the wild and no public exploit code.
Sources
Also known as GHSA-f34m-x9pj-62vq.