{"answers":{"affected":"2 open source packages ship an affected version, including sanitize-html. It affects 2 products.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-21501 exists.","fix":"Upgrade sanitize-html to 2.12.1 or later.","what":"CVE-2024-21501 is a medium-severity vulnerability in Fedoraproject Fedora, published on 24 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-21501 and fix it if it is affected.\n\nWhat it is: CVE-2024-21501 is a medium-severity vulnerability in Fedoraproject Fedora, published on 24 Feb 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-21501 exists.\n\nAffected packages and fixed versions:\n- sanitize-html (npm): affected all versions; fixed in 2.12.1\n- sanitize-html (npm): affected all versions; fixed in 2.12.1\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-2024-21501/ (Markdown: https://insights.sbomify.com/CVE-2024-21501/index.md)","id":"CVE-2024-21501","markdown":"https://insights.sbomify.com/CVE-2024-21501/index.md","name":"CVE-2024-21501","record":{"aliases":["DEBIAN-CVE-2024-21501","GHSA-rm97-x556-q36h","ROOT-APP-NPM-CVE-2024-21501","UBUNTU-CVE-2024-21501"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"yes","non_default_config":true,"product_category":"HTML sanitization library","requires_auth":"none","summary":"An attacker can enumerate server files and dependencies if the style attribute is allowed, exposing sensitive system structure information.","user_interaction":"not_required","vuln_class":"information_disclosure"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"snyk","cpe":[{"product":"sanitize-html","vendor":"apostrophecms"},{"product":"fedora","vendor":"fedoraproject"}],"cvss":{"score":5.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N/E:P","version":"3.1"},"cwes":[{"id":"CWE-538","name":"Insertion of Sensitive Information into Externally-Accessible File or Directory"},{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"}],"description":"Versions of the package sanitize-html before 2.12.1 are vulnerable to Information Exposure when used on the backend and with the style attribute allowed, allowing enumeration of files in the system (including project dependencies). An attacker could exploit this vulnerability to gather details about the file system structure and dependencies of the targeted server.","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-html Information Exposure vulnerability","id":"CVE-2024-21501","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":"fedoraproject:fedora","products":["fedoraproject:fedora"],"type":"information_disclosure","year":"2024"},"n_packages":2,"n_references":8,"next":{"headline":"Uninitialized Variable in fastecdsa","id":"CVE-2024-21502"},"packages":[{"ecosystem":"npm","fixed":["2.12.1"],"introduced":["0"],"last_affected":[],"package":"sanitize-html","purl":null,"source":"GHSA-rm97-x556-q36h"},{"ecosystem":"npm","fixed":["2.12.1"],"introduced":["0"],"last_affected":[],"package":"sanitize-html","purl":"pkg:npm/sanitize-html","source":"GHSA-rm97-x556-q36h"}],"prev":{"headline":"Improper Restriction of Excessive Authentication Attempts in github.com/greenpau/caddy-security","id":"CVE-2024-21500"},"products":["org.webjars.npm:sanitize-html","sanitize-html"],"published":"2024-02-24","related":[{"cvss_score":6.1,"headline":"Cross-site scripting in apostrophecms:sanitize-html","id":"CVE-2014-125128","kev_date_added":null,"published":"2025-09-08"},{"cvss_score":6.1,"headline":"sanitize-html is vulnerable to XSS through incomprehensive sanitization","id":"CVE-2019-25225","kev_date_added":null,"published":"2025-09-08"},{"cvss_score":6.1,"headline":"Cross-Site Scripting in sanitize-html","id":"CVE-2016-1000237","kev_date_added":null,"published":"2020-01-23"},{"cvss_score":5.3,"headline":"Regular Expression Denial of Service (ReDoS)","id":"CVE-2022-25887","kev_date_added":null,"published":"2022-08-30"},{"cvss_score":5.3,"headline":"Improper Input Validation in sanitize-html","id":"CVE-2021-26539","kev_date_added":null,"published":"2021-02-08"},{"cvss_score":5.3,"headline":"Improper Input Validation in sanitize-html","id":"CVE-2021-26540","kev_date_added":null,"published":"2021-02-08"}],"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":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-02-13","vendors":["n/a"]},"summary":"An attacker can enumerate server files and dependencies if the style attribute is allowed, exposing sensitive system structure information.","url":"https://insights.sbomify.com/CVE-2024-21501/"}