Skip to main content

hbs CVE-2026-16231

| EUVDEUVD-2026-65392 HIGH
Cross-site Scripting (XSS) (CWE-79)
2026-08-25 openjs
8.1
CVSS 3.1 · Vendor: openjs
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Submit XSS payload via attacker-reachable input field
  2. Delivery
    Application stores raw payload in backend data store
  3. Exploit
    Victim browses page served by Express/hbs with async helper
  4. Install
    First render pass escapes only placeholder, not future payload
  5. C2
    Second-pass substitution inserts raw payload into HTML without escaping
  6. Execute
    Browser parses and executes injected JavaScript
  7. Impact
    Session or credential data exfiltrated to attacker

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target Express application calls hbs.registerAsyncHelper and that the async callback returns attacker-influenced data - such as user-submitted content retrieved from a database, request parameters, or any external input - without separately HTML-escaping it. Applications that do not use registerAsyncHelper at all, or that use hbs.SafeString exclusively with fully controlled server-side content, are not affected. A victim user must load the page where the async helper output appears (UI:R per CVSS), which is a standard prerequisite for stored or reflected XSS. The CVSS PR:N indicates no server-side authentication is required to deliver the injected payload, though the specific injection vector (e.g., a comment box, profile field) determines whether an account is needed to submit data. Limiting factors: non-default async helper usage is required (synchronous helpers are unaffected), impact is bounded to the browser/application session (S:U, no server OS compromise), and a victim page-load is required.

Impact

The CVSS 3.1 vector AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N and score of 8.1 accurately reflect a network-exploitable stored XSS with no authentication prerequisite and high impact on confidentiality (session theft) and integrity (arbitrary DOM manipulation), bounded by requiring a victim to load the affected page (UI:R). The AC:L rating is appropriate - once a payload is stored via any attacker-reachable input field rendered through an async helper, exploitation is deterministic. No EPSS data was provided, so exploitation probability cannot be quantified numerically. There is no CISA KEV listing, meaning active in-the-wild exploitation is not confirmed. No POC is referenced in the provided data; the attack surface is well-understood and exploitation would be straightforward for anyone aware of the bypass, making the window between disclosure and exploitation attempts potentially short. The S:U (unchanged scope) correctly limits impact to the browser/application session and not the server OS. Real-world risk is contingent on whether a given application actually uses registerAsyncHelper with user-controlled data - applications using only synchronous helpers are fully unaffected.

Exploit ScenarioDerived

An attacker submits a profile bio field containing a script tag (e.g., a cookie-stealing payload) to an Express application that stores bios in a database and renders them server-side via an async Handlebars helper that fetches and returns the stored value. When any other authenticated user visits the attacker's profile page, hbs substitutes the raw unescaped payload into the rendered HTML, the browser executes the script, and the victim's session token is exfiltrated. No POC is referenced in the available data, but the attack path is structurally straightforward given the confirmed escaping bypass.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 25, 2026

HTML escaping in the hbs Express/Handlebars view engine (versions 2.1.0-4.2.1) is bypassed by the registerAsyncHelper API, enabling stored or reflected cross-site scripting in any Express application that passes attacker-influenced data through an async helper callback. The two-pass rendering pipeline escapes only an opaque placeholder in the first pass, then silently substitutes the raw, unescaped callback return value, affecting cached, uncached, and layout render paths equally. No active exploitation has been confirmed in CISA KEV; the issue is fixed in hbs 4.3.0.

RemediationAI

Upgrade hbs to version 4.3.0, which HTML-escapes async helper output by default, closing the bypass at its root. This is the only confirmed vendor-released patch. Applications that intentionally emit trusted raw HTML from an async helper may explicitly opt in to unescaped output by wrapping the return value with hbs.SafeString - this should only be done for fully trusted, application-controlled content, never for user-supplied data. Advisory references: https://github.com/pillarjs/hbs/security/advisories/GHSA-rg36-rxv9-2m9q and https://cna.openjsf.org/security-advisories.html. If an immediate upgrade is blocked, a specific compensating control is to audit every registerAsyncHelper call and manually HTML-escape the callback return value using a library such as he (he.escape()) or the entities package before returning; this approach is error-prone and must be applied consistently across all async helpers, making it inferior to the upstream fix. There are no known side effects of upgrading to 4.3.0 beyond the intentional behavior change for raw HTML output, which is explicitly handled via the SafeString opt-in.

Affected VersionsENISA

hbs 2.1.0 <4.3.0

Affected Packages

euvd hbs fix: 4.3.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

hbs is a Node.js/Express view engine (CPE: cpe:2.3:a:hbs:hbs:*:*:*:*:*:*:*:*) that wraps the Handlebars.js templating library for server-side HTML rendering. Handlebars normally HTML-escapes values inside double-brace expressions automatically, but the registerAsyncHelper mechanism introduces a two-pass rendering model: during the synchronous first pass, Handlebars inserts an opaque placeholder string where the async result will go, and this placeholder is correctly escaped as it appears inside the double-brace context. After rendering completes, hbs performs a second-pass string substitution that replaces each placeholder with the actual async callback return value - but this substitution is done outside of Handlebars' escaping pipeline and applies no sanitization. The root cause (CWE-79: Improper Neutralization of Input During Web Page Generation) is architectural: the escaping contract of the template engine is broken at the async-callback boundary because HTML escaping and value injection are decoupled across the two passes.

Know when Hbs gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (openjs) PRIMARY 8.1 HIGH
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
vuln.today AI 8.1 HIGH

Network-delivered XSS with no auth needed to inject, victim page-load required (UI:R), session-scoped impact only (S:U), no availability impact.

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (openjs).

CVSS VectorVendor: openjs

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Lifecycle Timeline

2
Patch available
Aug 25, 2026 - 12:01 EUVD
CVE Published
Aug 25, 2026 - 10:00 cve.org
HIGH 8.1

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

hbs (Express/Handlebars template engine) versions 2.1.0-4.2.1 contain a critical cross-site scripting vulnerability that bypasses HTML escaping when user data flows through async helper functions. Organizations using vulnerable versions of hbs in Express applications face immediate risk of account compromise, data theft, and malicious script injection through application templates. Urgent upgrade to version 4.3.0 is required.

Business Impact: High
Compensating Controls

Vendor-released patch: hbs 4.3.0

Threat Intelligence Overview

EPSS Score
0.2%
Top 85% exploitable
Prevalence
Medium
popular npm view engine for Express/Handlebars server-side rendering
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

40
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +40
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy