npm package report

Is @dicebear/initials safe?

1 known vulnerability, worst severity MODERATE.

// reach

0 direct dependencies

none carry a known advisory

    0 packages depend on it

    an advisory here reaches each of them

      Create a free accountfor every dependency path, dependent and what to upgrade
      // ai model usage

      Tracked for PyPI packages. HuggingFace models declare Python dependencies, so npm packages are not covered.


      cvss
      0.0
      medium

      severity out of 10

      epss
      0.00%
      low

      chance of exploitation in 30 days, 19th percentile of all CVEs

      xyz score
      not scored

      CyberXYZ composite out of 10

      fig. 01 — GHSA-gcr2-9v8m-gq45, the advisory selected below

      // 1 advisories

      GHSA-gcr2-9v8m-gq45

      MODERATECVE-2026-68921
      // summary

      @dicebear/core builds avatar SVGs from caller-supplied options. The numeric rotate option is interpolated into an SVG transform attribute without XML-escaping. It is typed as a number, but nothing checks the type at runtime, so a string value passes straight through and can break out of the attribute to inject arbitrary SVG markup.

      This is the same root cause as CVE-2026-33311 (GHSA-mr9r-mww3-v6gv), which escaped the string options backgroundColor, fontFamily, and textColor but did not cover rotate. @dicebear/initials has the same gap in its numeric fontSize and fontWeight options.

      // impact

      Cross-site scripting (CWE-79). When the generated avatar is rendered inline (for example via innerHTML) or served as image/svg+xml and opened directly, injected markup such as an handler runs script in the page's origin.

      Exploitation requires the application to pass untrusted input into one of these options:

      • rotate (@dicebear/core)
      • fontSize, fontWeight (@dicebear/initials)

      In most integrations these options are set by the developer and only seed is user-controlled, so the vulnerable configuration is uncommon. Applications that use trusted, hardcoded values for these options are not at risk.

      // patches

      Fixed in @dicebear/core 9.4.3 and @dicebear/initials 9.4.3: the values are now XML-escaped before being written into the SVG, matching the CVE-2026-33311 fix. Upgrade to 9.4.3 or later.

      The 5.x through 8.x lines share the same flaw but are end-of-life and will not receive a backport; upgrade to 9.4.3. The 10.x line is not affected.

      // workarounds

      If you cannot upgrade, coerce the affected options to a number before passing them to createAvatar:

      rotate: Number(userInput) || 0,
      // credits

      Reported by @rz1027.

      // cvss v3.1 vector

      CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N

      Attack vector
      Network
      Attack complexity
      High
      Privileges required
      None
      User interaction
      Required
      Scope
      Changed
      Confidentiality
      Low
      Integrity
      Low
      Availability
      None

      Checked 2026-09-26 at 01:02 UTC. The most recent advisory here was published 2026-09-02. Updated continuously from NVD, GHSA, OSV and CNA feeds.

      Think a verdict here is wrong? Tell us — we respond within 2 business days.