Skip to main content

Handlebars CVE-2026-106444

| EUVDEUVD-2026-93974 MEDIUM
Improper Encoding or Escaping of Output (CWE-116)
2026-10-06 security-advisories@github.com GHSA-xw65-4hp5-5hc7
4.7
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

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

  1. Access
    Submit malicious template text to precompiler
  2. Delivery
    Embed crafted </script> breakout payload
  3. Exploit
    Inline script element terminated early
  4. Execution
    Victim browser parses injected markup
  5. Impact
    Execute attacker script in victim session

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding for downstream
Exploitation Conditions

Exploitation requires a specific, non-default integration: the application must (1) accept attacker-controlled Handlebars template text, (2) run Handlebars.precompile() on that untrusted text, and (3) embed the generated source directly inside an INLINE <script> element in an HTML page delivered to victims, who must then (4) load that page (UI:R). The description explicitly states ordinary server-side rendering and precompiled templates served as EXTERNAL JavaScript files are NOT affected - these are the common usage patterns, which is why real-world exposure is limited. Vulnerable versions are 4.0.0 through 4.7.9; 4.7.10 is fixed. The combination of untrusted-template precompilation into inline scripts plus required victim interaction are the primary limiting factors that keep practical risk well below a typical network XSS.

Impact

This is a genuine XSS/output-encoding flaw (CWE-116) but a comparatively low real-world priority, and the signals are consistent in pointing that way. The CVSS 3.1 vector (AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N, base 4.7, Medium) already encodes the key limiters: High attack complexity and required user interaction, reflecting that exploitation only occurs in a narrow, non-default integration pattern. No EPSS score was provided, so exploitation probability cannot be quantified; the CVE is not listed in CISA KEV and no public exploit code was supplied in the intelligence, so this is 'no public exploit identified at time of analysis.' The AC:H and the description's explicit carve-outs (ordinary server-side rendering and externally-served precompiled .js files are NOT affected) mean most Handlebars deployments are unaffected even though the library itself is extremely widespread - a classic case of a ubiquitous component with a tightly scoped vulnerable configuration. No conflicting signals were found between the vector and the description; both agree the issue is network-reachable but conditional and user-interaction-gated. Bottom line: patch in the normal maintenance cycle, prioritize only if your application precompiles untrusted template text into inline scripts.

Exploit ScenarioDerived

An application accepts user-supplied Handlebars template text, calls Handlebars.precompile() on it server-side, and inlines the generated JavaScript directly into an inline <script> element of a served HTML page. An attacker submits template text containing a '</script>' sequence followed by markup; when a victim loads the page, the injected delimiter closes the script element early and the attacker's trailing markup is parsed and executed in the victim's browser. No public exploit code was identified, and High attack complexity reflects the unusual integration required.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Oct 06, 2026

Handlebars (the handlebars.js npm package) versions 4.0.0 through 4.7.9 emit static template text into precompiled JavaScript without escaping sequences such as '</script>' or '<!--', so an application that precompiles attacker-controlled template text and inlines the generated source inside a <script> element can have that element terminated early and followed attacker markup parsed and executed - a cross-site scripting condition (CWE-116). Exploitation is narrow rather than universal: it requires the non-default pattern of running Handlebars.precompile() on untrusted template text and embedding the output directly in an inline script, plus a victim loading the resulting page (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N, 4.7); ordinary server-side rendering and precompiled templates served as external JavaScript files are explicitly unaffected. No public exploit code or confirmed active exploitation was identified at time of analysis, and the required user interaction and unusual integration keep practical risk below a typical network XSS. The issue is fixed in Handlebars 4.7.10.

RemediationAI

Vendor-released patch: upgrade Handlebars to version 4.7.10 or later, which is available from the v4.7.10 release tag (https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.10) and incorporates commit 609d1b11c833c9a3e00f56f2f34d22f425446725 / PR 2185, escaping script delimiters via safeJsonLiteral() so that '<' in generated string literals becomes \u003C. Full details are in GHSA-xw65-4hp5-5hc7. If immediate upgrade is not possible, the most effective compensating control is architectural: stop passing attacker-controllable text to Handlebars.precompile() and stop inlining precompiled output inside <script> elements - serve precompiled templates as external .js files instead, which the advisory states are not affected, at the cost of an extra HTTP request and cache-management overhead. Where inlining is unavoidable, HTML-escape the generated source before insertion (for example replacing '<' with '\u003C' or the equivalent entity in the emitted string literals) or sanitize and strictly validate untrusted template text before compilation, accepting that such filtering may break legitimate templates containing those characters. Deploying a Content-Security-Policy with script-src nonces/hashes on pages that embed precompiled templates reduces the impact of the injected markup, though it does not fix the underlying output-encoding flaw; a strict CSP may also require reworking existing inline script usage. Custom JavaScriptCompiler subclasses that write template-derived strings into generated code should likewise be changed to use this.quotedString(), as the updated compiler API documentation now instructs. No public exploit code or confirmed active exploitation was identified at time of analysis, so remediation can be scheduled with normal change-management rather than emergency timelines.

Affected VersionsENISA

handlebars.js 4.0.0, < 4.7.10

Affected Packages

npm handlebars fix: 4.7.10
euvd handlebars_js_4_0_0 fix: 4.7.10

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in npm, euvd

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

