CVE-2023-40013
JavaScript vulnerability analysis and mitigation

Overview

SVG Loader, a JavaScript library that fetches SVGs using XMLHttpRequests and injects SVG code, contains a Cross-site Scripting (XSS) vulnerability in versions up to 1.6.8. The vulnerability was discovered and disclosed in August 2023, affecting any website that uses external-svg-loader and allows users to provide SVG sources or upload SVG files (GitHub Advisory).

Technical details

The vulnerability stems from insufficient input sanitization logic in the SVG Loader library. While the library attempts to strip JavaScript code before injecting SVG files for security reasons, the sanitization process only removes certain event attributes like 'onmouseover' and 'onclick', but the list of events is not exhaustive. The vulnerability allows attackers to bypass security measures using unlisted event attributes such as 'onafterscriptexecute', 'onbeforecopy', 'onbeforecut', and others. The vulnerability has been assigned a CVSS v3.1 base score of 5.4 (MEDIUM) by NVD and 7.1 (HIGH) by GitHub (NVD).

Impact

The vulnerability enables attackers to execute arbitrary JavaScript code through crafted SVG files, potentially leading to Cross-site Scripting (XSS) attacks. Any website that uses external-svg-loader and allows users to provide SVG sources or upload SVG files is susceptible to stored XSS attacks (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in version 1.6.9 of the library through commit d3562fc08. Users are strongly advised to upgrade to this version or later. There are no known workarounds for this vulnerability (GitHub Patch).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-23744CRITICAL9.8
  • JavaScriptJavaScript
  • @mcpjam/inspector
NoYesJan 16, 2026
CVE-2026-23735HIGH8.7
  • JavaScriptJavaScript
  • graphql-modules
NoYesJan 16, 2026
GHSA-gw32-9rmw-qwwwHIGH8.4
  • JavaScriptJavaScript
  • svelte
NoYesJan 16, 2026
CVE-2026-23745HIGH8.2
  • JavaScriptJavaScript
  • argo-workflows-fips-3.6
NoYesJan 16, 2026
GHSA-38cw-85xc-xr9xMEDIUM6.8
  • JavaScriptJavaScript
  • @veramo/data-store
NoYesJan 16, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management