Vulnerabilities in pkg:npm/@joeattardi/emoji-button

PACKAGE
Advisory Identifier: GHSA-f34m-x9pj-62vq
Advisory Summary

CVE-2021-43785 is a HIGH (CVSS 7.6) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @joeattardi/emoji button libraries in the npm ecosystem. The issue involves cross-site scripting vulnerability in @joeattardi/emoji-button. Remediation is available by upgrading affected packages to version 4.6.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@joeattardi/emoji-button

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@joeattardi/emoji-button. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-f34m-x9pj-62vq CVE-2021-43785 HIGH Cross-Site Scripting Vulnerability in @joeattardi/emoji-button

CVE-2021-43785 at a Glance

CVE Identifier CVE-2021-43785
GHSA Identifier GHSA-f34m-x9pj-62vq
Severity HIGH
CVSS v3.1 Base Score 7.6
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product @joeattardi/emoji button
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2021-43785

To remediate this vulnerability, upgrade all affected @joeattardi/emoji button dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@joeattardi/emoji-button fixed: 4.6.2
npm install @joeattardi/emoji-button@4.6.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @joeattardi/emoji-button

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-43785, inspect your project dependencies using npm:

npm ls @joeattardi/emoji-button

Analyze the terminal output to locate any version of @joeattardi/emoji button in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.6.2), your application is affected.

Note: The npm ls @joeattardi/emoji-button command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In @joeattardi/emoji button, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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)](https://github.com/erik-krogh) and was reported by the GitHub Security Lab team.

CVE-2021-43785 Affected @joeattardi/emoji button Versions

1 component(s)
Fixed Versions:
4.6.2
Product / Package Ecosystem Affected Versions Fixed Version
@joeattardi/emoji-button
npm
< 4.6.2
4.6.2

References

Frequently Asked Questions

What is CVE-2021-43785?
CVE-2021-43785 is a security vulnerability in @joeattardi/emoji button involving Cross-Site Scripting Vulnerability in @joeattardi/emoji-button under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which @joeattardi/emoji button versions are affected?
Affected versions include releases prior to 4.6.2 across affected packages: @joeattardi/emoji-button.
What version fixes CVE-2021-43785?
Upgrading to 4.6.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @joeattardi/emoji-button affected?
Yes, @joeattardi/emoji-button is affected in releases prior to 4.6.2. Upgrade your dependency to 4.6.2 or later.
What is the CVSS score of CVE-2021-43785?
CVE-2021-43785 has a CVSS v3.1 base score of 7.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:L.
What CWE is associated with CVE-2021-43785?
CVE-2021-43785 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2021-43785?
Run the dependency tree command: 'npm ls @joeattardi/emoji-button'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f34m-x9pj-62vq",
  "modified" : "2021-12-01T14:34:05Z",
  "published" : "2021-12-01T18:29:02Z",
  "aliases" : [ "CVE-2021-43785" ],
  "summary" : "Cross-Site Scripting Vulnerability in @joeattardi/emoji-button",
  "details" : "### Impact\n\nThere are two vectors for XSS attacks with versions of @joeattardi/emoji-button before 4.6.2:\n\n- A URL for a custom emoji\n- An i18n string\n\nIn both of these cases, a value can be crafted such that it can insert a `script` tag into the page and execute malicious code.\n\n### Patches\n\nThis vulnerability is fixed starting in version 4.6.2. This is resolved by properly escaping strings that are inserted into the HTML document.\n\n### Workarounds\n\nThere is no workaround other than upgrading to a non-vulnerable version.\n\n### Credit\n\nThis issue was discovered by GitHub team member [@erik-krogh (Erik Krogh Kristensen)](https://github.com/erik-krogh) and was reported by the GitHub Security Lab team.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@joeattardi/emoji-button"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.6.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/joeattardi/emoji-button/security/advisories/GHSA-f34m-x9pj-62vq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43785"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/joeattardi/emoji-button/commit/05970c09180cd27fff493e998ac5bf0468b1bb16"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/joeattardi/emoji-button/commit/fe54bef107eb3f74873a4018f2ff49fa124c6a2e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/joeattardi/emoji-button"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-29T20:21:36Z",
    "nvd_published_at" : "2021-11-26T19:15:00Z"
  }
}