---
id: CVE-2026-16231
title: hbs is an Express view engine that wraps Handlebars
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 esc…
severity: high
cvss: 8.1
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N'
cwe:
  - CWE-79
vendor: hbs_project
product: hbs
affected:
  - 'hbs >= 2.1.0, < 4.3.0'
patched:
  - hbs 4.3.0
published: '2026-08-25'
updated: '2026-09-28'
sourceUpdated: '2026-09-28T23:10:00.143'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-16231'
references:
  - url: 'https://cna.openjsf.org/security-advisories.html'
    label: ce714d77-add3-4f53-aff5-83d477b104bb
  - url: 'https://github.com/pillarjs/hbs/security/advisories/GHSA-rg36-rxv9-2m9q'
    label: ce714d77-add3-4f53-aff5-83d477b104bb
tags:
  - nvd
ingestedAt: '2026-09-28T23:23:00.545Z'
---

## Overview

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

- `hbs >= 2.1.0, < 4.3.0`

## Remediation

Upgrade past the affected range:

- `hbs 4.3.0`
