CVE-2026-33938
Grafana vulnerability analysis and mitigation

Overview

CVE-2026-33938 is a JavaScript injection vulnerability in Handlebars.js, described as "JavaScript Injection via AST Type Confusion by tampering @partial-block." It affects Handlebars npm package versions 4.0.0 through 4.7.8 (inclusive) and was disclosed on March 26, 2026, with a patch released the same day. The vulnerability carries a CVSS v3.1 base score of 8.1 (High) (Github Advisory, GitHub Advisory DB). Multiple IBM enterprise products that bundle Handlebars are also affected, including IBM App Connect Enterprise, IBM Cloud Pak for Integration, IBM API Connect, IBM Business Automation Manager Open Editions, IBM QRadar Suite Software, and others (IBM Advisory).

Technical details

The root cause is a combination of CWE-94 (Code Injection) and CWE-843 (Type Confusion). Handlebars stores the @partial-block special variable in a mutable template data frame accessible to helpers. Any registered helper that accepts an object reference and writes arbitrary properties to it — such as the merge helper from the popular handlebars-helpers npm package — can overwrite @partial-block with an attacker-controlled Handlebars AST object. When {{> @partial-block}} is subsequently evaluated, invokePartial receives the crafted object; because it is not a compiled function, the runtime falls back to dynamically compiling it via env.compile(). If the injected object is a well-formed Handlebars AST with a PathExpression whose depth field contains a JavaScript string payload (breaking out of the generated function call), arbitrary JavaScript executes in the server process (Github Advisory). The fix in commit 68d8df5 adds validateInputAst() to reject pre-parsed AST objects with non-integer depth values, non-array parts, or non-string part elements, and uses lookupOwnProperty() to prevent prototype-chain traversal when resolving @partial-block (Patch Commit).

Impact

Successful exploitation enables arbitrary JavaScript execution on the server running the Handlebars template engine, resulting in full compromise of confidentiality, integrity, and availability. An attacker can read sensitive server-side data, modify application state, or crash the Node.js process. In environments where Handlebars is embedded in larger platforms (e.g., IBM Cloud Pak, API Connect, QRadar), exploitation could serve as a foothold for lateral movement within enterprise infrastructure (Github Advisory, GitHub Advisory DB).

Exploitability

A working proof-of-concept (PoC) is publicly available in the official security advisory, demonstrating self-contained RCE by injecting a malicious Handlebars AST through the @partial-block mechanism (Github Advisory). Exploitation requires no authentication and no user interaction, but does require high attack complexity — specifically, the attacker must be able to influence template context data or leverage a registered helper (such as merge from handlebars-helpers) that writes to the data frame. The EPSS score is approximately 0.048% (15th percentile), and there is no evidence of in-the-wild exploitation or CISA KEV catalog listing as of the time of this report (GitHub Advisory DB). No threat actor attribution has been reported.

Exploitation steps

  1. Identify target: Locate a Node.js application using Handlebars npm versions 4.0.0–4.7.8 that also registers a helper capable of writing arbitrary values to context objects (e.g., the merge helper from handlebars-helpers).
  2. Craft malicious AST payload: Construct a JavaScript object representing a Handlebars Program AST node. Within a MustacheStatement, set the PathExpression.depth field to a string containing a JavaScript payload that breaks out of the generated function call, e.g.:
