Back to skill

Security audit

n8n Builder

Security checks for vulnerabilities and agentic risk

Overview

This skill is coherent for building n8n workflows, but it grants broad live control over an n8n instance and handles the API key without enough guardrails.

Review this skill before installing. Use a narrowly scoped n8n API key, set N8N_URL only to the intended trusted HTTPS n8n instance, and require explicit user approval before create, update, activate, execute, delete, or credentials commands. Treat generated workflows as live automations that may move data between connected services.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/n8n-api.sh:6
Finding

API Key Can Be Transmitted to an Unrestricted or Cleartext Endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/n8n-api.sh, lines 6–14 and 37–72
Vulnerability Type: Unvalidated destination for privileged API credentials
Risk Level: High

Vulnerable Code

bash
N8N_URL="${N8N_URL:-http://localhost:5678}"
N8N_API_KEY="${N8N_API_KEY:-}"

if [ -z "$N8N_API_KEY" ]; then
  echo "ERROR: N8N_API_KEY not set" >&2; exit 1
fi

AUTH_HEADER="X-N8N-API-KEY: $N8N_API_KEY"
BASE="$N8N_URL/api/v1"

The credential-bearing header and unvalidated base URL are then used by every supported operation:

bash
case "${1:-}" in
  list)
    curl -s -H "$AUTH_HEADER" "$BASE/workflows" | jq .
    ;;
  get)
    curl -s -H "$AUTH_HEADER" "$BASE/workflows/$2" | jq .
    ;;
  create)
    curl -s -X POST -H "$AUTH_HEADER" -H "Content-Type: application/json" \
      -d @"$2" "$BASE/workflows" | jq .
    ;;
  create-stdin)
    curl -s -X POST -H "$AUTH_HEADER" -H "Content-Type: application/json" \
      -d @- "$BASE/workflows" | jq .
    ;;
  update)
    curl -s -X PUT -H "$AUTH_HEADER" -H "Content-Type: application/json" \
      -d @"$3" "$BASE/workflows/$2" | jq .
    ;;
  activate)
    curl -s -X POST -H "$AUTH_HEADER" -H "Content-Type: application/json" \
      -d '{"active": true}' "$BASE/workflows/$2/activate" | jq .
    ;;
  deactivate)
    curl -s -X POST -H "$AUTH_HEADER" -H "Content-Type: application/json" \
      -d '{"active": false}' "$BASE/workflows/$2/deactivate" | jq .
    ;;
  delete)
    curl -s -X DELETE -H "$AUTH_HEADER" "$BASE/workflows/$2" | jq .
    ;;
  execute)
    curl -s -X POST -H "$AUTH_HEADER" "$BASE/workflows/$2/run" | jq .
    ;;
  tags)
    curl -s -H "$AUTH_HEADER" "$BASE/tags" | jq .
    ;;
  credentials)
    curl -s -H "$AUTH_HEADER" "$BASE/credentials" | jq .
    ;;
esac

Technical Analysis

N8N_URL is read directly from the environment and used as the destination for request ...[truncated 2410 chars]

Remediation
View remediation

Remediation Suggestions

  1. Parse and validate N8N_URL before constructing any authenticated request.
  2. Require https:// for all non-loopback destinations. Permit http:// only for explicit loopback hosts such as localhost, 127.0.0.1, or [::1].
  3. Reject malformed URLs, embedded credentials, unexpected schemes, fragments, and unapproved ports.
  4. Where deployment topology permits, enforce an explicit hostname or origin allowlist for the intended n8n instance.
  5. Configure curl to reject protocol downgrades and fail reliably, for example with --fail-with-body, --show-error, and --proto '=https' for remote endpoints.
  6. Avoid automatically following redirects. If redirects are ever enabled, ensure the API key cannot be forwarded to a different origin.
  7. Use an n8n API key restricted to only the operations required by the Skill rather than a workspace-wide administrative credential.
  8. Store the key in an appropriately protected secret store, rotate it after suspected disclosure, and avoid exposing the process environment to untrusted users.
  9. Consider pinning a private certificate authority or server certificate where the n8n instance uses an internal PKI.
  10. Add automated tests confirming that arbitrary hosts, cleartext remote URLs, and malformed destinations are rejected before any credential-bearing request is made.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (30)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

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
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
3. **Deploy via API** — Use `scripts/n8n-api.sh create <file>` or pipe JSON to `scripts/n8n-api.sh create-stdin`.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill exposes shell-based operational capability through referenced scripts but does not declare any explicit tool scope or permission boundary. That makes it easier for an agent to invoke impactful commands without clear policy constraints, increasing the risk of unintended workflow creation, modification, activation, or deletion on the connected n8n instance.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill description is broad enough to match many generic automation or integration requests, which can cause over-activation in situations where the user did not intend to authorize n8n API operations. In a skill that can deploy and manage remote workflows, ambiguous trigger boundaries materially raise the chance of unintended high-impact actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instructions directly tell the agent to create, activate, execute, deactivate, and delete workflows through the API without any warning, approval step, or safety gate for side effects. Because these actions modify a live automation platform and can trigger external systems, the omission can lead to accidental service disruption, data changes, message sending, or unintended execution of connected credentials.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/workflow-patterns.md (reported line 77)May include surrounding context.

md
"typeVersion": 4.2,
      "position": [450, 300],
      "parameters": {
        "url": "https://api.example.com/data",
        "method": "GET"
      }
    },

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/workflow-patterns.md (reported line 298)May include surrounding context.

md
"typeVersion": 4.2,
      "position": [450, 300],
      "parameters": {
        "url": "https://api.example.com/data",
        "method": "GET"
      }
    },

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The AI agent example forwards webhook-supplied message content to an external OpenAI service without any disclosure, filtering, or data-classification guidance. In an automation-building skill, users may copy this pattern directly and inadvertently send sensitive customer or internal content to a third-party LLM processor.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file includes a workflow pattern that reads lead data from a database, transforms personal fields such as full name and phone number, appends them to Google Sheets, and posts a Slack notification. The surrounding description presents the pattern as a generic example but does not warn that it moves potentially sensitive data across systems, which is the kind of behavior the markdown warning rule covers.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script includes a credentials command that enumerates n8n credentials, which exceeds the declared workflow-building/management scope and exposes a sensitive administrative capability. In an agent skill context, this broadens what the skill can access and return to a user, potentially disclosing integration names, metadata, or other sensitive information that can aid further compromise.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/n8n-api.sh (reported line 43)May include surrounding context.

sh
curl -s -H "$AUTH_HEADER" "$BASE/workflows/$2" | jq .
    ;;
  create)
    curl -s -X POST -H "$AUTH_HEADER" -H "Content-Type: application/json" \
      -d @"$2" "$BASE/workflows" | jq .
    ;;
  create-stdin)

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/n8n-api.sh (reported line 47)May include surrounding context.

sh
curl -s -H "$AUTH_HEADER" "$BASE/workflows/$2" | jq .
    ;;
  create)
    curl -s -X POST -H "$AUTH_HEADER" -H "Content-Type: application/json" \
      -d @"$2" "$BASE/workflows" | jq .
    ;;
  create-stdin)

Static analysis

No suspicious patterns detected.