@dicebear/converter ensureSize() Vulnerable to SVG Dimension Capping Bypass via XML Comment Injection
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| dicebear | dicebear | before 9.4.2 | 9.4.2 | Patch available | CNA |
| — | @dicebear/converter (npm) | before 9.4.2 | 9.4.2 | Patch available | GHSA-7j2x-32w6-p43p |
- dicebear Vendordicebear Affected before 9.4.2 Fixed in 9.4.2 Patch available CNA
- @dicebear/converter (npm) Vendor— Affected before 9.4.2 Fixed in 9.4.2 Patch available GHSA-7j2x-32w6-p43p
Remediation
- Fix · CNA dicebear (dicebear) Fixed in 9.4.2
- Fix · GHSA-7j2x-32w6-p43p @dicebear/converter (npm) Fixed in 9.4.2 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-33418
- 2026-10-03 Alias added: GHSA-7j2x-32w6-p43p
References
More Dicebear vulnerabilities
- TI-2026-23253 @dicebear/converter vulnerable to ncontrolled memory allocation via crafted SVG dimensions CVSS 3.1HIGH 7.5
- TI-2026-25722 @dicebear/core and @dicebear/initials Vulnerable to SVG Injection via Unsanitized Options CVSS 3.1MEDIUM 4.7
Sources
- CVE-2026-33418 · CVE Program
- CVE-2026-33418 · NVD
- FIRST EPSS
- GHSA-7j2x-32w6-p43p · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences