@dicebear/core and @dicebear/initials Vulnerable to SVG Injection via Unsanitized Options
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 5.4.4, 6.1.4, 7.1.4, 8.0.3, 9.4.1
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
- Exploitation: none
- Automatable: no
- Technical impact: partial
Summary
DiceBear is an avatar library for designers and developers. Starting in version 5.0.0 and prior to versions 5.4.4, 6.1.4, 7.1.4, 8.0.3, and 9.4.1, 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`. Starting in versions 5.4.4, 6.1.4, 7.1.4, 8.0.3, and 9.4.1, all affected SVG attribute values are properly escaped using XML entity encoding. Users should upgrade to the listed patched versions. Some mitigating factors limit vulnerability. Applications that validate input against the library's JSON Schema before passing it to `createAvatar()` are not affected. The DiceBear CLI validates input via AJV and was not vulnerable. Exploitation requires that an application passes untrusted, unvalidated external input directly as option values.
Timeline
- CVE published
- CISA SSVC assessment
Exploitation: none · Automatable: no · Technical impact: partial
- Record last updated
Affected versions
- dicebear dicebear
From 5.0.0 · fixed in 5.4.4; From 6.0.0 · fixed in 6.1.4; From 7.0.0 · fixed in 7.1.4; From 8.0.0 · fixed in 8.0.3; From 9.0.0 · fixed in 9.4.1
- @dicebear/corenpm
From 5.0.0 · fixed in 5.4.4
- @dicebear/corenpm
From 6.0.0 · fixed in 6.1.4
- @dicebear/corenpm
From 7.0.0 · fixed in 7.1.4
- @dicebear/corenpm
From 8.0.0 · fixed in 8.0.3
- @dicebear/corenpm
From 9.0.0 · fixed in 9.4.1
- @dicebear/initialsnpm
From 5.0.0 · fixed in 5.4.4
- @dicebear/initialsnpm
From 6.0.0 · fixed in 6.1.4
- @dicebear/initialsnpm
From 7.0.0 · fixed in 7.1.4
- @dicebear/initialsnpm
From 8.0.0 · fixed in 8.0.3
- @dicebear/initialsnpm
From 9.0.0 · fixed in 9.4.1