{"id":"GHSA-gcr2-9v8m-gq45","revision":"cc47e6460d51408f94fd6ebffc7d1ca6","records":[{"revision":"cc47e6460d51408f94fd6ebffc7d1ca6","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-gcr2-9v8m-gq45","aliases":["CVE-2026-68921"],"title":"DiceBear: SVG injection via the unescaped rotate option in @dicebear/core (and fontSize/fontWeight in @dicebear/initials)","description":"## Summary\n\n`@dicebear/core` builds avatar SVGs from caller-supplied options. The numeric `rotate` option is interpolated into an SVG `transform` attribute without XML-escaping. It is typed as a number, but nothing checks the type at runtime, so a string value passes straight through and can break out of the attribute to inject arbitrary SVG markup.\n\nThis is the same root cause as CVE-2026-33311 (GHSA-mr9r-mww3-v6gv), which escaped the string options `backgroundColor`, `fontFamily`, and `textColor` but did not cover `rotate`. `@dicebear/initials` has the same gap in its numeric `fontSize` and `fontWeight` options.\n\n## Impact\n\nCross-site scripting (CWE-79). When the generated avatar is rendered inline (for example via `innerHTML`) or served as `image/svg+xml` and opened directly, injected markup such as an `<image onerror>` handler runs script in the page's origin.\n\nExploitation requires the application to pass untrusted input into one of these options:\n\n- `rotate` (`@dicebear/core`)\n- `fontSize`, `fontWeight` (`@dicebear/initials`)\n\nIn most integrations these options are set by the developer and only `seed` is user-controlled, so the vulnerable configuration is uncommon. Applications that use trusted, hardcoded values for these options are not at risk.\n\n## Patches\n\nFixed in `@dicebear/core` 9.4.3 and `@dicebear/initials` 9.4.3: the values are now XML-escaped before being written into the SVG, matching the CVE-2026-33311 fix. Upgrade to 9.4.3 or later.\n\nThe 5.x through 8.x lines share the same flaw but are end-of-life and will not receive a backport; upgrade to 9.4.3. The 10.x line is not affected.\n\n## Workarounds\n\nIf you cannot upgrade, coerce the affected options to a number before passing them to `createAvatar`:\n\n```js\nrotate: Number(userInput) || 0,\n```\n\n## Credits\n\nReported by @rz1027.","state":0,"publishedAt":"2026-09-02T22:44:25+00:00","modifiedAt":"2026-09-17T05:15:05.088434+00:00","affected":[{"ecosystem":"npm","name":"@dicebear/core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"9.4.3"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@dicebear/initials","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"9.4.3"}]}],"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-gcr2-9v8m-gq45","https://nvd.nist.gov/vuln/detail/CVE-2026-68921","https://github.com/dicebear/dicebear/commit/922946d738c4e77ab6c412e27ede75941fec4b59","https://github.com/dicebear/dicebear","https://github.com/dicebear/dicebear/releases/tag/v9.4.3"],"sourceUrl":"https://github.com/advisories/GHSA-gcr2-9v8m-gq45","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-gcr2-9v8m-gq45","identifiers":["GHSA-gcr2-9v8m-gq45","CVE-2026-68921"]},"retained":false,"historicalAffected":[]}],"coverage":[]}