XSS in Shubhamjain Svg-Loader

CVE-2023-40013

SVG Loader is a javascript library that fetches SVGs using XMLHttpRequests and injects the SVG code in the tag's place. According to the docs, svg-loader will strip all JS code before injecting the SVG file for security reasons but the input sanitization logic is not sufficient and can be trivially bypassed. This allows an attacker to craft a malicious SVG which can result in Cross-site Scripting (XSS). When trying to sanitize the svg the lib removes event attributes such as `onmouseover`, `onclick` but the list of events is not exhaustive. Any website which uses external-svg-loader and allows its users to provide svg src, upload svg files would be susceptible to stored XSS attack. This issue has been addressed in commit `d3562fc08` which is included in releases from 1.6.9. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Vulnerability class: XSS (Cross-Site Scripting)

EPSS: 0.006 (44.1th percentile) — read the EPSS interpretation.

CVSS v3 metric

CVSS v3 base score 7.1 (High). Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L.

Affected products

Weakness classification (CWE)

References

Frequently asked questions

What is CVE-2023-40013?
CVE-2023-40013 is a high-severity vulnerability in Shubhamjain Svg-Loader, classified under Cross-site Scripting. CVSS score: 7.1/10. Published 2023-08-14.
How severe is CVE-2023-40013?
High severity. CVSS v3 base score is 7.1 out of 10.