Vulnerability · Published Aug 20, 2026 · Assigned by GitHub_M
CVE-2026-68921DiceBear: SVG injection via the unescaped rotate option in @dicebear/core (and fontSize/fontWeight in @dicebear/initials)
Medium 4.7
In plain English
A medium-severity cross-site scripting in dicebear from dicebear. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 21% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | @dicebear/core | 9.4.3 | GHSA-gcr2-9v8m-gq45 |
| npm | @dicebear/initials | 9.4.3 | GHSA-gcr2-9v8m-gq45 |
Affected products (as reported)
Weakness: CWE-79, CWE-184 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
References
- https://github.com/dicebear/dicebear/security/advisories/GHSA-gcr2-9v8m-gq45 x_refsource_CONFIRM
- https://github.com/dicebear/dicebear/commit/922946d738c4e77ab6c412e27ede75941fec4b59 x_refsource_MISC
- https://github.com/dicebear/dicebear/releases/tag/v9.4.3 x_refsource_MISC