CVE-2026-16231: hbs - Stored & Reflected Cross-Site Scripting
- Cve: CVE-2026-16231
- Name: hbs - Stored & Reflected Cross-Site Scripting
- 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.
- Impact: Attackers can inject arbitrary HTML and JavaScript, leading to stored or reflected cross-site scripting and client-side code execution.
- Remediation: Upgrade to version 4.3.0 or later which properly escapes async helper output.
- Vulnerability type: stored_xss
- Vulnerability impact: client_script_exec, stored_xss, reflected_xss
- Requirement type: none
- Labels source: projectdiscovery
- Severity: high
- Cvss score: 8.1
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
- Epss score: 0.00402
- Epss percentile: 0.35265
- Assignee: ce714d77-add3-4f53-aff5-83d477b104bb
- Published at: 2026-08-25T10:18:04Z
- Age in days: 91
- Modified at: 2026-10-06T22:10:00Z
- Patch available: yes
- References total: 2
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2026-16231
- Nvd status: analyzed
- Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
- Not known: requirements, hackerone
Cwe
| Id | Name |
|---|---|
| CWE-79 | Improper Neutralization of Input During Web Page Generation |
References
| Url | Source | Tags |
|---|---|---|
| https://cna.openjsf.org/security-advisories.html | nvd | Vendor Advisory |
| https://github.com/pillarjs/hbs/security/advisories/GHSA-rg36-rxv9-2m9q | nvd | Vendor Advisory |
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| hbs_project:hbs | >= 2.1.0, < 4.3.0 | no | nvd | /v1/products/hbs_project/hbs |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| pillarjs/hbs | security_advisory | yes | /v1/repositories/pillarjs/hbs |
Index
- Checked, none or zero: repositories, repositories high signal, packages
Exploitation
- Remote: yes
- Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, authentication required
- Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports, exposed hosts