CVE-2026-33418
Regex Bypass in DiceBear SVG Parsing Causes DoS via OOM
Publication date: 2026-03-24
Last updated on: 2026-03-24
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| dicebear | dicebear | to 9.4.2 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-185 | The product specifies a regular expression in a way that causes data to be improperly matched or compared. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2026-33418 is a high-severity vulnerability in the npm package @dicebear/converter affecting versions up to 9.4.1. The issue is in the ensureSize() function, which uses a regex-based method to rewrite SVG width and height attributes, capping them at 2048 pixels to prevent denial of service attacks caused by excessive resource consumption.
The vulnerability arises because the regex does not correctly identify the actual SVG root element and can be tricked by crafted SVG input containing a decoy <svg tag inside an XML comment before the real root element. This causes the regex to match the wrong tag, leaving the real SVG dimensions unchecked.
When such malicious SVG is rendered on the Node.js code path using @resvg/resvg-jsβs renderAsync function, which lacks proper size constraints, it renders at attacker-specified dimensions. This can lead to excessive memory allocation, potentially causing out-of-memory crashes and denial of service.
The vulnerability was fixed in version 9.4.2 by replacing the regex-based approach with XML-aware processing using fast-xml-parser and adding a fitTo constraint to ensure rendered output dimensions are always bounded.
How can this vulnerability impact me? :
This vulnerability can impact you by causing denial of service (DoS) conditions in applications that process untrusted or user-supplied SVG content using @dicebear/converterβs Node.js conversion functions.
An attacker can craft malicious SVG input that bypasses size restrictions, causing the rendering process to consume excessive memory and potentially crash the application due to out-of-memory errors.
The impact is limited to availability, meaning it does not compromise confidentiality or integrity but can disrupt service availability.
Any application using @dicebear/converter independently of DiceBearβs avatar generation and processing SVG input is at risk.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
I don't know
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability affects applications using the @dicebear/converter package versions up to 9.4.1 that process untrusted or user-supplied SVG content on the Node.js code path. Detection involves identifying if your system uses a vulnerable version of @dicebear/converter and whether it processes SVG inputs through the affected functions (toPng, toJpeg, toWebp, toAvif).
Since the vulnerability is triggered by crafted SVG inputs containing a decoy <svg tag inside XML comments before the actual root element, monitoring for such SVG payloads in your input data could help detect exploitation attempts.
To detect vulnerable versions, you can run commands to check installed package versions, for example:
- npm list @dicebear/converter
- yarn list --pattern @dicebear/converter
Additionally, you can scan logs or network traffic for SVG inputs containing suspicious patterns such as XML comments with <svg tags before the root element.
What immediate steps should I take to mitigate this vulnerability?
The primary mitigation is to upgrade the @dicebear/converter package to version 9.4.2 or later, where the vulnerability is fixed by replacing the regex-based SVG size capping with XML-aware processing and adding a fitTo constraint to the renderAsync call.
If upgrading immediately is not possible, consider restricting or sanitizing untrusted SVG inputs to prevent maliciously crafted SVGs from being processed.
Also, monitor your application for unusual memory usage or crashes that could indicate exploitation attempts.