Vulnerabilities in pkg:npm/@dicebear/converter
PACKAGECVE-2026-33418 is a HIGH (CVSS 7.5) svg dimension capping bypass vulnerability (CWE-185: Incorrect Regular Expression) affecting @dicebear/converter libraries in the npm ecosystem. The issue involves svg dimension capping bypass via xml comment injection in @dicebear/converter ensuresize(). Remediation is available by upgrading affected packages to version 9.4.2.
pkg:npm/@dicebear/converter
Vulnerability advisories affecting package pkg:npm/@dicebear/converter. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-7j2x-32w6-p43p | CVE-2026-33418 | HIGH | SVG Dimension Capping Bypass via XML Comment Injection in @dicebear/converter ensureSize() |
| GHSA-v3r3-4qgc-vw66 | CVE-2026-29112 | HIGH | Uncontrolled memory allocation via crafted SVG dimensions in @dicebear/converter |
CVE-2026-33418 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2026-33418
To remediate this vulnerability, upgrade all affected @dicebear/converter dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @dicebear/converter@9.4.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @dicebear/converter
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-33418, inspect your project dependencies using npm:
npm ls @dicebear/converter
Analyze the terminal output to locate any version of @dicebear/converter in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.4.2), your application is affected.
Note: The npm ls @dicebear/converter command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-185: Incorrect Regular Expression, where the product specifies a regular expression in a way that causes data to be improperly matched or compared. In @dicebear/converter, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-33418 Affected @dicebear/converter Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@dicebear/converter
|
npm |
< 9.4.2
|
9.4.2
|
References
Frequently Asked Questions
What is CVE-2026-33418?
Which @dicebear/converter versions are affected?
What version fixes CVE-2026-33418?
Is @dicebear/converter affected?
What is the CVSS score of CVE-2026-33418?
What CWE is associated with CVE-2026-33418?
How can I check npm dependencies for CVE-2026-33418?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7j2x-32w6-p43p",
"modified" : "2026-03-25T20:53:40Z",
"published" : "2026-03-20T20:35:40Z",
"aliases" : [ "CVE-2026-33418" ],
"summary" : "SVG Dimension Capping Bypass via XML Comment Injection in @dicebear/converter ensureSize()",
"details" : "## Summary\n\nThe `ensureSize()` function in `@dicebear/converter` used a regex-based approach to rewrite SVG `width`/`height` attributes, capping them at 2048px to prevent denial of service. This size capping could be bypassed by crafting SVG input that causes the regex to match a non-functional occurrence of `<svg` before the actual SVG root element. When the SVG is subsequently rendered via `@resvg/resvg-js` on the Node.js code path, it renders at the attacker-specified dimensions, potentially causing out-of-memory crashes.\n\n## Details\n\nThe vulnerable function used `String.prototype.replace()` with a non-global regex to find and rewrite the first `<svg` tag's dimensions. Since the regex does not distinguish between `<svg` appearing inside non-element XML constructs and the actual SVG root element, a crafted input can cause the regex to match a decoy instead of the real element, leaving the actual SVG dimensions unclamped.\n\nIn the Node.js rendering path, `renderAsync` from `@resvg/resvg-js` was called without a `fitTo` constraint, so it would render at whatever dimensions the SVG element specified — potentially allocating gigabytes of memory.\n\nThe browser code path is **not** vulnerable because it uses the clamped `size` return value from `ensureSize()` to set `canvas.width` and `canvas.height` directly.\n\n## Impact\n\nAny application that passes untrusted or user-supplied SVG content through `@dicebear/converter`'s Node.js conversion functions (`toPng`, `toJpeg`, `toWebp`, `toAvif`) is vulnerable to denial of service via excessive memory allocation. Note that `@dicebear/converter` can be used independently of DiceBear's avatar generation — any SVG string can be passed to the conversion functions.\n\nThe impact is limited to availability — there is no data disclosure or integrity impact. The browser code path is not affected.\n\n## Fix\n\nThe regex-based approach has been replaced with XML-aware processing using `fast-xml-parser` to correctly identify and modify the SVG root element's attributes. Additionally, a `fitTo` constraint has been added to the `renderAsync` call as defense-in-depth, ensuring the rendered output is always bounded regardless of SVG content.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@dicebear/converter"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "9.4.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 9.4.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/dicebear/dicebear/security/advisories/GHSA-7j2x-32w6-p43p"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33418"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/dicebear/dicebear"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-185" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-20T20:35:40Z",
"nvd_published_at" : "2026-03-24T14:16:30Z"
}
}