depth: "0])),function () { require('child_process').exec('id', console.log); }()));//"
  1. Inject via template context: Supply the malicious AST object as a value in the template rendering context (e.g., as payload in maliciousContext).
  2. Trigger @partial-block mutation: Use a template that calls the merge helper to overwrite @_parent.partial-block with the crafted AST object:
{{#*inline "myPartial"}}
  {{> @partial-block}}
{{/inline}}
{{#> myPartial}}
  {{merge @_parent partial-block=1}}
  {{merge @_parent partial-block=payload}}
{{/myPartial}}
  1. Trigger compilation and execution: When {{> @partial-block}} is evaluated, invokePartial receives the crafted AST object. The runtime, finding it is not a compiled function, calls env.compile() on it. The injected depth string breaks out of the generated JavaScript function, executing the attacker's payload in the server process (Github Advisory).

Indicators of compromise

  • Logs: Node.js application logs showing unexpected output from console.error or console.log containing strings like VULNERABLE: RCE via @partial-block; unhandled exceptions or stack traces originating from env.compile() or invokePartial with non-function arguments.
  • Process: Unusual child processes spawned by the Node.js server process (e.g., sh, bash, cmd.exe, curl, wget, python) that are not part of normal application behavior.
  • Network: Unexpected outbound connections from the Node.js server to external IPs, particularly shortly after template rendering requests; DNS lookups for attacker-controlled domains initiated by the server process.
  • File System: New or modified files in the application directory or /tmp created by the Node.js process owner; presence of web shells or reverse shell scripts dropped by the server process.
  • Application Behavior: Template rendering requests that include deeply nested partial block structures or context objects containing type: "Program" keys, which may indicate attempted AST injection.

Mitigation and workarounds

The primary remediation is to upgrade Handlebars to version 4.7.9, which validates pre-parsed AST inputs and uses lookupOwnProperty() to prevent @partial-block mutation (v4.7.9 Release, Patch Commit). If immediate upgrade is not possible, three workarounds are available: (1) use the runtime-only build (require('handlebars/runtime')), which lacks the compile() method and eliminates the vulnerable fallback path; (2) audit all registered helpers to ensure they treat context data as read-only and do not write arbitrary values to context objects; (3) avoid registering helpers from third-party packages such as handlebars-helpers in contexts where templates or context data can be influenced by untrusted input (Github Advisory). IBM has issued separate advisories for affected products including App Connect Enterprise, Cloud Pak for Integration, API Connect, Business Automation Manager Open Editions, QRadar Suite Software, and others, and customers should apply the relevant IBM iFixes (IBM Advisory).

Community reactions

IBM issued multiple security bulletins in April–June 2026 addressing CVE-2026-33938 across a broad range of enterprise products, indicating significant downstream impact of this supply-chain vulnerability (IBM Advisory). The vulnerability was noted on Bluesky by CVE tracking accounts shortly after disclosure, and security aggregators such as VulnDB and CVEFeed indexed it rapidly. No major independent researcher write-ups or significant social media controversy have been identified beyond standard advisory dissemination.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

node-handlebars

Affected

sid

node-handlebars: 3:4.7.9-1

Fixed

trixie

node-handlebars

Affected

Ubuntu

Unknown

bionic (esm-apps)

node-handlebars

Unknown

devel

node-handlebars

Unknown

focal (esm-apps)

node-handlebars

Unknown

jammy

node-handlebars

Unknown

jammy (esm-apps)

node-handlebars

Unknown

noble

node-handlebars

Unknown

noble (esm-apps)

node-handlebars

Unknown

resolute

node-handlebars

Unknown

RHEL / CentOS

Affected

OpenShift

openshift-logging/elasticsearch-operator-bundle

Affected

RHEL 8

389-ds:1.4/389-ds-base.src

Affected

RHEL 9

Not Affected

RHEL 10

Not Affected

SourceThis report was generated using AI

Related Grafana vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-6377HIGH7.5
  • Grafana logoGrafana
  • osbuild-composer.src
NoNoSep 07, 2026
CVE-2026-19534HIGH7.5
  • Grafana logoGrafana
  • nodejs:24::nodejs-packaging
NoYesSep 04, 2026
CVE-2026-84890MEDIUM5.9
  • Grafana logoGrafana
  • nodejs-docs
NoYesSep 04, 2026
CVE-2026-88015MEDIUM5.3
  • Grafana logoGrafana
  • container-tools:rhel8::conmon.src
NoNoSep 10, 2026
CVE-2026-18540LOW3.7
  • Grafana logoGrafana
  • ubi9::nodejs-24-minimal
NoYesSep 04, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management