# CVE-2026-33418: @dicebear/converter ensureSize() Vulnerable to SVG Dimension Capping Bypass via XML Comment Injection

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.41%, higher than 37% of CVEs (2026-12-01)
- Published: 2026-03-20T20:35:40.000Z
- Modified: 2026-06-17T10:37:27.807Z
- Also known as: GHSA-7j2x-32w6-p43p
- Weaknesses: CWE-185
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- dicebear dicebear: < 9.4.2; before 9.4.2
- @dicebear/converter (npm): before 9.4.2

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/dicebear/dicebear/security/advisories/GHSA-7j2x-32w6-p43p> (mitigation, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-33418> (advisory)
- <https://github.com/dicebear/dicebear> (package)

## Sources

- CVE List: [CVE-2026-33418](https://www.cve.org/CVERecord?id=CVE-2026-33418), CVE Terms of Use, modified 2026-03-24
- GitHub Advisory Database: [GHSA-7j2x-32w6-p43p](https://github.com/advisories/GHSA-7j2x-32w6-p43p), CC-BY-4.0, modified 2026-03-25
- NVD: [CVE-2026-33418](https://nvd.nist.gov/vuln/detail/CVE-2026-33418), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-33418 · Whole record: https://cve.day/CVE-2026-33418.json · Rebuilt by cve.day 2026-11-25T22:59:16.563Z
