Description
DiceBear is an avatar library for designers and developers. Prior to 9.4.3, @dicebear/core interpolates the rotate option into an SVG transform attribute without XML escaping in addRotate in packages/@dicebear/core/src/utils/svg.ts, while @dicebear/initials similarly emits fontSize and fontWeight without escaping in packages/@dicebear/initials/src/index.ts. Runtime callers can pass strings despite the numeric TypeScript types, break out of the attributes, and inject arbitrary SVG markup. Script can execute in the page origin when the generated avatar is inserted inline or served as image/svg+xml and opened directly, although exploitation requires an application to pass untrusted values into these normally developer-controlled options. This issue is fixed in @dicebear/core and @dicebear/initials version 9.4.3.
Published: 2026-08-20
Score: 4.7 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The DiceBear avatar library interpolates the rotate option into an SVG <transform> attribute without XML escaping, and its initials component emits fontSize and fontWeight likewise unescaped. Runtime callers can supply arbitrary strings despite the numeric TypeScript definitions, allowing an attacker to break out of the attributes and inject arbitrary SVG markup. When the generated avatar is inserted inline or served as image/svg+xml, the embedded script code can execute in the page’s origin, resulting in client‑side code execution.

Affected Systems

Versions of dicebear’s @dicebear/core and @dicebear/initials prior to 9.4.3 are vulnerable. This includes all releases of the DiceBear avatar library before the 9.4.3 update, regardless of minor or patch numbers, with the vulnerability fixed in v9.4.3 and later.

Risk and Exploitability

The CVSS score of 4.7 indicates a moderate severity and the EPSS is not available, so the exact exploitation probability is unclear. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires an application to pass untrusted values into the rotate, fontSize, or fontWeight options, after which the resulting SVG can be rendered by a client’s browser, enabling script execution.

Generated by OpenCVE AI on August 21, 2026 at 01:09 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade @dicebear/core and @dicebear/initials to version 9.4.3 or later. This update applies proper XML escaping to all user‑supplied options.
  • Validate any values passed to the rotate, fontSize, or fontWeight options by the application. Ensure the inputs are numeric or otherwise sanitized before they reach the library.
  • If upgrading is not immediately possible, restrict the usage of these options to trusted, developer‑controlled values or remove them entirely in rendering the avatar.

Generated by OpenCVE AI on August 21, 2026 at 01:09 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-gcr2-9v8m-gq45 DiceBear: SVG injection via the unescaped rotate option in @dicebear/core (and fontSize/fontWeight in @dicebear/initials)
History

Fri, 21 Aug 2026 12:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Thu, 20 Aug 2026 23:00:00 +0000

Type Values Removed Values Added
First Time appeared Dicebear
Dicebear dicebear
Vendors & Products Dicebear
Dicebear dicebear

Thu, 20 Aug 2026 21:15:00 +0000

Type Values Removed Values Added
Description DiceBear is an avatar library for designers and developers. Prior to 9.4.3, @dicebear/core interpolates the rotate option into an SVG transform attribute without XML escaping in addRotate in packages/@dicebear/core/src/utils/svg.ts, while @dicebear/initials similarly emits fontSize and fontWeight without escaping in packages/@dicebear/initials/src/index.ts. Runtime callers can pass strings despite the numeric TypeScript types, break out of the attributes, and inject arbitrary SVG markup. Script can execute in the page origin when the generated avatar is inserted inline or served as image/svg+xml and opened directly, although exploitation requires an application to pass untrusted values into these normally developer-controlled options. This issue is fixed in @dicebear/core and @dicebear/initials version 9.4.3.
Title DiceBear: SVG injection via the unescaped rotate option in @dicebear/core (and fontSize/fontWeight in @dicebear/initials)
Weaknesses CWE-184
CWE-79
References
Metrics cvssV3_1

{'score': 4.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N'}


Subscriptions

Dicebear Dicebear
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-21T11:32:29.303Z

Reserved: 2026-07-31T21:04:04.041Z

Link: CVE-2026-68921

cve-icon Vulnrichment

Updated: 2026-08-21T11:32:23.893Z

cve-icon NVD

Status : Received

Published: 2026-08-20T21:17:07.540

Modified: 2026-08-21T12:16:31.297

Link: CVE-2026-68921

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-21T01:15:07Z

Weaknesses
  • CWE-184

    Incomplete List of Disallowed Inputs

  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')