{"answers":{"affected":"2 open source packages ship an affected version, including external-svg-loader. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-40013 exists.","fix":"Upgrade external-svg-loader to 1.6.9 or later.","what":"CVE-2023-40013 is a high-severity cross-site scripting vulnerability in shubhamjain svg-loader, published on 14 Aug 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2023-40013 and fix it if it is affected.\n\nWhat it is: CVE-2023-40013 is a high-severity cross-site scripting vulnerability in shubhamjain svg-loader, published on 14 Aug 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-40013 exists.\n\nAffected packages and fixed versions:\n- external-svg-loader (npm): affected all versions; fixed in 1.6.9\n- external-svg-loader (npm): affected all versions; fixed in 1.6.9\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-40013/ (Markdown: https://insights.sbomify.com/CVE-2023-40013/index.md)","id":"CVE-2023-40013","markdown":"https://insights.sbomify.com/CVE-2023-40013/index.md","name":"CVE-2023-40013","record":{"aliases":["GHSA-xc2r-jf2x-gjr8"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"JavaScript SVG loader","requires_auth":"none","summary":"Attackers can execute arbitrary JavaScript via malicious SVGs due to insufficient sanitization in external-svg-loader, affecting websites allowing user-provided SVGs.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"svg_loader","vendor":"shubhamjain"}],"cvss":{"score":7.1,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L","version":"3.1"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"description":"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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in external-svg-loader","id":"CVE-2023-40013","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"xss","year":"2023"},"n_packages":2,"n_references":4,"next":{"headline":"OpenZeppelin Contracts's ERC2771Context with custom forwarder may lead to zero-valued _msgSender","id":"CVE-2023-40014"},"packages":[{"ecosystem":"npm","fixed":["1.6.9"],"introduced":["0"],"last_affected":[],"package":"external-svg-loader","purl":null,"source":"GHSA-xc2r-jf2x-gjr8"},{"ecosystem":"npm","fixed":["1.6.9"],"introduced":["0"],"last_affected":[],"package":"external-svg-loader","purl":"pkg:npm/external-svg-loader","source":"GHSA-xc2r-jf2x-gjr8"}],"prev":{"headline":"uthenticode EKU validation bypass","id":"CVE-2023-40012"},"products":["svg-loader"],"published":"2023-08-14","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2024-10-02","vendors":["shubhamjain"]},"summary":"Attackers can execute arbitrary JavaScript via malicious SVGs due to insufficient sanitization in external-svg-loader, affecting websites allowing user-provided SVGs.","url":"https://insights.sbomify.com/CVE-2023-40013/"}