{"answers":{"affected":"2 open source packages ship an affected version, including @mattkrick/sanitize-svg. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-22461 exists.","fix":"Upgrade @mattkrick/sanitize-svg to 0.4.0 or later.","what":"CVE-2023-22461 is a high-severity cross-site scripting vulnerability in mattkrick sanitize-svg, published on 4 Jan 2023. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2023-22461 and fix it if it is affected.\n\nWhat it is: CVE-2023-22461 is a high-severity cross-site scripting vulnerability in mattkrick sanitize-svg, published on 4 Jan 2023. Any signed-in user can exploit it over the network, 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-22461 exists.\n\nAffected packages and fixed versions:\n- @mattkrick/sanitize-svg (npm): affected all versions; fixed in 0.4.0\n- @mattkrick/sanitize-svg (npm): affected all versions; fixed in 0.4.0\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-22461/ (Markdown: https://insights.sbomify.com/CVE-2023-22461/index.md)","id":"CVE-2023-22461","markdown":"https://insights.sbomify.com/CVE-2023-22461/index.md","name":"CVE-2023-22461","record":{"aliases":["GHSA-h857-2g56-468g"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"SVG sanitization library","requires_auth":"low_privilege","summary":"Attackers can bypass SVG sanitization to inject malicious scripts, leading to cross-site scripting in applications using the library.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"sanitize-svg","vendor":"sanitize-svg_project"}],"cvss":{"score":7.6,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-80","name":"Improper Neutralization of Script-Related HTML Tags in a Web Page"},{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"description":"The `sanitize-svg` package, a small SVG sanitizer to prevent cross-site scripting attacks, uses a deny-list-pattern to sanitize SVGs to prevent XSS. In doing so, literal `\u003cscript\u003e`-tags and on-event handlers were detected in versions prior to 0.4.0. As a result, downstream software that relies on `sanitize-svg` and expects resulting SVGs to be safe, may be vulnerable to cross-site scripting. This vulnerability was addressed in v0.4.0. There are no known workarounds","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":"sanitize-svg Filter Bypass Allows Cross-Site Scripting (XSS)","id":"CVE-2023-22461","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"xss","year":"2023"},"n_packages":2,"n_references":2,"next":{"headline":"Stored XSS in Grafana Text plugin","id":"CVE-2023-22462"},"packages":[{"ecosystem":"npm","fixed":["0.4.0"],"introduced":["0"],"last_affected":[],"package":"@mattkrick/sanitize-svg","purl":null,"source":"GHSA-h857-2g56-468g"},{"ecosystem":"npm","fixed":["0.4.0"],"introduced":["0"],"last_affected":[],"package":"@mattkrick/sanitize-svg","purl":"pkg:npm/%40mattkrick/sanitize-svg","source":"GHSA-h857-2g56-468g"}],"prev":{"headline":"go-ipld-prime json codec may panic if asked to encode bytes","id":"CVE-2023-22460"},"products":["sanitize-svg"],"published":"2023-01-04","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":"partial"},"state":"PUBLISHED","updated":"2025-03-10","vendors":["mattkrick"]},"summary":"Attackers can bypass SVG sanitization to inject malicious scripts, leading to cross-site scripting in applications using the library.","url":"https://insights.sbomify.com/CVE-2023-22461/"}