{"id":"GHSA-mr9r-mww3-v6gv","revision":"89624734424e4a279f6044c5d2ec59be","records":[{"revision":"89624734424e4a279f6044c5d2ec59be","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-mr9r-mww3-v6gv","aliases":["CVE-2026-33311"],"title":"SVG Injection via Unsanitized Options in @dicebear/core and @dicebear/initials","description":"## 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","state":0,"publishedAt":"2026-03-19T17:49:28+00:00","modifiedAt":"2026-09-10T03:51:00.6382148+00:00","affected":[{"ecosystem":"npm","name":"@dicebear/core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"5.0.0"},{"kind":"fixed","version":"5.4.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@dicebear/core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"6.0.0"},{"kind":"fixed","version":"6.1.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@dicebear/core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"7.0.0"},{"kind":"fixed","version":"7.1.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@dicebear/core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"8.0.0"},{"kind":"fixed","version":"8.0.3"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@dicebear/core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"9.0.0"},{"kind":"fixed","version":"9.4.1"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@dicebear/initials","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"5.0.0"},{"kind":"fixed","version":"5.4.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@dicebear/initials","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"6.0.0"},{"kind":"fixed","version":"6.1.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@dicebear/initials","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"7.0.0"},{"kind":"fixed","version":"7.1.4"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@dicebear/initials","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"8.0.0"},{"kind":"fixed","version":"8.0.3"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@dicebear/initials","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"9.0.0"},{"kind":"fixed","version":"9.4.1"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/dicebear/dicebear/security/advisories/GHSA-mr9r-mww3-v6gv","https://nvd.nist.gov/vuln/detail/CVE-2026-33311","https://github.com/dicebear/dicebear"],"sourceUrl":"https://github.com/advisories/GHSA-mr9r-mww3-v6gv","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-mr9r-mww3-v6gv","identifiers":["GHSA-mr9r-mww3-v6gv","CVE-2026-33311"]},"retained":false,"historicalAffected":[]}],"coverage":[]}