{"id":"CVE-2026-33418","published":"2026-03-24T13:25:57Z","modified":"2026-03-24T15:11:51Z","title":"@dicebear/converter ensureSize() Vulnerable to SVG Dimension Capping Bypass via XML Comment Injection","vendor":"dicebear","product":"dicebear","tier":"tail","description":{"text":"DiceBear is an avatar library for designers and developers. Prior to version 9.4.2, the `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. In version 9.4.2, the 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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00415,"percentile":0.36647,"provenance":"source"},"cwes":[{"id":"CWE-185","name":"Incorrect Regular Expression"}],"references":[{"url":"https://github.com/dicebear/dicebear/security/advisories/GHSA-7j2x-32w6-p43p","tags":["x_refsource_CONFIRM"]}],"priority":{"score":12.6,"factors":[{"name":"EPSS percentile","points":7.33},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"dicebear","affectedVersions":[{"vendor":"dicebear","product":"dicebear","versions":["< 9.4.2"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2026-03-24T14:10:31.935009Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"@dicebear/converter","vulnerableRanges":["<9.4.2"],"patched":["9.4.2"],"from":["GHSA-7j2x-32w6-p43p"],"provenance":"source"}],"summary":{"text":"The flaw lies in the ensureSize() function of @dicebear/converter in the DiceBear avatar library, prior to version 9.4.2, where a regex-based SVG dimension capping routine can be fooled into modifying the wrong <svg occurrence.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:51:38Z"},"euvd":{"id":"EUVD-2026-14875","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2026-29112","published":"2026-03-18","fixed":"9.4.0","kev":false,"link":{"from":"CVE-2026-29112","to":"CVE-2026-33418","relation":"successor","confidence":"medium","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:@dicebear/converter","fromFixed":"9.4.0","toFixed":"9.4.2","daysApart":6},{"kind":"similar","provenance":"machine","score":0.38,"basis":"same product + description similarity"}]}},{"cve":"CVE-2026-33418","published":"2026-03-24","fixed":"9.4.2","kev":false}],"package":"npm:@dicebear/converter"}}