Skip to content
CVE-2026-106446 IBM QRadar · QRadar

Detect Handlebars AST Type Confusion JavaScript Injection (CVE-2026-106446) in IBM QRadar

Detects exploitation and presence of CVE-2026-106446, a critical (CVSS 9.8) JavaScript injection vulnerability in the Handlebars npm package (>= 4.0.0, <= 4.7.9). The flaw is an AST type-confusion bug in the compile() path that bypasses the earlier fix for CVE-2026-33937, allowing an attacker who controls template source to craft a Handlebars template whose abstract syntax tree is misinterpreted during code generation, resulting in arbitrary JavaScript execution inside the server-side Node.js process (CWE-94/CWE-843). Exploitation typically appears as anomalous template compilation driven by untrusted input, spawning of child processes from Node services, outbound connections from template-rendering workers, or the presence of vulnerable handlebars versions in installed dependencies. A PoC is public via GHSA-8r5x-fm3f-whwj. Remediation is upgrade to handlebars 4.7.10 or later.

MITRE ATT&CK

Tactic
Initial Access Execution

QRadar Detection Query

IBM QRadar (QRadar)
sql
-- df00tech DF00-6b9dc2ea5a · https://df00tech.com/detections/CVE-2026-106446 · licence: https://df00tech.com/detections/licence
SELECT QIDNAME(qid) AS event, "Parent Process Name" AS parent, "Process Name" AS child, "Command" AS command, sourceip, username, DATEFORMAT(starttime,'yyyy-MM-dd HH:mm:ss') AS when_time
FROM events
WHERE LOWER("Parent Process Name") LIKE '%node%'
AND (LOWER("Process Name") IN ('sh','bash','cmd.exe','powershell.exe','pwsh.exe','wscript.exe','cscript.exe','curl','wget','certutil.exe')
  OR LOWER("Command") LIKE '%child_process%'
  OR LOWER("Command") LIKE '%/bin/sh%'
  OR LOWER("Command") LIKE '%base64 -d%')
LAST 24 HOURS
high severity medium confidence

QRadar AQL query surfacing Node.js (Handlebars-hosting) parent processes spawning shell/scripting children, indicative of code injection exploitation.

Data Sources

Sysmon via WinCollectLinux auditd via DSMEDR

Required Tables

events

False Positives & Tuning

  • CI/CD build hosts compiling templates and invoking shells
  • Node orchestration tooling spawning child processes legitimately
  • Developer endpoints running npm test scripts
  • Automated deployment scripts

Other platforms for CVE-2026-106446


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 Install vulnerable Handlebars version

    Expected signal: npm install process events and a node_modules/handlebars directory with version 4.7.9 visible to software-inventory/SCA tooling.

  2. Test 2 Simulate template-injection command execution via Node child_process

    Expected signal: A node process spawning /bin/sh executing 'id', captured by auditd/EDR as a process-creation event.

  3. Test 3 Simulate Handlebars compile of attacker-controlled template

    Expected signal: node process loading the handlebars module, invoking compile(), and spawning a shell child writing a marker file.


Response Playbook

Triage

  1. Confirm whether the host runs a Node.js service that compiles Handlebars templates from untrusted input (user-supplied templates, CMS fields, email/report generators). Identify the exact service and listening port.
  2. Enumerate the installed handlebars version: run `npm ls handlebars` (and inspect nested node_modules) across the affected application; flag any version >= 4.0.0 and <= 4.7.9 as vulnerable.
  3. Review the detected child-process chain: determine the full command line of the shell/LOLBin spawned under the node parent and whether it corresponds to legitimate application behavior or attacker commands.
  4. Correlate the process event with inbound HTTP requests to the rendering endpoint around the same timestamp to identify the attacker-controlled template payload.

Containment

  1. Isolate the affected host or rendering worker from the network if attacker-controlled child-process execution is confirmed.
  2. Disable or rate-limit the template-rendering endpoint, or deploy a WAF rule blocking Handlebars control characters/payload patterns in untrusted template inputs until patched.
  3. Roll the Node service credentials, session secrets and any API keys reachable from the compromised process.

Evidence Collection

  1. Capture the full process tree, command lines, and environment of the node parent and all spawned children from EDR/Sysmon/auditd.
  2. Preserve application and web-server access logs showing the request that delivered the malicious template, including request body and source IP.
  3. Snapshot the node_modules/handlebars directory and package-lock.json to record the exact vulnerable version and dependency path.

