Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in external-svg-loader
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- High
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- High · High · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| shubhamjain | svg-loader | before 1.6.9 | 1.6.9 | Patch available | CNA |
| — | external-svg-loader (npm) | before 1.6.9 | 1.6.9 | Patch available | GHSA-xc2r-jf2x-gjr8 |
- svg-loader Vendorshubhamjain Affected before 1.6.9 Fixed in 1.6.9 Patch available CNA
- external-svg-loader (npm) Vendor— Affected before 1.6.9 Fixed in 1.6.9 Patch available GHSA-xc2r-jf2x-gjr8
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:shubhamjain:svg_loader:*:*:*:*:*:node.js:*:* | before 1.6.9 | Vulnerable | shubhamjain |
- cpe:2.3:a:shubhamjain:svg_loader:*:*:*:*:*:node.js:*:* Versions before 1.6.9 Vulnerable ·shubhamjain
Remediation
- Fix · CNA svg-loader (shubhamjain) Fixed in 1.6.9
- Fix · GHSA-xc2r-jf2x-gjr8 external-svg-loader (npm) Fixed in 1.6.9 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2023-40013
- 2026-10-03 Alias added: GHSA-xc2r-jf2x-gjr8
References
Advisory 2
Sources
- CVE-2023-40013 · CVE Program
- CVE-2023-40013 · NVD
- FIRST EPSS
- GHSA-xc2r-jf2x-gjr8 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences