T09 · Insecure Skill Coding Practices
- Location
n8n-cli.py:226- Finding
n8n API Key Exposed Through Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is not clearly malicious, but it can change live n8n workflows and expose credentials or operational data without enough safeguards.
Install only if you understand and control the n8n instance, URL, API key, backup directory, and webhook destination. Avoid using this against production workflows until schedule changes are fixed to preserve existing nodes, require confirmation, and make backups; use least-privilege API keys, prefer HTTPS, avoid putting secrets directly on the command line, and assume exported workflows and alert messages may contain sensitive business data.
n8n-cli.py:226n8n API Key Exposed Through Command-Line Arguments
n8n-cli.py:83API Credentials Can Be Sent to Unvalidated or Unencrypted Destinations
n8n-cli.py:190Raw Workflow Error Information Forwarded to an Unrestricted Webhook
n8n-cli.py:143Schedule Command Can Destructively Replace Existing Workflow Contents
The schedule command does not append or modify a trigger safely; it replaces the target workflow with a new definition containing only a Cron node and sets it active. This can destroy existing workflow logic and cause denial of service, loss of automation behavior, or unintended operational changes on the remote n8n instance.
The skill advertises capabilities that imply network access and writing backups/exports, but it does not declare any explicit tool scope or permission boundaries. This creates a least-privilege and transparency problem: an agent or user cannot clearly see what operations are expected, increasing the risk of overbroad execution or unintended data modification/exfiltration.
The skill promotes bulk import, backup/restore, scheduling, monitoring, and cross-system data transmission without any warning about operational impact, overwrite risk, sensitive-data handling, or the need for user confirmation. In this context, these actions could overwrite workflows, copy sensitive business data, or push information to external systems automatically, making accidental misuse materially more dangerous.
The instructions explicitly tell users to supply n8n API keys and webhook URLs, but they provide no guidance on secure storage, redaction, least privilege, or avoiding exposure in logs/history. Those credentials can grant workflow administration or message delivery capabilities, so leakage through shell history, screenshots, shared docs, or agent logs could lead to unauthorized access or data exfiltration.
The export command writes a full workflow backup to local disk without warning that workflows may include sensitive business logic, endpoints, and embedded configuration details. In shared systems or poorly protected directories, this can expose confidential automation data to other local users or through later file leakage.
This command performs an immediate remote update that overwrites workflow configuration without an explicit warning or confirmation. Because it alters active automation on a live n8n instance, accidental execution can break workflows or replace intended logic with an incomplete definition.
The monitoring command forwards workflow names and execution error messages to an external webhook without warning that operational data may leave the n8n environment. Error messages often contain URLs, identifiers, partial payloads, or other sensitive context, so this can become an unintended data exfiltration path.
The code sends aggregated execution failure details to a user-provided external webhook. In this skill context, workflows and errors may contain sensitive operational information, making this a genuine data-transmission risk if the webhook points to an untrusted or third-party endpoint.
content = f"⚠️ n8n工作流异常告警\n共发现{len(executions)}个失败任务:\n"
for exec in executions:
content += f"- 工作流:{exec['workflow']['name']}\n 错误:{exec['error']['message']}\n"
requests.post(args.webhook, json={"msgtype": "text", "text": {"content": content}})
print("✅ 告警已推送到企业微信")
except:
pass
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
content = f"⚠️ n8n工作流异常告警\n共发现{len(executions)}个失败任务:\n"
for exec in executions:
content += f"- 工作流:{exec['workflow']['name']}\n 错误:{exec['error']['message']}\n"
requests.post(args.webhook, json={"msgtype": "text", "text": {"content": content}})
print("✅ 告警已推送到企业微信")
except:
pass
The script's docstrings, help strings, template names, and console output are consistently hard-coded in Chinese, with no option to select another language. This creates a natural-language policy issue because the tool forces a specific locale on all users without opt-in or documented justification.
No suspicious patterns detected.