T09 · Insecure Skill Coding Practices
- Location
SKILL.md:527- Finding
Webhook-Controlled Command Injection in n8n Workflow
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 527–529
Vulnerability Type: OS command injection through unsafe template interpolation
Risk Level: HighVulnerable Code
yaml - convert_model: node: Execute Command command: | "C:\DDC\RvtExporter.exe" "{{$json.model_path}}" complete bbox scheduleTechnical Analysis
The n8n workflow receives requests through the
/qto-extractwebhook and directly interpolates the request-controlledmodel_pathvalue into a command executed by a shell. Surrounding the value with double quotes does not provide adequate protection: an attacker may inject a closing quote and shell control characters, causing the shell to interpret additional commands.The documented workflow does not authenticate the webhook, canonicalize the supplied path, enforce an approved model directory, restrict the filename extension, reject shell metacharacters, or pass the converter arguments through a non-shell process API.
Attack Path
- An attacker sends a request to the
/qto-extractwebhook. - The request places a malicious string in
model_path, containing a closing quote followed by shell command syntax. - n8n substitutes the value into the
Execute Commandnode. - The operating-system shell parses both the intended converter invocation and the injected command.
- The injected command executes with the privileges of the n8n service account.
Impact Assessment
Successful exploitation permits arbitrary command execution under the n8n process identity. Depending on that account's permissions, an attacker could read or alter BIM models and reports, access other files available to the service, execute programs, manipulate workflow data, or use the host as a foothold for further compromise. The scope is not necessarily administrative, but it includes all resources available to the n8n service account.
- An attacker sends a request to the
- Remediation
View remediation
Remediation Suggestions
- Do not interpolate webhook input into an
Execute Commandshell string. - Invoke the converter through a process API or dedicated n8n integration that passes executable arguments as a structured array without a shell.
- Canonicalize the requested path and verify that it remains under a dedicated, approved model directory.
- Enforce a strict extension allowlist, such as
.rvt, and reject unexpected control characters, quotes, separators, and null bytes. - Require authentication and authorization for the webhook.
- Run n8n and the converter under a dedicated least-privileged service account.
- Restrict filesystem access to the model input and report output directories.
- Record and monitor rejected paths and converter executions.
- If shell execution cannot be eliminated, use platform-appropriate robust escaping in addition to the allowlist and directory checks; escaping alone should not be the primary defense.
- Do not interpolate webhook input into an
