CVE-2026-33938: Handlebars.js has JavaScript Injection via AST Type Confusion by tampering @partial-block
Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, the `@partial-block` special variable is stored in the template data context and is reachable and mutable from within a template via helpers that accept arbitrary objects. When a helper overwrites `@partial-block` with a crafted Handlebars AST, a subsequent invocation of `{{> @partial-block}}` compiles and executes that AST, enabling arbitrary JavaScript execution on the server. Version 4.7.9 fixes the issue. Some workarounds are available. First, use the runtime-only build (`require('handlebars/runtime')`). The `compile()` method is absent, eliminating the vulnerable fallback path. Second, audit registered helpers for any that write arbitrary values to context objects. Helpers should treat context data as read-only. Third, avoid registering helpers from third-party packages (such as `handlebars-helpers`) in contexts where templates or context data can be influenced by untrusted input.
Security readout for executives and security teams
Plain-English summary
Affected Handlebars.js applications may execute attacker-controlled JavaScript on the server when untrusted templates can interact with helpers that modify template data. Successful exploitation could compromise application data, integrity, and availability. Exploitation requires a particular template and helper configuration, but no authentication or user interaction is reflected in the CVSS assessment.
Executive priority
Prioritize rapid assessment of internet-facing or multi-tenant services that compile user-influenced templates. Patch confirmed reachable deployments promptly because successful exploitation enables server-side JavaScript execution. Systems using only trusted templates, safe helpers, or the runtime-only build have lower immediate exposure but should still be inventoried and verified.
Technical view
Handlebars.js 4.0.0 through 4.7.8 permits AST type confusion involving the mutable `@partial-block` data value. A helper capable of writing arbitrary objects can replace it with a crafted AST. Later partial-block rendering may compile and execute that AST as JavaScript. Version 4.7.9 removes the vulnerable behavior.
Likely exposure
Exposure is most likely in server-side applications using affected Handlebars.js versions that compile potentially untrusted templates and register helpers capable of modifying context data. Runtime-only deployments without `compile()` avoid the identified fallback path. Version presence alone does not prove practical exploitability; template trust boundaries and registered helpers determine reachability.
Exploitation context
The supplied record has a CVSS 3.1 score of 8.1 with network reachability, no required privileges, no user interaction, and high complexity. CISA KEV status is false, and the supplied sources do not establish active exploitation. Treat exploit activity as unconfirmed while prioritizing reachable server-side configurations.
Researcher notes
The critical reachability chain is affected version, attacker influence over template content or context, a helper permitting arbitrary context writes, mutation of `@partial-block`, and later partial invocation. High attack complexity reflects these prerequisites. The supplied material supports code-execution impact and a 4.7.9 fix, but does not establish public or in-the-wild exploitation.
Mitigation direction
Upgrade Handlebars.js to version 4.7.9 or later.
Use the runtime-only build when server-side template compilation is unnecessary.
Audit helpers and prevent them from writing arbitrary values into template context data.
Avoid third-party helpers where templates or context data may be attacker-influenced.
Review the vendor advisory and applicable platform-vendor guidance before deployment.
Validation and detection
Inventory direct and transitive Handlebars.js dependencies across production applications.
Confirm deployed versions are outside the affected 4.0.0 through 4.7.8 range.
Identify applications that compile templates influenced by untrusted users or data.
Review registered helpers for arbitrary writes to context objects.
Verify runtime-only deployments do not expose the `compile()` method.
Regression-test template rendering and helper behavior after remediation.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-843: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
5Timeline events
2ADP providers
9Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: pocAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-843 · source CWE mapping
Access of Resource Using Incompatible Type ('Type Confusion')
Access of Resource Using Incompatible Type ('Type Confusion') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection')
Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Improper Control of Generation of Code ('Code Injection')
Improper Control of Generation of Code ('Code Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.