@dicebear/core and @dicebear/initials Vulnerable to SVG Injection via Unsanitized Options
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- High
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| dicebear | dicebear | 5.0.0 to before 5.4.4; 6.0.0 to before 6.1.4; 7.0.0 to before 7.1.4; 8.0.0 to before 8.0.3; 9.0.0 to before 9.4.1 | 5.4.4, 6.1.4, 7.1.4, 8.0.3, 9.4.1 | Patch available | CNA |
| — | @dicebear/core (npm) | 5.0.0 to before 5.4.4 | 5.4.4 | Patch available | GHSA-mr9r-mww3-v6gv |
| — | @dicebear/core (npm) | 6.0.0 to before 6.1.4 | 6.1.4 | Patch available | GHSA-mr9r-mww3-v6gv |
| — | @dicebear/core (npm) | 7.0.0 to before 7.1.4 | 7.1.4 | Patch available | GHSA-mr9r-mww3-v6gv |
| — | @dicebear/core (npm) | 8.0.0 to before 8.0.3 | 8.0.3 | Patch available | GHSA-mr9r-mww3-v6gv |
| — | @dicebear/core (npm) | 9.0.0 to before 9.4.1 | 9.4.1 | Patch available | GHSA-mr9r-mww3-v6gv |
| — | @dicebear/initials (npm) | 5.0.0 to before 5.4.4 | 5.4.4 | Patch available | GHSA-mr9r-mww3-v6gv |
| — | @dicebear/initials (npm) | 6.0.0 to before 6.1.4 | 6.1.4 | Patch available | GHSA-mr9r-mww3-v6gv |
| — | @dicebear/initials (npm) | 7.0.0 to before 7.1.4 | 7.1.4 | Patch available | GHSA-mr9r-mww3-v6gv |
| — | @dicebear/initials (npm) | 8.0.0 to before 8.0.3 | 8.0.3 | Patch available | GHSA-mr9r-mww3-v6gv |
| — | @dicebear/initials (npm) | 9.0.0 to before 9.4.1 | 9.4.1 | Patch available | GHSA-mr9r-mww3-v6gv |
- dicebear Vendordicebear Affected 5.0.0 to before 5.4.4; 6.0.0 to before 6.1.4; 7.0.0 to before 7.1.4; 8.0.0 to before 8.0.3; 9.0.0 to before 9.4.1 Fixed in 5.4.4, 6.1.4, 7.1.4, 8.0.3, 9.4.1 Patch available CNA
- @dicebear/core (npm) Vendor— Affected 5.0.0 to before 5.4.4 Fixed in 5.4.4 Patch available GHSA-mr9r-mww3-v6gv
- @dicebear/core (npm) Vendor— Affected 6.0.0 to before 6.1.4 Fixed in 6.1.4 Patch available GHSA-mr9r-mww3-v6gv
- @dicebear/core (npm) Vendor— Affected 7.0.0 to before 7.1.4 Fixed in 7.1.4 Patch available GHSA-mr9r-mww3-v6gv
- @dicebear/core (npm) Vendor— Affected 8.0.0 to before 8.0.3 Fixed in 8.0.3 Patch available GHSA-mr9r-mww3-v6gv
- @dicebear/core (npm) Vendor— Affected 9.0.0 to before 9.4.1 Fixed in 9.4.1 Patch available GHSA-mr9r-mww3-v6gv
- @dicebear/initials (npm) Vendor— Affected 5.0.0 to before 5.4.4 Fixed in 5.4.4 Patch available GHSA-mr9r-mww3-v6gv
- @dicebear/initials (npm) Vendor— Affected 6.0.0 to before 6.1.4 Fixed in 6.1.4 Patch available GHSA-mr9r-mww3-v6gv
- @dicebear/initials (npm) Vendor— Affected 7.0.0 to before 7.1.4 Fixed in 7.1.4 Patch available GHSA-mr9r-mww3-v6gv
- @dicebear/initials (npm) Vendor— Affected 8.0.0 to before 8.0.3 Fixed in 8.0.3 Patch available GHSA-mr9r-mww3-v6gv
- @dicebear/initials (npm) Vendor— Affected 9.0.0 to before 9.4.1 Fixed in 9.4.1 Patch available GHSA-mr9r-mww3-v6gv
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:dicebear:dicebear:*:*:*:*:*:*:*:* | 5.0.0 to before 5.4.4; 6.0.0 to before 6.1.4; 7.0.0 to before 7.1.4; 8.0.0 to before 8.0.3; 9.0.0 to before 9.4.1 | Vulnerable | dicebear |
- cpe:2.3:a:dicebear:dicebear:*:*:*:*:*:*:*:* Versions 5.0.0 to before 5.4.4; 6.0.0 to before 6.1.4; 7.0.0 to before 7.1.4; 8.0.0 to before 8.0.3; 9.0.0 to before 9.4.1 Vulnerable ·dicebear
Remediation
- Fix · CNA dicebear (dicebear) Fixed in 5.4.4, 6.1.4, 7.1.4, 8.0.3, 9.4.1
- Fix · GHSA-mr9r-mww3-v6gv @dicebear/core (npm) Fixed in 5.4.4 Advisory →
- Fix · GHSA-mr9r-mww3-v6gv @dicebear/core (npm) Fixed in 6.1.4 Advisory →
- Fix · GHSA-mr9r-mww3-v6gv @dicebear/core (npm) Fixed in 7.1.4 Advisory →
- Fix · GHSA-mr9r-mww3-v6gv @dicebear/core (npm) Fixed in 8.0.3 Advisory →
- Fix · GHSA-mr9r-mww3-v6gv @dicebear/core (npm) Fixed in 9.4.1 Advisory →
- Fix · GHSA-mr9r-mww3-v6gv @dicebear/initials (npm) Fixed in 5.4.4 Advisory →
- Fix · GHSA-mr9r-mww3-v6gv @dicebear/initials (npm) Fixed in 6.1.4 Advisory →
- Fix · GHSA-mr9r-mww3-v6gv @dicebear/initials (npm) Fixed in 7.1.4 Advisory →
- Fix · GHSA-mr9r-mww3-v6gv @dicebear/initials (npm) Fixed in 8.0.3 Advisory →
- Fix · GHSA-mr9r-mww3-v6gv @dicebear/initials (npm) Fixed in 9.4.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-33311
- 2026-10-03 Alias added: GHSA-mr9r-mww3-v6gv
References
More Dicebear vulnerabilities
- TI-2026-25815 @dicebear/converter ensureSize() Vulnerable to SVG Dimension Capping Bypass via XML Comment Injection CVSS 3.1HIGH 7.5
- TI-2026-23253 @dicebear/converter vulnerable to ncontrolled memory allocation via crafted SVG dimensions CVSS 3.1HIGH 7.5
Sources
- CVE-2026-33311 · CVE Program
- CVE-2026-33311 · NVD
- FIRST EPSS
- GHSA-mr9r-mww3-v6gv · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences