Vulnerability · Published Mar 24, 2026 · Assigned by GitHub_M

CVE-2026-33311@dicebear/core and @dicebear/initials Vulnerable to SVG Injection via Unsanitized Options

Medium 4.7

In plain English

A medium-severity cross-site scripting in dicebear from dicebear. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 8% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)4.7Medium
Exploit odds (30 days)0.2%top 91.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

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 & fixed versions

EcosystemPackageFixed inAdvisory
npm@dicebear/core5.4.4GHSA-mr9r-mww3-v6gv
npm@dicebear/core6.1.4GHSA-mr9r-mww3-v6gv
npm@dicebear/core7.1.4GHSA-mr9r-mww3-v6gv
npm@dicebear/core8.0.3GHSA-mr9r-mww3-v6gv
npm@dicebear/core9.4.1GHSA-mr9r-mww3-v6gv
npm@dicebear/initials5.4.4GHSA-mr9r-mww3-v6gv
npm@dicebear/initials6.1.4GHSA-mr9r-mww3-v6gv
npm@dicebear/initials7.1.4GHSA-mr9r-mww3-v6gv
npm@dicebear/initials8.0.3GHSA-mr9r-mww3-v6gv
npm@dicebear/initials9.4.1GHSA-mr9r-mww3-v6gv

Affected products (as reported)

VendorProductVersions
dicebear dicebear >= 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

Weakness: CWE-79 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N

References