Back to skill

Security audit

N8n Automation Secure

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for n8n automation, but it asks users to trust powerful workflow API actions while its advertised security controls are mostly unenforced examples.

Review this skill before installing. Treat it as documentation and sample commands, not as an enforced secure n8n client. Use a narrowly scoped n8n API key, verify N8N_URL yourself, avoid storing keys in bashrc or config files, and do not rely on the advertised permission modes, confirmations, audit logs, or rate limits unless you implement and test those controls separately.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/validate-setup.sh:61
Finding

API Key Disclosure Caused by Fail-Open URL Validation

Content
View full analysis
/dev/null || echo "000") ``` ### Technical Analysis The URL validation is fail-open. When `N8N_URL` fails either validation check, `print_error` only increments the global error count. It does not terminate execution, clear the invalid value, or prevent `test_api_connectivity` from running. The second validation expression also matches the colon in every normal `https://` URL: ```bash [[ "$N8N_URL" =~ @|:|key|token|secret ]] ``` As a result, a legitimate HTTPS URL is reported as containing credentials, but the script still sends the request. More importantly, an attacker-controlled HTTPS URL that fails validation is also used by `curl`, with the sensitive `N8N_API_KEY` included in the `X-N8N-API-KEY` header. TLS protects the connection in transit but does ...[truncated 1653 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:124
Finding

Advertised Permission, Confirmation, Rate-Limiting, and Audit Controls Are Not Enforced

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:375
Finding

Documented Data Sanitizer Sends Sensitive Input Unchanged

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (27)

Instruction Override

High
Category
Prompt Injection
Confidence
90% confidence
Finding

This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Content

Scanner excerpt · CONTRIBUTING.md (reported line 35)May include surrounding context.

md
### What We Reject

- ❌ Features that bypass security validations
- ❌ Removal of audit logging
- ❌ Hardcoded credentials or URLs
- ❌ Weakening of permission systems

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- **Documentation:** `references/security.md` - Complete security guide

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · SECURITY.md (reported line 237)May include surrounding context.

process exits 3. Access Control: System-level permissions apply 4. Auditable: System logs show who set them

Best Practices:

bash
# ✅ GOOD: Set at system level
# /etc/environment
N8N_URL="https://your-n8n.com"
N8N_API_KEY="your-key"

# ✅ GOOD: Temporary for script execution
N8N_URL="..." N8N_API_KEY="..." ./script.sh

# ❌ BAD: In bashrc (compromised user = compromised keys)
echo 'export N8N_API_KEY="..."' >> ~/.bashrc

# ❌ BAD: In config file
# openclaw.json
{
  "env": {
    "N8N_API_KEY": "..."  # Vulnerable to file read attacks
  }
}

Key Rotation

Rotate API keys regularly:

  1. Generate new key in n8n
  2. Update environment variables
  3. Test with new key
  4. Revoke old key after 24 hours
bash
# Key rotation script
#!/bin/bash
OLD_KEY="$N8N_API_KEY"
NEW_KEY="$(openssl rand -hex 32)"

echo "Generating new key..."
echo "Update N8N with: $NEW_KEY"

echo "Testing new key..."
export N8N_API_KEY="$NEW_KEY"
curl -X GET "$N8N_URL/api/v1/workflows" \
  -H

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · references/security.md (reported line 124)May include surrounding context.

process exits 3. Access Control: System-level permissions apply 4. Auditable: System logs show who set them

Best Practices:

bash
# ✅ GOOD: Set at system level
# /etc/environment
N8N_URL="https://your-n8n.com"
N8N_API_KEY="your-key"

# ✅ GOOD: Temporary for script execution
N8N_URL="..." N8N_API_KEY="..." ./script.sh

# ❌ BAD: In bashrc (compromised user = compromised keys)
echo 'export N8N_API_KEY="..."' >> ~/.bashrc

# ❌ BAD: In config file
# openclaw.json
{
  "env": {
    "N8N_API_KEY": "..."  # Vulnerable to file read attacks
  }
}

Key Rotation

Rotate API keys regularly:

  1. Generate new key in n8n
  2. Update environment variables
  3. Test with new key
  4. Revoke old key after 24 hours
bash
# Key rotation script
#!/bin/bash
OLD_KEY="$N8N_API_KEY"
NEW_KEY="$(openssl rand -hex 32)"

echo "Generating new key..."
echo "Update N8N with: $NEW_KEY"

echo "Testing new key..."
export N8N_API_KEY="$NEW_KEY"
curl -X GET "$N8N_URL/api/v1/workflows" \
  -H

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document instructs the user to create a public repository and push an existing local codebase without any explicit review step for secrets, internal configuration, tokens, or other sensitive artifacts. In a skill that automates workflow tooling and may contain integrations, configs, or credentials-related material, this increases the risk of accidental public disclosure.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · CHANGELOG.md (reported line 64)May include surrounding context.

md
- ❌ No audit logging or tracking
- ❌ No rate limiting or abuse prevention
- ❌ No permission controls
- ❌ No confirmation for dangerous operations

**This secure version fixes ALL of those issues** with enterprise-grade security protections.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · README.md (reported line 21)May include surrounding context.

md
- ❌ No audit logging or tracking
- ❌ No rate limiting or abuse prevention
- ❌ No permission controls
- ❌ No confirmation for dangerous operations

