CVE-2021-43785 is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in @joeattardi/emoji-button. A fix is available for @joeattardi/emoji-button — see the affected versions and patch details below.
Cross-Site Scripting Vulnerability in @joeattardi/emoji-button
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2021-43785 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,987 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, a proxy for how much of the ecosystem is exposed.
@joeattardi/emoji-buttonnpmDescription
Impact
There are two vectors for XSS attacks with versions of @joeattardi/emoji-button before 4.6.2:
- A URL for a custom emoji
- 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.
Patches
This vulnerability is fixed starting in version 4.6.2. This is resolved by properly escaping strings that are inserted into the HTML document.
Workarounds
There is no workaround other than upgrading to a non-vulnerable version.
Credit
This issue was discovered by GitHub team member @erik-krogh (Erik Krogh Kristensen) and was reported by the GitHub Security Lab team.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @joeattardi/emoji-button | all versions | 4.6.2npm install @joeattardi/emoji-button@4.6.2 |
Affected Products
emoji buttonemoji_button_projectDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @joeattardi/emoji-button, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @joeattardi/emoji-button to 4.6.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-43785 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is CVE-2021-43785 in your dependencies?
Find it across npm, including transitive dependencies.