logo

Database

N8n Execute Command In Use

Description

Detects when the published version of an n8n workflow has an Execute Command node, which runs shell commands on the n8n host with the permissions of the n8n process. When its command is built from an expression, whoever controls the data that reaches the workflow can choose the command the host runs, and with it read the instance's files and secrets or run any program the n8n user can run.

Weakness:

004 - Remote command execution

Category: Unexpected Injection

Detection Strategy

    • Lists every workflow the API key's user can see through the n8n public API, all of them for an owner or admin key, and reads only the version of each one that is published, skipping disabled nodes

    • Keeps the Execute Command nodes, and the Execute Command tools an AI agent can call

    • Reports a vulnerability when the workflow has one, whatever its command, and records in the evidence whether each command is fixed text or contains an expression in double braces; a workflow whose listing omits the published version field, or whose published version has no node list, is recorded as unreadable rather than reported as clean