Vulnerability library
Security checkMarch 25, 2026

SVG Dimension Capping Bypass via XML Comment Injection in @dicebear/converter ensureSize()

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

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.

Recommendation

Update the @dicebear/converter package to the latest compatible version. Followings are version details:

  • Affected version(s): <= 9.4.1
  • Patched version(s): 9.4.2

References

Could your website be exposed too?

SmartScanner can check your website for SVG Dimension Capping Bypass via XML Comment Injection in @dicebear/converter ensureSize() and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated March 25, 2026