Back to skill

Security audit

n8n Workflow Management

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a legitimate n8n management helper, but its testing and credential-handling behavior can unintentionally affect production workflows or expose an API key if misconfigured.

Use this only with a trusted HTTPS n8n base URL and a narrowly scoped API key. Treat dry-run and test-suite commands as real workflow executions, preferably against staging workflows with test credentials, and manually confirm any create, activate, execute, or delete operation before running it on production automations.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/n8n_api.py:20
Finding

API Key Can Be Transmitted to an Untrusted or Insecure Endpoint

Content
View full analysis
Dict[str, Any]: """Make API request""" url = f"{self.base_url}/api/v1/{endpoint.lstrip('/')}" response = self.session.request(method, url, **kwargs) ``` ### Technical Analysis The client accepts `N8N_BASE_URL` directly from the environment and uses it as the destination for requests carrying the privileged `X-N8N-API-KEY` header. It does not verify that: - The URL uses HTTPS. - The hostname is an approved n8n server. - The URL does not contain embedded credentials. - The port is expected. - Redirects remain on the approved origin. - A base URL was provided at all. Consequently, a manipulated configuration can direct authenticated requests to an attacker-controlled server or transmit the API key over plaintext HTTP. The use of a session-level custom authentication header increases the risk that the header remains attached during redirected requests unless redirect destinations are explicitly restricted. ### Attack Path 1. An attacker, compromised deployment mechanism, or untrusted configuration source modifies `N8N_BASE_URL`. 2. The value is set to an attacker-controlled URL or a plaintext HTTP endpoint. 3. A user runs any command that communicates with n8n, such as `list-workflows`, `get-workflow`, or `exe ...[truncated 830 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/n8n_tester.py:194
Finding

Purported Dry Run Performs a Real Workflow Execution

Content
View full analysis
Dict: """Execute workflow with test data""" # Load test data if from file if test_data_file: with open(test_data_file, 'r') as f: test_data = json.load(f) print(f"Running workflow {workflow_id} with test data...") # Execute workflow execution_result = self.client.execute_workflow(workflow_id, data=test_data) ``` The related method in `scripts/n8n_api.py` also invokes the real execution endpoint: ```python def dry_run_workflow(self, workflow_id: str, test_data: Dict = None) -> Dict: """Test workflow execution with mock data (creates temp execution)""" # Execute workflow with test data and return results result = self.execute_workflow(workflow_id, data=test_data) return { 'execution_id': result.get('data', {}).get('executionId'), 'status': 'initiated', 'test_data': test_data } ``` The documented command is presented as dry-run testing: ```bash # Test with data python3 scripts/n8n_tester.py dry-run --id --data '{"email": "test@example.com"}' # Test with data file python3 scripts/n8n_tester.py dry-run --id --data-file test-data.json ``` ### Technical Analysis A dry run ordinarily implies simulation or execution with external side effects disabled. Here, both implementations call `execute_workflow()`, which sends a request to the actual workflow execution endpoint. There is no: - Mock-node execution mode. - Isolated sandbox. - Transaction rollback. - Side-effect suppressio ...[truncated 2122 chars]
Remediation
View remediation
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (37)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill description underrepresents analysis and optimization functions that inspect workflow structure, connections, and execution characteristics beyond basic management/debugging. While less severe than hidden destructive actions, undocumented analytical capabilities can still expose workflow internals, business logic, and operational metadata in ways users may not expect.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill description underrepresents analysis and optimization functions that inspect workflow structure, connections, and execution characteristics beyond basic management/debugging. While less severe than hidden destructive actions, undocumented analytical capabilities can still expose workflow internals, business logic, and operational metadata in ways users may not expect.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 69)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 80)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 81)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 86)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 92)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 97)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 98)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 138)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 141)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 146)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 152)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 155)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 184)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 291)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 298)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 301)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 326)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 336)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 339)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 342)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 516)May include surrounding context.

md
python3 scripts/n8n_api.py list-workflows --pretty

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
89% confidence
Finding

The documented DELETE /workflows/{id} operation can permanently remove automation logic if an attacker, misconfigured agent, or careless user supplies the wrong workflow ID. Because this skill is specifically for managing n8n automations, destructive parameter misuse is more dangerous than in a generic reference: deleting the wrong workflow can disrupt business processes, integrations, and operational continuity.

Content

Scanner excerpt · references/api.md (reported line 67)May include surrounding context.

Delete Workflow

text
DELETE /workflows/{id}

Executions

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
86% confidence
Finding

DELETE /executions/{id} enables removal of execution records based solely on an ID parameter, which can be abused to delete the wrong logs or intentionally erase operational history. While less severe than workflow deletion, it can still hinder incident response, auditing, debugging, and accountability for automation activity.

Content

Scanner excerpt · references/api.md (reported line 101)May include surrounding context.

Delete Execution

text
DELETE /executions/{id}

Manual Execution

Static analysis

No suspicious patterns detected.