CVE-2023-40013 json
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in external-svg-loader
published 3y ago modified 2mo ago also GHSA-xc2r-jf2x-gjr8 , EUVD-2023-2379
- cvss
- 7.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.6%
- EPSS 0.6% chance of exploitation in 30 days, percentile 47%
- public exploits
- 0
- none known
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.
Patch / fix
- npm external-svg-loader 1.6.9
- shubhamjain svg_loader 1.6.9
Is CVE-2023-40013 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerCISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- total
- Assessed
- 2y ago
Exploit prediction
0.56% chance of exploitation in the next 30 days, higher than 47% of all scored CVEs (FIRST EPSS, 2026-11-15).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L |
| NVD | 3.1 | 5.4 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | external-svg-loader | <1.6.9 |
1.6.9 |
Affected products
- shubhamjain svg-loader
- shubhamjain svg_loader
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
References
-
github.com
/shubhamjain/svg-loader/commit/d3562fc08497aec5f33eb82017fa1417b3319e2c
web, patch
-
github.com
/shubhamjain/svg-loader/security/advisories/GHSA-xc2r-jf2x-gjr8
web, vendor-advisory
-
github.com
/shubhamjain/svg-loader/blob/main/svg-loader.js#L125-L128
web, product
-
github.com
/shubhamjain/svg-loader/tree/main#2-enable-javascript
web, product
-
nvd.nist.gov
/vuln/detail/CVE-2023-40013
advisory
-
github.com
/shubhamjain/svg-loader
package
Sources
- CVE List CVE-2023-40013
- GitHub Advisory GHSA-xc2r-jf2x-gjr8
- NVD CVE-2023-40013
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.