Technical ContextAI · show details

Handlebars is a widely used semantic templating library for JavaScript; its precompiler (lib/precompiler.js) and code generator (lib/handlebars/compiler/code-gen.js) transform templates into JavaScript source at build or runtime. The root cause is improper neutralization of special elements in output (CWE-116): the quotedString() function in code-gen.js escaped quotes, backslashes, control characters, and U+2028/U+2029, but did not escape the character sequences that HTML's 'restrictions for contents of script elements' treat as structural - specifically '<!--', '<script', and '</script'. Because the '<' of those sequences was written through verbatim into the generated string literal, a closing script delimiter contained in attacker-influenced template text could close the enclosing inline <script> element in the host HTML page, allowing subsequent attacker markup to be parsed as HTML and executed as script. The upstream fix commit 609d1b11c833c9a3e00f56f2f34d22f425446725 introduces a safeJsonLiteral() helper that wraps JSON.stringify with escaping of line separators, lone/paired UTF-16 surrogates, and script delimiters (replacing '<' with \u003C), adds a NEEDS_ESCAPING regex fast path for performance, and replaces several JSON.stringify() calls in javascript-compiler.js and precompiler.js with this.quotedString()/safeJsonLiteral() so that all names, strings, indentation options, and location metadata are emitted safely. The compiler is also affected through the JavaScriptCompiler extension API, and the patch updated docs/compiler-api.md to warn that custom compilers must use this.quotedString() rather than JSON.stringify when writing template-derived strings into generated code.

Know when JavaScript 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 (github) PRIMARY 4.7 MEDIUM
AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
vuln.today AI 4.7 MEDIUM

Attacker-supplied template is network-delivered (AV:N) but the rare inline-script precompile integration drives AC:H; no auth to submit (PR:N), victim must load the page (UI:R), and script injection crosses into the browser context (S:C, C:L/I:L).

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

Primary rating from Vendor (github).

CVSS VectorVendor: github

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

Lifecycle Timeline

2
Patch available
Oct 06, 2026 - 21:05 EUVD
CVE Published
Oct 06, 2026 - 20:17 cve.org
MEDIUM 4.7

DescriptionCVE.org

Handlebars provides the power necessary to let users build semantic templates. From 4.0.0 until 4.7.10, Handlebars.precompile() uses quotedString() in lib/handlebars/compiler/code-gen.js to emit static template text into generated JavaScript without escaping sequences that terminate an enclosing HTML script element. When an application precompiles attacker-controlled template text and embeds the generated source directly in an inline script element, a closing script delimiter can end the element and cause following attacker-controlled markup to be parsed and executed. Ordinary server-side rendering and precompiled templates served as external JavaScript files are not affected. This issue is fixed in version 4.7.10.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 3 npm packages depend on handlebars (1 direct, 2 indirect)

Ecosystem-wide dependent count for version 4.0.0.

Threat Intelligence Overview

EPSS Score
0.3%
Top 80% exploitable
Prevalence
High
Handlebars is a top-tier npm templating library with tens of millions of weekly installs
Threat Intel
1
1 sources
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub

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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

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

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2026-102827 CRITICAL POC
9.8 Sep 29

Command injection in simple-git, the Node.js library for running git commands and published on npm, affects all releases

CVE-2026-77615 HIGH POC
8.7 Sep 17

Stored DOM-based cross-site scripting in Paella Player's closed-caption rendering path (paella-core before 2.12.11) allo

CVE-2026-92776 HIGH POC
8.6 Sep 16

Authorization bypass in Wiki.js through 2.5.314 allows an authenticated user who has been granted access to at least one

CVE-2026-102826 HIGH POC
8.1 Sep 29

Untrusted git configuration includes reachable through simple-git before 4.0.0 let an attacker execute arbitrary command

CVE-2026-85715 HIGH POC
7.5 Sep 17

Improper memory allocation control in ExifReader before 4.41.1 allows remote attackers to exhaust heap memory and termin

CVE-2026-102278 HIGH POC
7.5 Sep 28

Deeply nested brace patterns cause unbounded recursion in the npm brace-expansion library, exhausting the native stack a

CVE-2026-102276 HIGH POC
7.5 Sep 28

Stack exhaustion in the npm library brace-expansion (all versions prior to 1.1.19, 2.1.5, 3.0.7, and 5.0.10) lets a craf

CVE-2026-92775 HIGH POC
7.1 Sep 16

Server-side request forgery in Wiki.js through 2.5.314 lets an authenticated user who holds page-editing permissions for

CVE-2026-101910 MEDIUM POC
6.9 Sep 28

The JavaScript library ip-address (npm) fails to treat the NAT64 local-use prefix 64:ff9b:1::/48 as private, so applicat

CVE-2026-101914 MEDIUM POC
6.5 Sep 28

Authorization bypass in the @grpc/grpc-js-xds package (the xDS/RBAC extension for @grpc/grpc-js) lets a request for one

CVE-2026-101912 MEDIUM POC
6.3 Sep 28

Cross-family subnet comparisons in the ip-address npm library (all versions before 10.7.1) can cause isInSubnet and isHo

CVE-2026-101911 MEDIUM POC
6.3 Sep 28

Denial of service in the ip-address JavaScript/npm library (all versions prior to 10.7.1) lets remote attackers stall or

Vendor StatusVendor

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