CVE-2026-33311
MEDIUMCVE-2026-33311 is a medium-severity (CVSS 4.7) Cross-site Scripting (XSS) vulnerability in @dicebear/core. O3 Security confirms whether CVE-2026-33311 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
@dicebear/core and @dicebear/initials Vulnerable to SVG Injection via Unsanitized Options
Blast Radius
Weekly download volume for affected packages — a proxy for how broadly this vulnerability is deployed.
@dicebear/corenpmDescription
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @dicebear/core | ≥ 5.0.0&&< 5.4.4 | 5.4.4 |
| 📦npm | @dicebear/core | ≥ 6.0.0&&< 6.1.4 | 6.1.4 |
| 📦npm | @dicebear/core | ≥ 7.0.0&&< 7.1.4 | 7.1.4 |
| 📦npm | @dicebear/core | ≥ 8.0.0&&< 8.0.3 | 8.0.3 |
| 📦npm | @dicebear/core | ≥ 9.0.0&&< 9.4.1 | 9.4.1 |
| 📦npm | @dicebear/initials | ≥ 5.0.0&&< 5.4.4 | 5.4.4 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @dicebear/core. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update @dicebear/core to 5.4.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-33311 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether CVE-2026-33311 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to CVE-2026-33311. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2026-33311 in your dependencies?
O3 detects CVE-2026-33311 across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.