LiveActive security incident?Get immediate response
CVE Record

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.

HighCVSS 8.1Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

Handlebars.js versions 4.0.0 through 4.7.8 can let a malicious template path turn server-side template rendering into JavaScript execution. The main business risk is compromise of systems that render attacker-influenced templates or data with unsafe helpers.

Executive priority

Prioritize remediation for internet-facing or multi-tenant services that render Handlebars templates. The severity is high because successful exploitation can execute server-side JavaScript, but the published scoring notes high attack complexity.

Technical view

The issue is AST type confusion around the mutable `@partial-block` template data value. If a helper writes a crafted Handlebars AST into that value, `{{> @partial-block}}` may compile and execute it. The fixed version is 4.7.9. CVSS is 8.1 high with high attack complexity.

Likely exposure

Exposure is most likely in Node.js or server-side applications using Handlebars.js 4.0.0 through 4.7.8 where templates, context data, or registered helpers can be influenced by untrusted input. Risk is higher when the full compiler is available rather than the runtime-only build.

Exploitation context

The source bundle does not show KEV listing or cited active exploitation. Exploitation appears conditional: an attacker needs a reachable rendering path, influence over template behavior or data, and a helper capable of overwriting arbitrary context values.

Researcher notes

Focus review on helper registration, data-frame mutation, and any code path invoking partial blocks after helper execution. The public description names CWE-843, CWE-917, and CWE-94. Do not assume exploitability without confirming attacker control over template data and helper behavior.

Mitigation direction

  • Upgrade Handlebars.js to version 4.7.9 or later.
  • Use `handlebars/runtime` where compilation is not required.
  • Audit helpers that write arbitrary values into context objects.
  • Treat template context data as read-only inside helpers.
  • Avoid third-party helpers in untrusted template or data paths.
  • Check vendor advisories for packaged platform fixes.

Validation and detection

  • Search lockfiles and SBOMs for Handlebars.js versions below 4.7.9.
  • Identify server-side rendering paths using Handlebars compilation.
  • Review registered helpers for context mutation behavior.
  • Confirm whether untrusted users influence templates or context data.
  • Verify patched Red Hat packages where applicable.
  • Regression-test template rendering after upgrade or runtime-only changes.
Prepared
Confidence
high
Sources
10

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.

Open ATT&CK lookup
cwe · low confidence lookup

CWE-917: 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.

Open ATT&CK lookup
cwe · medium confidence lookup

CWE-94: Code execution behavior lookup

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.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-33938 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.1 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

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.

ScoreVersionSeverityVectorExploitImpactSource
8.1CVSS 3.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H2.25.9GitHub_M
8.1CVSS 3.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H2.25.9redhat-SADP

Vulnerability scoring details

Base CVSS 3.1 score

8.1High
CVSS 3.1 vector shape for CVE-2026-33938Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. ADP timelineredhat-SADP

    Made public.

  3. CVE publishedCVE Program

    The CVE record was published.

  4. ADP timelineredhat-SADP

    Reported to Red Hat.

  5. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
other:ssvc
redhat-SADPhandlebars: Handlebars: Arbitrary code execution via @partial-block overwrite
other:Red Hat severity ratingcvssV3_1
  • 2026-03-27T22:02:58.504Z: Reported to Red Hat.
  • 2026-03-27T21:05:42.485Z: Made public.

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
handlebars-langhandlebars.js>= 4.0.0, < 4.7.9Listed
Weakness

CWE details

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.

CWE-917 · source CWE mapping

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.

CWE-94 · source CWE mapping

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.