LiveActive security incident?Get immediate response
CVE Record

CVE-2026-33937: Handlebars.js has JavaScript Injection via AST Type Confusion

Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, `Handlebars.compile()` accepts a pre-parsed AST object in addition to a template string. The `value` field of a `NumberLiteral` AST node is emitted directly into the generated JavaScript without quoting or sanitization. An attacker who can supply a crafted AST to `compile()` can therefore inject and execute arbitrary JavaScript, leading to Remote Code Execution on the server. Version 4.7.9 fixes the issue. Some workarounds are available. Validate input type before calling `Handlebars.compile()`; ensure the argument is always a `string`, never a plain object or JSON-deserialized value. Use the Handlebars runtime-only build (`handlebars/runtime`) on the server if templates are pre-compiled at build time; `compile()` will be unavailable.

CriticalCVSS 9.8Not KEV-listedUpdated
Glexia's TakeAutomated analysiscritical

Security readout for executives and security teams

Plain-English summary

A flaw in Handlebars.js can let an attacker run arbitrary code on a server when an application passes attacker-controlled, pre-parsed template objects into Handlebars.compile(). Ordinary template strings alone do not establish exposure. Successful exploitation could compromise data, alter systems, or disrupt service.

Executive priority

Treat exposed server-side compilation paths as an immediate remediation priority because impact can include full application compromise. Rapidly determine whether untrusted objects reach compile(); upgrade regardless where affected versions are deployed. Prioritize internet-facing and sensitive systems first.

Technical view

Handlebars.js 4.0.0 through 4.7.8 accepts AST objects in compile(). A crafted NumberLiteral node can place its value directly into generated JavaScript without quoting or sanitization, causing JavaScript injection and potential server-side remote code execution. Version 4.7.9 fixes the issue.

Likely exposure

Highest risk applies to server applications using affected Handlebars versions where untrusted plain objects, JSON-deserialized data, or attacker-influenced ASTs can reach compile(). Deployments compiling only trusted strings, or using the runtime-only build with precompiled templates, are less likely to expose the vulnerable path.

Exploitation context

The supplied CVSS score is 9.8, reflecting potentially unauthenticated, network-reachable code execution with low complexity. However, exploitation requires control over an AST object passed to compile(). The bundle marks KEV false and provides no evidence of active exploitation.

Researcher notes

The defect is AST type confusion leading to code injection: NumberLiteral.value is emitted into generated JavaScript without safe quoting. Analysis should focus on data flow into compile(), especially object inputs reconstructed from JSON. The sources establish the vulnerable mechanism and fixed release, but do not establish public or active exploitation.

Mitigation direction

  • Upgrade Handlebars.js to version 4.7.9 or later.
  • Require every argument passed to Handlebars.compile() to be a string.
  • Reject plain objects and JSON-deserialized values before template compilation.
  • Use handlebars/runtime when templates are precompiled during builds.

Validation and detection

  • Inventory direct and transitive Handlebars.js versions in server deployments.
  • Identify every server-side call to Handlebars.compile().
  • Trace whether untrusted data can control compile() arguments.
  • Confirm runtime protections reject all non-string compile() inputs.
  • Verify production uses version 4.7.9 or later.
Prepared
Confidence
high
Sources
4

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 · 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
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-33937 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
Critical
CVSS
9.8 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/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: yesTechnical 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
9.8CVSS 3.1CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H3.95.9GitHub_M
9.8CVSS 3.1CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H3.95.9redhat-SADP

Vulnerability scoring details

Base CVSS 3.1 score

9.8Critical
CVSS 3.1 vector shape for CVE-2026-33937Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/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.js: Handlebars: Remote Code Execution via crafted Abstract Syntax Tree object in compile()
other:Red Hat severity ratingcvssV3_1
  • 2026-03-27T22:02:50.619Z: Reported to Red Hat.
  • 2026-03-27T21:03:46.748Z: 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-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.