Vulnerability library
Security checkSeptember 02, 2026

DiceBear: SVG injection via the unescaped rotate option in @dicebear/core (and fontSize/fontWeight in @dicebear/initials

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

Medium severitynpm@dicebear/initials

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

@dicebear/core builds avatar SVGs from caller-supplied options. The numeric rotate option is interpolated into an SVG transform attribute without XML-escaping. It is typed as a number, but nothing checks the type at runtime, so a string value passes straight through and can break out of the attribute to inject arbitrary SVG markup.

Recommendation

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

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

References

Could your website be exposed too?

SmartScanner can check your website for DiceBear: SVG injection via the unescaped rotate option in @dicebear/core (and fontSize/fontWeight in @dicebear/initials and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated September 02, 2026