Impact
DiceBear, an avatar generation library, handles several SVG attribute values such as backgroundColor, fontFamily, and textColor by interpolating user‑supplied values directly into the SVG markup without XML escaping. This omission permits attackers to inject crafted strings that resolve into executable JavaScript when the resulting SVG is served inline or with the proper Content‑Type header. The flaw is a classic cross‑site scripting vulnerability (CWE‑79) that can compromise data confidentiality, integrity, and availability of affected web applications.
Affected Systems
The vulnerability impacts the dicebear products @dicebear/core and @dicebear/initials. Any release from version 5.0.0 through the predecessor of 5.4.4, from 6.0.0 through the predecessor of 6.1.4, from 7.0.0 through 7.1.3, from 8.0.0 through 8.0.2, and from 9.0.0 through 9.4.0 is affected. Upgraded releases 5.4.4, 6.1.4, 7.1.4, 8.0.3, and 9.4.1 contain an XML‑escaping fix and are immune to the flaw.
Risk and Exploitability
The CVSS score of 4.7 indicates a moderate severity level. Because exploitation requires that an application pass untrusted input directly to createAvatar and expose the resulting SVG to clients, the attack is limited to scenarios where input validation is absent or inadequate. The vulnerability is not listed in the CISA KEV catalog and the EPSS score is unavailable, implying no widespread exploitation yet, but the potential impact warrants prompt remediation.
OpenCVE Enrichment
Github GHSA