{"answers":{"affected":"2 open source packages ship an affected version, including ghtml.","exploited":"There is no known exploitation of CVE-2024-37166 in the wild and no public exploit code.","fix":"Upgrade ghtml to 2.0.0 or later.","what":"CVE-2024-37166 is a high-severity vulnerability in gurgunday ghtml, published on 10 Jun 2024."},"fix_prompt":"Check this codebase for CVE-2024-37166 and fix it if it is affected.\n\nWhat it is: CVE-2024-37166 is a high-severity vulnerability in gurgunday ghtml, published on 10 Jun 2024. \nExploitation: There is no known exploitation of CVE-2024-37166 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- ghtml (npm): affected all versions; fixed in 2.0.0\n- ghtml (npm): affected all versions; fixed in 2.0.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-2024-37166/ (Markdown: https://insights.sbomify.com/CVE-2024-37166/index.md)","id":"CVE-2024-37166","markdown":"https://insights.sbomify.com/CVE-2024-37166/index.md","name":"CVE-2024-37166","record":{"aliases":["GHSA-vvhj-v88f-5gxr"],"analysis":null,"analysis_generated_by":null,"assigner":"GitHub_M","cpe":[],"cvss":{"score":8.9,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L","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":"ghtml is software that uses tagged templates for template engine functionality. It is possible to introduce user-controlled JavaScript code and trigger a Cross-Site Scripting (XSS) vulnerability in some cases. Version 2.0.0 introduces changes to mitigate this issue. Version 2.0.0 contains updated documentation to clarify that while ghtml escapes characters with special meaning in HTML, it does not provide comprehensive protection against all types of XSS attacks in every scenario. This aligns with the approach taken by other template engines. Developers should be cautious and take additional measures to sanitize user input and prevent potential vulnerabilities. Additionally, the backtick character (`) is now also escaped to prevent the creation of strings in most cases where a malicious actor somehow gains the ability to write JavaScript. This does not provide comprehensive protection either.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"ghtml Cross-Site Scripting (XSS) vulnerability","id":"CVE-2024-37166","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":null,"year":"2024"},"n_packages":2,"n_references":2,"next":{"headline":"Tuleap has improper permissions of the backlog items","id":"CVE-2024-37167"},"packages":[{"ecosystem":"npm","fixed":["2.0.0"],"introduced":["0"],"last_affected":[],"package":"ghtml","purl":null,"source":"GHSA-vvhj-v88f-5gxr"},{"ecosystem":"npm","fixed":["2.0.0"],"introduced":["0"],"last_affected":[],"package":"ghtml","purl":"pkg:npm/ghtml","source":"GHSA-vvhj-v88f-5gxr"}],"prev":{"headline":"Discourse has an XSS via Onebox system","id":"CVE-2024-37165"},"products":["ghtml"],"published":"2024-06-10","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":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2024-08-02","vendors":["gurgunday"]},"summary":null,"url":"https://insights.sbomify.com/CVE-2024-37166/"}