CVE-2026-16231: hbs vulnerable to XSS via registerAsyncHelper output-escaping bypass

Published Aug 25, 2026
·
Updated

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.

Affected Software

2 affected components
hbs hbs>=2.1.0<=4.2.1
hbs hbs=4.3.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade hbs to a version that resolves this vulnerability.

    Fixed in 4.3.0

Event History

Aug 25, 2026
CVE Published
via MITRE·10:00 AM
Data Sourced
via MITRE·10:00 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:18 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed to exploitation?

Applications using hbs versions 2.1.0 through 4.2.1 are exposed if they pass attacker-influenced data, such as user-supplied database content, into a registerAsyncHelper callback whose output is rendered into a page.

2

Does exploitation require authentication or a special rendering path?

No authentication is required by the vulnerability itself, although exploitation requires a victim to view a rendered page containing attacker-controlled async-helper output. The escaping bypass occurs in cached, uncached, and layout render paths.

3

What should be done if an async helper intentionally returns HTML?

Upgrade to hbs 4.3.0, which HTML-escapes async helper output. Helpers that intentionally need to emit raw HTML must explicitly opt in by using hbs.SafeString.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203