@dicebear/converter ensureSize() Vulnerable to SVG Dimension Capping Bypass via XML Comment Injection
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | ||||||
|---|---|---|---|---|---|---|---|---|---|
| dicebear | dicebear | affected |
|
No data.
| Vendor | Product | Versions | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Dicebear | Dicebear |
|
| Source | ID | Title |
|---|---|---|
Github GHSA |
GHSA-7j2x-32w6-p43p | SVG Dimension Capping Bypass via XML Comment Injection in @dicebear/converter ensureSize() |
No CVSS v4.0
No CVSS v3.0
No CVSS v2
This CVE is not in the KEV list.
Exploit prediction score: < 1% (0.391% probability within 30 days)
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Dicebear
Dicebear dicebear |
|
| CPEs | cpe:2.3:a:dicebear:dicebear:*:*:*:*:*:*:*:* | |
| Vendors & Products |
Dicebear
Dicebear dicebear |
| Type | Values Removed | Values Added |
|---|---|---|
| Metrics |
ssvc
|
| Type | Values Removed | Values Added |
|---|---|---|
| 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. | |
| Title | @dicebear/converter ensureSize() Vulnerable to SVG Dimension Capping Bypass via XML Comment Injection | |
| Weaknesses | CWE-185 | |
| References |
| |
| Metrics |
cvssV3_1
|