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

High 8.1 Published Updated

Attacker can inject arbitrary HTML and JavaScript into server-rendered pages via async helper output bypassing escaping, affecting applications using hbs.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2026-16231?

CVE-2026-16231 is a high-severity cross-site scripting vulnerability in hbs, published on 25 Aug 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

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.

Weakness: CWE-79

Which versions are affected by CVE-2026-16231?

It affects 1 product.

Products include Hbs Project Hbs.

How do I fix CVE-2026-16231?

No fix has been published for CVE-2026-16231 yet. Limit exposure of the affected software until one is available.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-16231 being exploited?

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

Sources

Also known as GHSA-rg36-rxv9-2m9q.

Is CVE-2026-16231 in your software?

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

Check your SBOMs for free