@dicebear/core
Affected
- introduced
5.0.0, fixed5.4.4(semver)
Fixed versions
5.4.4
Fix
- Fixed version
5.4.4npm install @dicebear/[email protected]
Advisory
Also known as: CVE-2026-33311
SVG Injection via Unsanitized Options in @dicebear/core and @dicebear/initials
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
backgroundColor option values interpolated into SVG attributes without escaping (affects solid and gradientLinear background types)fontFamily and textColor option values interpolated into SVG attributes without escapingFix
All affected SVG attribute values are now properly escaped using XML entity encoding. Users should upgrade to the listed patched versions.
Mitigating factors
createAvatar() are not affectedMedium Basis: The source's own band: MODERATE
5.0.0, fixed 5.4.4 (semver)5.4.4
5.4.4npm install @dicebear/[email protected]6.0.0, fixed 6.1.4 (semver)6.1.4
6.1.4npm install @dicebear/[email protected]7.0.0, fixed 7.1.4 (semver)7.1.4
7.1.4npm install @dicebear/[email protected]8.0.0, fixed 8.0.3 (semver)8.0.3
8.0.3npm install @dicebear/[email protected]9.0.0, fixed 9.4.1 (semver)9.4.1
9.4.1npm install @dicebear/[email protected]5.0.0, fixed 5.4.4 (semver)5.4.4
5.4.4npm install @dicebear/[email protected]6.0.0, fixed 6.1.4 (semver)6.1.4
6.1.4npm install @dicebear/[email protected]7.0.0, fixed 7.1.4 (semver)7.1.4
7.1.4npm install @dicebear/[email protected]8.0.0, fixed 8.0.3 (semver)8.0.3
8.0.3npm install @dicebear/[email protected]9.0.0, fixed 9.4.1 (semver)9.4.1
9.4.1npm install @dicebear/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0