CVE Catalog

CVE-2026-16231

HighCVSS 8.1
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.24%

15th percentile - higher than 15% of all known CVEs

Summary

hbs is an Express view engine wrapping Handlebars. Its registerAsyncHelper API bypasses Handlebars' automatic HTML escaping: an async helper returns an opaque placeholder during the first render pass, so the double-brace expression escapes only the placeholder, and after rendering hbs substitutes the placeholder with the raw callback return value without escaping it. An application passing attacker-influenced data into an async helper callback can have arbitrary HTML and JavaScript injected into the server-rendered page, resulting in stored or reflected XSS. Versions 2.1.0 through 4.2.1 are affected, fixed in 4.3.0.

Risk Assessment

An attacker could inject malicious scripts into server-rendered pages, potentially leading to data theft, session hijacking, or other XSS attacks.

Recommendation

Upgrade hbs to version 4.3.0 or later. If the application intentionally emits raw HTML from an async helper, explicitly use hbs.SafeString.

Related vulnerabilities

Original NVD description (English source)

hbs is an Express view engine that wraps Handlebars. Its registerAsyncHelper API bypasses Handlebars' automatic HTML escaping: an async helper returns an opaque placeholder during the first render pass, so the double-brace expression escapes only the placeholder, and after rendering hbs substitutes the placeholder with the raw callback return value without escaping it, across the cached, uncached, and layout render paths. An application that passes attacker-influenced data, for example user-supplied content from a database, into an async helper callback can therefore have arbitrary HTML and JavaScript injected into the server-rendered page, resulting in stored or reflected cross-site scripting. Versions 2.1.0 through 4.2.1 are affected, and the issue is fixed in 4.3.0, which HTML-escapes async helper output. Applications that intentionally emit raw HTML from an async helper can opt in explicitly with hbs.SafeString. Users should upgrade to 4.3.0.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS