The vulnerability is an uncontrolled memory allocation issue in the @dicebear/converter package. The root cause lies in the ensureSize function, located in packages/@dicebear/converter/src/utils/svg.ts. Before the patch, this function would parse the width attribute directly from the input SVG string without any validation. The extracted value was then used by the toCanvas function in packages/@dicebear/converter/src/core.ts to set the dimensions of a new canvas element. An attacker could exploit this by providing a crafted SVG with an extremely large width attribute, causing the toCanvas function to attempt a massive memory allocation, which would lead to a Denial of Service (DoS).
The patch, identified in commit 42a59eac46a3c68598859e608ec45e578b27614a, rectifies this by completely changing the logic. The ensureSize function no longer reads the dimensions from the SVG. Instead, it accepts a size parameter, which is sanitized to ensure it's within a safe range (defaulting to 512 and capped at 2048), and then overwrites the width and height attributes in the SVG. The public-facing functions (toPng, toJpeg, etc.) were updated to accept this new size option. Any runtime profile of an exploit would show a call chain originating from one of these export functions, leading to toCanvas and finally ensureSize.