Detect Handlebars AST Type Confusion JavaScript Injection (CVE-2026-106446) in Splunk
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
SPL Detection Query
``` df00tech DF00-6b9dc2ea5a · https://df00tech.com/detections/CVE-2026-106446 · licence: https://df00tech.com/detections/licence ```
index=* (sourcetype="linux:audit" OR sourcetype="WinEventLog:Microsoft-Windows-Sysmon/Operational" OR sourcetype="xmlwineventlog:microsoft-windows-sysmon/operational")
(parent_process="*node*" OR parent_process_name="node" OR parent_process_name="node.exe")
(process_name IN ("sh","bash","cmd.exe","powershell.exe","pwsh.exe","wscript.exe","cscript.exe","curl","wget","certutil.exe")
OR process="*child_process*" OR process="*/bin/sh*" OR process="*base64 -d*")
| stats count min(_time) as firstTime max(_time) as lastTime values(process) as command_lines by host, user, parent_process_name, process_name
| convert ctime(firstTime) ctime(lastTime)
| where count > 0
| sort - lastTime Correlates Sysmon/auditd process-creation events where a Node.js parent process (the typical Handlebars host) spawns shell or scripting children, indicating code execution via the AST type-confusion injection.
Data Sources
Required Sourcetypes
False Positives & Tuning
- CI/CD agents executing npm build scripts that compile templates and invoke shells
- Node-based deployment or orchestration tools spawning child processes by design
- Local developer machines running test suites
- Serverless/container init scripts launching Node then shelling out for setup
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.
- 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.
- 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.
- 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.
References (6)
- https://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-8r5x-fm3f-whwj
- https://nvd.nist.gov/vuln/detail/CVE-2026-106446
- https://github.com/handlebars-lang/handlebars.js/pull/2185
- https://github.com/handlebars-lang/handlebars.js/commit/703fdcc5fd6cc8d1cc0c33cc19de40c467c4b8d2
- https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.10
- https://github.com/advisories/GHSA-8r5x-fm3f-whwj
Response Playbook
Triage
- 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.
- 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.
- 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.
- Correlate the process event with inbound HTTP requests to the rendering endpoint around the same timestamp to identify the attacker-controlled template payload.
Containment
- Isolate the affected host or rendering worker from the network if attacker-controlled child-process execution is confirmed.
- 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.
- Roll the Node service credentials, session secrets and any API keys reachable from the compromised process.
Evidence Collection
- Capture the full process tree, command lines, and environment of the node parent and all spawned children from EDR/Sysmon/auditd.
- Preserve application and web-server access logs showing the request that delivered the malicious template, including request body and source IP.
- 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.
// 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) ``` 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
Installs a vulnerable handlebars release (<= 4.7.9) to validate SCA/version-based detection of CVE-2026-106446.
Command
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
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.
Simulates the post-injection behavior where a compiled Handlebars template triggers arbitrary JavaScript that shells out, producing the node-parent -> shell-child signal.
Command
node -e "require('child_process').execSync('id > /tmp/hb_cve_poc.txt')" Cleanup
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.
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
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
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.