**This secure version fixes ALL of those issues** with enterprise-grade security protections.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill documents shell-based execution paths (curl, bash scripts, environment manipulation) but does not declare an explicit tool scope such as permissions or allowed-tools at the skill level. That mismatch increases the chance an agent can invoke shell-capable behavior without clear policy enforcement, undermining the claimed security model.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
---
name: n8n-automation-secure
description: Secure n8n workflow automation integration for coding tasks. This skill implements enterprise-grade security with credential isolation, input validation, audit logging, rate limiting, and granular permissions. Use when building automated workflows, integrating n8n into development pipelines, executing existing workflows, modifying workflow configurations, or creating new automation solutions. Triggers on phrases like "create n8n workflow", "run n8n workflow", "integrate n8n", "automate with n8n", "modify n8n workflow", "execute workflow".
version: "1.0.0"
metadata:
  author: nelson-mazonzika

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough to activate on common workflow or automation requests, including execution and modification tasks. In a skill that can reach external systems and perform destructive actions, overbroad activation increases the chance of unintended invocation and unauthorized workflow operations.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
95% confidence
Finding

The skill recommends persisting N8N_API_KEY in ~/.bashrc or /etc/environment, which increases the exposure window of sensitive credentials and may leak them to other local users, backups, support bundles, or compromised shells. This directly conflicts with the skill's own claim that credentials should never be stored in config files.

Content

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

1. Configure Environment Variables

bash
# Add to ~/.bashrc or /etc/environment
export N8N_URL=""
export N8N_API_KEY=""

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · SKILL.md (reported line 188)May include surrounding context.

1. List Workflows

bash
curl -X GET "$N8N_URL/api/v1/workflows" \
  -H "X-N8N-API-KEY: $N8N_API_KEY" \
  -H "Content-Type: application/json"

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The provided validateN8NUrl example contradicts its own stated HTTPS support because url.includes(':') will reject every normal https:// URL. Broken validation like this often causes developers to disable checks or replace them ad hoc, which can lead to unsafe URL handling and weaker SSRF/credential-protection controls than intended.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · SKILL.md (reported line 359)May include surrounding context.

md
N8N_URL: ${{ secrets.N8N_URL }}
          N8N_API_KEY: ${{ secrets.N8N_API_KEY }}
        run: |
          curl -X POST "$N8N_URL/api/v1/workflows/${{ secrets.N8N_WORKFLOW_ID }}/executions" \
                -H "X-N8N-API-KEY: $N8N_API_KEY" \
                -H "Content-Type: application/json" \
                -d '{"data": {"contextData": {"commitSha": "${{ github.sha }}"}}}'

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 · SKILL.md (reported line 389)May include surrounding context.

md
sanitized_data = sanitize(data)
    
    # Execute
    response = requests.post(
        f'{N8N_URL}/api/v1/workflows/{workflow_id}/executions',
        headers={
            'X-N8N-API-KEY': N8N_API_KEY,

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The example sanitize function explicitly claims to remove sensitive data but returns the input unchanged. This creates a dangerous false sense of protection, making it likely that secrets, tokens, or other sensitive workflow data will be transmitted or logged without redaction.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/security.md (reported line 73)May include surrounding context.

md
#### Vector 3: Workflow Tampering
**Attack:** Modify or delete workflows maliciously
**Mitigation:**
- Write operations require explicit confirmation
- Two-factor confirmation (display + type)
- Pre-change validation (show diff)
- Rollback capability (audit trail)

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The threat model promises explicit and two-factor confirmation for write operations, but the permission-check example implies a destructive action may proceed immediately after authorization. This gap between documented safeguards and example enforcement can lead implementers to omit confirmation on dangerous actions, increasing the risk of unauthorized or accidental tampering.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guide states readonly mode can execute workflows with confirmation, but the enforcement example omits execute from readonly permissions. This inconsistency can cause operators to misunderstand what readonly permits, leading to unsafe deployments or ad hoc permission changes that weaken security controls.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/validate-setup.sh (reported line 131)May include surrounding context.

sh
print_warning "Audit log directory does not exist: $AUDIT_LOG_DIR"
        print_info "Creating directory..."
        mkdir -p "$AUDIT_LOG_DIR"
        chmod 700 "$AUDIT_LOG_DIR"
        print_success "Created audit log directory"
    else
        print_success "Audit log directory exists"

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/validate-setup.sh (reported line 142)May include surrounding context.

sh
print_warning "Audit log directory does not exist: $AUDIT_LOG_DIR"
        print_info "Creating directory..."
        mkdir -p "$AUDIT_LOG_DIR"
        chmod 700 "$AUDIT_LOG_DIR"
        print_success "Created audit log directory"
    else
        print_success "Audit log directory exists"

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/security.md (reported line 349)May include surrounding context.

md
print_success "Audit log file has secure permissions (600)"
        else
            print_warning "Audit log file permissions: $perms (recommended: 600)"
            print_info "Fix with: chmod 600 $AUDIT_LOG"
        fi
    else
        print_warning "Audit log file does not exist: $AUDIT_LOG"

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/validate-setup.sh (reported line 165)May include surrounding context.

sh
print_success "Audit log file has secure permissions (600)"
        else
            print_warning "Audit log file permissions: $perms (recommended: 600)"
            print_info "Fix with: chmod 600 $AUDIT_LOG"
        fi
    else
        print_warning "Audit log file does not exist: $AUDIT_LOG"

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/validate-setup.sh (reported line 171)May include surrounding context.

sh
print_success "Audit log file has secure permissions (600)"
        else
            print_warning "Audit log file permissions: $perms (recommended: 600)"
            print_info "Fix with: chmod 600 $AUDIT_LOG"
        fi
    else
        print_warning "Audit log file does not exist: $AUDIT_LOG"