Vulnerability library
Security checkJanuary 29, 2023

@mattkrick/sanitize-svg vulnerable to Cross-Site Scripting (XSS)

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 sanitize-svg package uses a deny-list-pattern to sanitize SVGs to prevent cross-site scripting (XSS). In doing so, literal <script>-tags and on-event handlers were detected:

There are more ways to embed JavaScript in XML files.

Recommendation

Update the @mattkrick/sanitize-svg package to the latest compatible version. Followings are version details:

  • Affected version(s): <= 0.3.1
  • Patched version(s): 0.4.0

References

Could your website be exposed too?

SmartScanner can check your website for @mattkrick/sanitize-svg vulnerable to Cross-Site Scripting (XSS) and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated January 29, 2023