Vulnerabilities/

SVG Injection via Unsanitized Options in @dicebear/core and @dicebear/initials

Severity:
Medium

Description

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.

Recommendation

Update the @dicebear/initials package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
@dicebear/initials
Anything's wrong? Let us know Last updated on March 25, 2026