Detect CVE-2026-54051: network-ai npm Package OS Command Injection in Elastic Security
Detects exploitation of CVE-2026-54051, a critical OS command injection vulnerability (CWE-78) in the npm package 'network-ai' versions prior to 5.9.1. Improper neutralization of special elements allows attackers to inject arbitrary OS commands through the package's API, potentially leading to full system compromise. A public PoC is available.
MITRE ATT&CK
Elastic Detection Query
sequence by host.id with maxspan=30s
[process where event.type == "start"
and (process.parent.name in ("node", "node.exe") or process.parent.command_line like~ "*network-ai*")
and process.name in ("sh", "bash", "dash", "zsh", "cmd.exe", "powershell.exe", "ksh")]
[process where event.type == "start"
and (process.command_line like~ "*whoami*" or process.command_line like~ "*id *" or
process.command_line like~ "*/etc/passwd*" or process.command_line like~ "*net user*" or
process.command_line like~ "*curl *" or process.command_line like~ "*wget *" or
process.command_line like~ "*nc *" or process.command_line like~ "*python*")] EQL sequence rule detecting Node.js spawning a shell immediately followed by reconnaissance or exfiltration commands, consistent with CVE-2026-54051 exploitation.
Data Sources
Required Tables
False Positives & Tuning
- Automated deployment scripts running shell commands through Node.js processes
- Security scanning tools built on Node.js that perform system enumeration
- Penetration testing tooling operating in authorized environments
- Monitoring agents that collect system information via Node.js shell wrappers
Other platforms for CVE-2026-54051
Testing Methodology
Validate this detection against 4 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 available with Pro.
- Test 1CVE-2026-54051 Basic Command Injection via network-ai
Expected signal: Process creation event: node spawns sh or bash child process with command line containing 'whoami'; file creation event for /tmp/cve_2026_54051_poc.txt
- Test 2CVE-2026-54051 Reverse Shell Injection Simulation
Expected signal: Process creation: node → bash with command containing /dev/tcp; network connection event from bash process to 127.0.0.1:4444
- Test 3CVE-2026-54051 Persistence via Cron Injection
Expected signal: Process creation: node → sh → crontab with new entry; crontab file modification event; subsequent periodic execution of /tmp/beacon.sh if not cleaned up
- Test 4CVE-2026-54051 Credential Harvesting via /etc/passwd Read
Expected signal: Process creation: node → sh with 'cat /etc/passwd' in command line; file read event on /etc/passwd by shell child process of Node.js; file creation of /tmp/passwd_exfil.txt
Unlock Pro Content
Get the full detection package for CVE-2026-54051 including response playbook, investigation guide, and atomic red team tests.