hbs vulnerable to XSS via registerAsyncHelper output-escaping bypass
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| hbs | hbs | 2.1.0 to before 4.3.0 | 4.3.0 | Patch available | CNA |
- hbs Vendorhbs Affected 2.1.0 to before 4.3.0 Fixed in 4.3.0 Patch available CNA
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:hbs_project:hbs:*:*:*:*:*:node.js:*:* | 2.1.0 to before 4.3.0 | Vulnerable | Hbs Project |
- cpe:2.3:a:hbs_project:hbs:*:*:*:*:*:node.js:*:* Versions 2.1.0 to before 4.3.0 Vulnerable ·Hbs Project
Remediation
- Fix · CNA hbs (hbs) Fixed in 4.3.0
Timeline
- 2026-10-02 Threatist record created from CVE-2026-16231
References
More hbs vulnerabilities
- TI-2026-59485 hbs vulnerable to Denial of Service via unhandled exception in async helper output escaping CVSS 3.1MEDIUM 5.9
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences