# CVE-2024-37166: ghtml Cross-Site Scripting (XSS) vulnerability

- Severity: High 8.9 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.44%, higher than 39% of CVEs (2026-12-01)
- Published: 2024-06-10T21:29:28.578Z
- Modified: 2026-09-10T03:50:15.993Z
- Also known as: GHSA-vvhj-v88f-5gxr
- Weaknesses: CWE-79, CWE-80
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- gurgunday ghtml: < 2.0.0; before 2.0.0
- ghtml (npm): before 2.0.0

## Every score

- GitHub_M: CVSS:3.1 8.9 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L`
- GitHub: CVSS:3.1 8.9 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:L`

## References

- <https://github.com/gurgunday/ghtml/security/advisories/GHSA-vvhj-v88f-5gxr> (web)
- <https://github.com/gurgunday/ghtml/commit/df1ea50fe8968a766fd2b9379a8f9806375227f8> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-37166> (advisory)
- <https://github.com/gurgunday/ghtml> (package)

## Sources

- CVE List: [CVE-2024-37166](https://www.cve.org/CVERecord?id=CVE-2024-37166), CVE Terms of Use, modified 2024-08-02
- GitHub Advisory Database: [GHSA-vvhj-v88f-5gxr](https://github.com/advisories/GHSA-vvhj-v88f-5gxr), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-37166](https://nvd.nist.gov/vuln/detail/CVE-2024-37166), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-37166 · Whole record: https://cve.day/CVE-2024-37166.json · Rebuilt by cve.day 2026-11-25T22:58:41.656Z
