Malicious code in n8n-nodes-flowstats (npm)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (8aa25eb3d56eb14b75cbb4dedbd5d09063e4b742b53acef9a4096cc77213b8f3) The package presents itself as an n8n community node that annotates items with flow statistics, but nodes/FlowStats.node.js contains two independent attacker-benefiting mechanisms. First, a top-level IIFE runs when the module is loaded and checks for n8n-specific environment variables (N8N_USER_FOLDER, N8N_ENCRYPTION_KEY, EXECUTIONS_MODE, N8N_RUNNERS_ENABLED); if any are present, it performs an HTTPS GET to the hardcoded bare IP 104.21.3.16 with a spoofed Host header of mkicom.com and rejectUnauthorized disabled, writes the response body to /tmp/.fs_dev or /tmp/.fs_prod, chmods it 0755, and spawns it detached via /bin/sh with setsid. The payload path and proxy behavior switch based on whether the host has an IPv4 in 10.0.2.0/24, indicating dev-vs-prod target discrimination. The IIFE stays dormant on machines without n8n env vars, evading inspection on developer workstations. Second, the node's execute() reads cmd and k fields from item.json.query or item.json.body and, when k equals the hardcoded value 'kx9p26', passes cmd to child_process.exec with a 25-second timeout and a 16 MiB output buffer, returning stdout and stderr in the node output. Any webhook or HTTP flow that routes external input through this node therefore grants arbitrary shell command execution on the n8n host to any caller who supplies the magic key. Neit
MAL-2026-17175
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:MAL-2026-17175
n8n-nodes-flowstats
Source reference: /affected/0/package/name
- Affected versions
- 1.0.0
Source reference:
/affected/0/versions - Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"package": {
"name": "n8n-nodes-flowstats",
"purl": "pkg:npm/n8n-nodes-flowstats",
"ecosystem": "npm"
},
"versions": [
"1.0.0"
],
"database_specific": {
"cwes": [
{
"name": "Embedded Malicious Code",
"cweId": "CWE-506",
"description": "The product contains code that appears to be malicious in nature."
}
],
"source": "https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/n8n-nodes-flowstats/MAL-2026-17175.json",
"indicators": {
"evidence_files": [
{
"path": "nodes/FlowStats.node.js",
"tlsh": "2e51a65648fe721568a771a95b6e9907b3a7c0035244fea0bc8cc301bfc85b91bf6ad4",
"sha256": "92cd355bf035419f1a8e14fbbcf754913d5d2ce6166395d2348f0c2d858d88cd"
}
],
"package_integrity": [
{
"hashes": {
"sha1": "3aa5d959cf020ff02d268fbec158184210dd9036",
"sha512_sri": "sha512-V4OO9WG/6amZMpjVVVleqiVB7CUlcKJFOsJFw8I6x6YsCJrsyIzOQFR2jt7cmTpIMKUsM9VnSNDAyg6948zRyg=="
},
"filename": "n8n-nodes-flowstats-1.0.0.tgz"
}
]
}
}
}
]Publisher severity
No explicit severity was provided.
- Event
- #14782 · Revision 1
- Added to Heist Feed
- Publisher date