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 scanRelated Issues
- Jodit Editor vulnerable to cross-site scripting - CVE-2023-42399
- layui vulnerable to cross-site scripting - CVE-2023-3691
- TinyMCE Cross-Site Scripting (XSS) vulnerability in handling external SVG files through Object or Embed elements - CVE-2024-29881
- Bootstrap vulnerable to Cross-Site Scripting (XSS) - CVE-2018-14040


