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

High 8.9 Published Updated
Exploited in the wild
Not known
Fix
Available

What is CVE-2024-37166?

CVE-2024-37166 is a high-severity vulnerability in gurgunday ghtml, published on 10 Jun 2024.

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

Weakness: CWE-80, CWE-79

Which versions are affected by CVE-2024-37166?

2 open source packages ship an affected version, including ghtml.

PackageAffectedFixed in
ghtml npmAll versions2.0.0
ghtml npmAll versions2.0.0

How do I fix CVE-2024-37166?

Upgrade ghtml to 2.0.0 or later.

Is CVE-2024-37166 being exploited?

There is no known exploitation of CVE-2024-37166 in the wild and no public exploit code.

Sources

Also known as GHSA-vvhj-v88f-5gxr.

Is CVE-2024-37166 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free