Handlebars AST Type Confusion JavaScript Injection (CVE-2026-106446)
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.
Vulnerability Intelligence
Public PoCAffected Software
- Vendor
- npm
- Product
- handlebars
- Versions
- >= 4.0.0, <= 4.7.9
Timeline
- Disclosed
- October 8, 2026
References & Proof of Concept
- PoChttps://github.com/advisories/GHSA-8r5x-fm3f-whwj
- 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
CVSS
- Attack Vector
- Network
- Attack Complexity
- Low
- Privileges Required
- None
- User Interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
What is CVE-2026-106446 Handlebars AST Type Confusion JavaScript Injection (CVE-2026-106446)?
Handlebars AST Type Confusion JavaScript Injection (CVE-2026-106446) (CVE-2026-106446) maps to the Initial Access and Execution tactics — the adversary is trying to get into your network in MITRE ATT&CK.
This page provides production-ready detection logic for Handlebars AST Type Confusion JavaScript Injection (CVE-2026-106446), covering the data sources and telemetry it touches: Microsoft Defender for Endpoint, DeviceProcessEvents. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Initial Access Execution
// df00tech DF00-6b9dc2ea5a · https://df00tech.com/detections/CVE-2026-106446 · licence: https://df00tech.com/detections/licence
// Detect Node.js / Handlebars template-rendering processes spawning child processes (post-exploitation of SSTI/code injection)
let renderProcs = dynamic(["node", "node.exe", "npm", "npm.cmd"]);
let suspiciousChildren = dynamic(["cmd.exe", "powershell.exe", "pwsh.exe", "bash", "sh", "wscript.exe", "cscript.exe", "certutil.exe", "curl", "wget"]);
DeviceProcessEvents
| where InitiatingProcessFileName in~ (renderProcs)
| where FileName in~ (suspiciousChildren)
| where InitiatingProcessCommandLine has_any ("handlebars", "template", "render", "compile", "view")
or ProcessCommandLine has_any ("child_process", "exec", "spawn", "/bin/sh", "base64")
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, InitiatingProcessParentFileName
| order by Timestamp desc Flags Node.js template-rendering processes (which commonly load Handlebars) spawning shell, scripting or LOLBin child processes — the primary post-exploitation signal for server-side template/code injection via CVE-2026-106446.
Data Sources
Required Tables
False Positives
- Legitimate Node.js build tooling or CI runners that spawn shell commands during template precompilation
- Server-side rendering frameworks that legitimately shell out to image/PDF generation utilities
- Developer workstations running npm scripts that invoke shells during local development
- Monitoring or deployment agents written in Node that intentionally spawn child processes
Query fingerprint DF00-6b9dc2ea5a · licence
Sigma logsource & community rules
The detection logic for Handlebars AST Type Confusion JavaScript Injection (CVE-2026-106446) (CVE-2026-106446) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for CVE-2026-106446
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
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.
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.
Related Detections
Tactic Hubs
Related Techniques
Same Tactic: Initial Access
Blog posts about this detection
Browse by tactic
- Reconnaissance TA0043
- Resource Development TA0042
- Initial Access TA0001
- Execution TA0002
- Persistence TA0003
- Privilege Escalation TA0004
- Stealth TA0005
- Defense Impairment TA0112
- Credential Access TA0006
- Discovery TA0007
- Lateral Movement TA0008
- Collection TA0009
- Command and Control TA0011
- Exfiltration TA0010
- Impact TA0040