Escalation Criteria

  • !Escalate to incident response if a child process executed attacker-controlled commands (reverse shell, data staging, credential access) rather than benign application activity.
  • !Escalate if the vulnerable service is internet-facing and processes untrusted template input, given the CVSS 9.8 unauthenticated RCE exposure.
  • !Escalate if evidence of lateral movement, persistence, or outbound C2 from the rendering host is observed following the template-injection event.

Investigation Guide

Forensic Artifacts

  • >node_modules/handlebars/package.json version field and package-lock.json dependency tree
  • >Process-creation records (Sysmon EID 1 / auditd execve) showing node spawning shell children
  • >Web/application access logs containing the malicious template payload
  • >Node application stdout/stderr and any crash or exception logs around the compile() call

Tuning Guidance

Baseline which Node services on each host legitimately spawn child processes (build/CI runners, PDF/image generators) and exclude those specific parent command lines or hosts. Prioritize alerts where the node parent command line references template/handlebars/render and where the child executes encoded, piped, or network-fetch commands. On developer and CI hosts, consider raising the threshold or scoping the rule to production application tiers only.


Hunting Queries

Hunts for any Node.js process spawning interactive shells across the environment to surface Handlebars (and other SSTI) exploitation beyond the alerting window.

Hunting — KQL
kql
// df00tech DF00-6b9dc2ea5a · https://df00tech.com/detections/CVE-2026-106446 · licence: https://df00tech.com/detections/licence
DeviceProcessEvents | where InitiatingProcessFileName in~ ("node","node.exe") | where FileName in~ ("sh","bash","cmd.exe","powershell.exe","pwsh.exe") | summarize count() by DeviceName, InitiatingProcessCommandLine, ProcessCommandLine, bin(Timestamp, 1h)
Hunting — SPL
spl
``` df00tech DF00-6b9dc2ea5a · https://df00tech.com/detections/CVE-2026-106446 · licence: https://df00tech.com/detections/licence ```
index=* sourcetype=*sysmon* parent_process="*node*" (process_name="sh" OR process_name="bash" OR process_name="powershell.exe" OR process_name="cmd.exe") | stats count by host, parent_process, process, user

Atomic Red Team Tests

Test 1 Install vulnerable Handlebars version
linux

Installs a vulnerable handlebars release (<= 4.7.9) to validate SCA/version-based detection of CVE-2026-106446.

Command

bash
mkdir -p /tmp/hb-cve && cd /tmp/hb-cve && npm init -y >/dev/null 2>&1 && npm install [email protected] >/dev/null 2>&1 && node -e "console.log('handlebars', require('/tmp/hb-cve/node_modules/handlebars/package.json').version)"

Cleanup

bash
rm -rf /tmp/hb-cve

Expected Telemetry

npm install process events and a node_modules/handlebars directory with version 4.7.9 visible to software-inventory/SCA tooling.

Expected Detection

SCA or version-inventory rule flags handlebars 4.7.9 as within the affected range >= 4.0.0, <= 4.7.9.

Test 2 Simulate template-injection command execution via Node child_process
linux

Simulates the post-injection behavior where a compiled Handlebars template triggers arbitrary JavaScript that shells out, producing the node-parent -> shell-child signal.

Command

bash
node -e "require('child_process').execSync('id > /tmp/hb_cve_poc.txt')"

Cleanup

bash
rm -f /tmp/hb_cve_poc.txt

Expected Telemetry

A node process spawning /bin/sh executing 'id', captured by auditd/EDR as a process-creation event.

Expected Detection

The EQL/KQL/Sysmon rules fire on node spawning a shell child executing a system command.

Test 3 Simulate Handlebars compile of attacker-controlled template
linux

Compiles a template string through Handlebars to exercise the compile() code path targeted by the AST type-confusion, optionally chained to command execution in a lab.

Command

bash
cd /tmp/hb-cve 2>/dev/null || (mkdir -p /tmp/hb-cve && cd /tmp/hb-cve && npm init -y >/dev/null 2>&1 && npm install [email protected] >/dev/null 2>&1); node -e "const H=require('/tmp/hb-cve/node_modules/handlebars'); const t=H.compile('{{this}}'); console.log(t({this:'compiled'})); require('child_process').execSync('echo hb-compile-poc > /tmp/hb_compile_poc.txt')"

Cleanup

bash
rm -f /tmp/hb_compile_poc.txt; rm -rf /tmp/hb-cve

Expected Telemetry

node process loading the handlebars module, invoking compile(), and spawning a shell child writing a marker file.

Expected Detection

Process-chain detections flag the node->shell spawn; SCA flags the vulnerable handlebars version loaded by the process.

Related Detections