CVE-2023-40013Shubhamjain Svg Loader
Medium 5.4
Follow: this CVE · Shubhamjain · Shubhamjain Svg Loader We alert you by email or Slack (account required).
- Priority
- 32
- CVSS 3.1
- 5.4
- EPSS
- 0.7% probability of exploitation in 30 days · percentile 48
- Auth required
- Yes
- Published
- Aug 14, 2023
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-79
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: no · Technical impact: total
- Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
What happens
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.
What to do
- Apply the vendor's security update for Svg Loader.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| npm | external-svg-loader |
< 1.6.9 |
1.6.9 |
npm install external-svg-loader@1.6.9 |
Per OSV / GitHub Advisories (GHSA-xc2r-jf2x-gjr8). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| shubhamjain | svg_loader | < 1.6.9 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Product
- github.com Patch
- github.com Vendor Advisory
- github.com Product