CVE-2026-33311

CVE-2026-33311 is a medium-severity cross-site scripting (XSS) vulnerability in @dicebear/core (npm), affecting versions >= 5.0.0, <= 5.4.3. It is fixed in 5.4.4, 6.1.4, 7.1.4, 8.0.3, 9.4.1.

Summary

SVG attribute values derived from user-supplied options (backgroundColor, fontFamily, textColor) were not XML-escaped before interpolation into SVG output. This could allow Cross-Site Scripting (XSS) when applications pass untrusted input to createAvatar() and serve the resulting SVG inline or with Content-Type: image/svg+xml.

Affected packages

  • @dicebear/core, backgroundColor option values interpolated into SVG attributes without escaping (affects solid and gradientLinear background types)
  • @dicebear/initials, fontFamily and textColor option values interpolated into SVG attributes without escaping

Mitigating factors

  • Applications that validate input against the library's JSON Schema before passing it to createAvatar() are not affected
  • The DiceBear CLI validates input via AJV and was not vulnerable
  • Exploitation requires that an application passes untrusted, unvalidated external input directly as option values

Impact

Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.

CVE-2026-33311 has a CVSS score of 4.7 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (5.4.4, 6.1.4, 7.1.4, 8.0.3, 9.4.1); upgrading removes the vulnerable code path.

Affected versions

@dicebear/core (>= 5.0.0, <= 5.4.3) @dicebear/core (>= 6.0.0, <= 6.1.3) @dicebear/core (>= 7.0.0, <= 7.1.3) @dicebear/core (>= 8.0.0, <= 8.0.2) @dicebear/core (>= 9.0.0, <= 9.4.0) @dicebear/initials (>= 5.0.0, <= 5.4.3) @dicebear/initials (>= 6.0.0, <= 6.1.3) @dicebear/initials (>= 7.0.0, <= 7.1.3) @dicebear/initials (>= 8.0.0, <= 8.0.2) @dicebear/initials (>= 9.0.0, <= 9.4.0)

Security releases

@dicebear/core → 5.4.4 (npm) @dicebear/core → 6.1.4 (npm) @dicebear/core → 7.1.4 (npm) @dicebear/core → 8.0.3 (npm) @dicebear/core → 9.4.1 (npm) @dicebear/initials → 5.4.4 (npm) @dicebear/initials → 6.1.4 (npm) @dicebear/initials → 7.1.4 (npm) @dicebear/initials → 8.0.3 (npm) @dicebear/initials → 9.4.1 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

All affected SVG attribute values are now properly escaped using XML entity encoding. Users should upgrade to the listed patched versions.

Frequently Asked Questions

  1. What is CVE-2026-33311? CVE-2026-33311 is a medium-severity cross-site scripting (XSS) vulnerability in @dicebear/core (npm), affecting versions >= 5.0.0, <= 5.4.3. It is fixed in 5.4.4, 6.1.4, 7.1.4, 8.0.3, 9.4.1. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
  2. How severe is CVE-2026-33311? CVE-2026-33311 has a CVSS score of 4.7 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which packages are affected by CVE-2026-33311?
    • @dicebear/core (npm) (versions >= 5.0.0, <= 5.4.3)
    • @dicebear/initials (npm) (versions >= 5.0.0, <= 5.4.3)
  4. Is there a fix for CVE-2026-33311? Yes. CVE-2026-33311 is fixed in 5.4.4, 6.1.4, 7.1.4, 8.0.3, 9.4.1. Upgrade to this version or later.
  5. Is CVE-2026-33311 exploitable, and should I be worried? Whether CVE-2026-33311 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-33311 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-33311?
    • Upgrade @dicebear/core to 5.4.4 or later
    • Upgrade @dicebear/core to 6.1.4 or later
    • Upgrade @dicebear/core to 7.1.4 or later
    • Upgrade @dicebear/core to 8.0.3 or later
    • Upgrade @dicebear/core to 9.4.1 or later
    • Upgrade @dicebear/initials to 5.4.4 or later
    • Upgrade @dicebear/initials to 6.1.4 or later
    • Upgrade @dicebear/initials to 7.1.4 or later
    • Upgrade @dicebear/initials to 8.0.3 or later
    • Upgrade @dicebear/initials to 9.4.1 or later

Other vulnerabilities in @dicebear/core

Stop the waste.
Protect your environment with Kodem.