# CVE-2026-33311: @dicebear/core and @dicebear/initials Vulnerable to SVG Injection via Unsanitized Options

- Severity: Medium 4.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.21%, higher than 11% of CVEs (2026-12-01)
- Published: 2026-03-19T17:49:28.000Z
- Modified: 2026-09-10T03:51:00.638Z
- Also known as: GHSA-mr9r-mww3-v6gv
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- dicebear dicebear: >= 5.0.0, < 5.4.4; >= 6.0.0, < 6.1.4; >= 7.0.0, < 7.1.4; >= 8.0.0, < 8.0.3; >= 9.0.0, < 9.4.1; from 5.0.0 before 5.4.4; from 6.0.0 before 6.1.4; from 7.0.0 before 7.1.4; from 8.0.0 before 8.0.3; from 9.0.0 before 9.4.1
- @dicebear/core (npm): from 5.0.0 before 5.4.4; from 6.0.0 before 6.1.4; from 7.0.0 before 7.1.4; from 8.0.0 before 8.0.3; from 9.0.0 before 9.4.1
- @dicebear/initials (npm): from 5.0.0 before 5.4.4; from 6.0.0 before 6.1.4; from 7.0.0 before 7.1.4; from 8.0.0 before 8.0.3; from 9.0.0 before 9.4.1

## Every score

- GitHub_M: CVSS:3.1 4.7 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 4.7 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/dicebear/dicebear/security/advisories/GHSA-mr9r-mww3-v6gv> (vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-33311> (advisory)
- <https://github.com/dicebear/dicebear> (package)

## Sources

- CVE List: [CVE-2026-33311](https://www.cve.org/CVERecord?id=CVE-2026-33311), CVE Terms of Use, modified 2026-03-26
- GitHub Advisory Database: [GHSA-mr9r-mww3-v6gv](https://github.com/advisories/GHSA-mr9r-mww3-v6gv), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-33311](https://nvd.nist.gov/vuln/detail/CVE-2026-33311), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-33311 · Whole record: https://cve.day/CVE-2026-33311.json · Rebuilt by cve.day 2026-11-25T22:59:16.563Z
