SVG Injection via Unsanitized Options in @dicebear/core and @dicebear/initials
Summary
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.
Affected packages
@dicebear/core—backgroundColoroption values interpolated into SVG attributes without escaping (affectssolidandgradientLinearbackground types)@dicebear/initials—fontFamilyandtextColoroption values interpolated into SVG attributes without escaping
Fix
All affected SVG attribute values are now properly escaped using XML entity encoding. Users should upgrade to the listed patched versions.
Mitigating factors
- 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
Czego dotyczy
Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.
| Platforma | Paczka | Podatne wersje | Poprawka w wersji |
|---|---|---|---|
| Paczka npm | @dicebear/core | >= 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 | 5.4.4, 6.1.4, 7.1.4, 8.0.3, 9.4.1 |
| Paczka npm | @dicebear/initials | >= 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 | 5.4.4, 6.1.4, 7.1.4, 8.0.3, 9.4.1 |
Odnośniki
- Wektor CVSS
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N- Słabość (CWE)
CWE-79- Platforma
- npm
- Paczka
@dicebear/core, @dicebear/initials- Ujawniono
- 19.03.2026
- Aktualizacja
- 11.10.2026 10:22
Źródła i licencje
OSV / GitHub Advisory Database - GHSA-mr9r-mww3-v6gv - CC BY 4.0
Historia podatności: @dicebear/core
Wszystkie opisane podatności tej paczki (Paczka npm), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.
- Wszystkich wpisów
- 2
- Pierwsza → ostatnia
- 03.2026 09.2026
- Bez poprawki
- 0
- Wykorzystywana w atakach
- 0
Rozkład istotności
- Średnia 2
Ujawnienia w latach
- 2026: 2
-
SVG Injection via Unsanitized Options in @dicebear/core and @dicebear/initials ten wpis
Dowiedz się, które podatności dotyczą Twojej aplikacji
Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.