{"id":"CVE-2026-33311","aliases":["GHSA-mr9r-mww3-v6gv"],"url":"https://o3.security/vulnerability/CVE-2026-33311","summary":"@dicebear/core and @dicebear/initials Vulnerable to SVG Injection via Unsanitized Options","details":"## Summary\n\nSVG 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`.\n\n## Affected packages\n\n- **`@dicebear/core`** — `backgroundColor` option values interpolated into SVG attributes without escaping (affects `solid` and `gradientLinear` background types)\n- **`@dicebear/initials`** — `fontFamily` and `textColor` option values interpolated into SVG attributes without escaping\n\n## Fix\n\nAll affected SVG attribute values are now properly escaped using XML entity encoding. Users should upgrade to the listed patched versions.\n\n## Mitigating factors\n\n- Applications that validate input against the library's JSON Schema before passing it to `createAvatar()` are not affected\n- The DiceBear CLI validates input via AJV and was not vulnerable\n- Exploitation requires that an application passes untrusted, unvalidated external input directly as option values","published":"2026-03-24T13:23:43.289Z","modified":"2026-08-12T03:51:08.112131805Z","cvss":{"score":4.7,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N"},"epss":{"score":0.00181,"percentile":0.07933,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"@dicebear/core","fixedVersion":"5.4.4"},{"ecosystem":"npm","name":"@dicebear/core","fixedVersion":"6.1.4"},{"ecosystem":"npm","name":"@dicebear/core","fixedVersion":"7.1.4"},{"ecosystem":"npm","name":"@dicebear/core","fixedVersion":"8.0.3"},{"ecosystem":"npm","name":"@dicebear/core","fixedVersion":"9.4.1"},{"ecosystem":"npm","name":"@dicebear/initials","fixedVersion":"5.4.4"},{"ecosystem":"npm","name":"@dicebear/initials","fixedVersion":"6.1.4"},{"ecosystem":"npm","name":"@dicebear/initials","fixedVersion":"7.1.4"},{"ecosystem":"npm","name":"@dicebear/initials","fixedVersion":"8.0.3"},{"ecosystem":"npm","name":"@dicebear/initials","fixedVersion":"9.4.1"}],"fix":null,"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/33xxx/CVE-2026-33311.json"},{"type":"ADVISORY","url":"https://github.com/dicebear/dicebear/security/advisories/GHSA-mr9r-mww3-v6gv"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33311"},{"type":"PACKAGE","url":"https://github.com/dicebear/dicebear"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:08.112131805Z"}}