Back to skill

Security audit

n8n Workflow Engineering

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent n8n automation guidance skill, but users should review generated workflows carefully before enabling live emails, AI replies, or webhook security examples.

Installers should treat this as an automation design aid, not a deployment approval. Before activating generated workflows, review all outbound email or ticket replies, use sandbox credentials and recipient allowlists, validate webhook signatures with provider-specific code, confirm data retention and PII handling, and keep human approval for customer-facing AI responses unless explicitly risk-accepted.

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

Warning
Location
SKILL.md:783
Finding
Insecure Webhook HMAC Signature Verification## Vulnerability Details **File Location**: `SKILL.md`, lines 783–799 **Vulnerability Type**: Insecure webhook authentication implementation **Risk Level**: Medium ```javascript // HMAC signature verification (Stripe, GitHub, etc.) const crypto = require('crypto'); const signature = $request.headers['x-hub-signature-256']; const secret = $env.WEBHOOK_SECRET; const body = JSON.stringify($json); const expected = 'sha256=' + crypto .createHmac('sha256', secret) .update(body) .digest('hex'); if (signature !== expected) { // Return 401 via Respond to Webhook node return [{ json: { error: 'Invalid signature', _reject: true } }]; } return items; ``` ### Technical Analysis The example calculates the HMAC over `JSON.stringify($json)`, which serializes an already-parsed request object rather than authenticating the exact raw request bytes sent by the webhook provider. JSON parsing and reserialization can alter whitespace, property order, escaping, duplicate-key handling, Unicode representation, or number formatting. Because HMAC verification is byte-sensitive, these changes can cause the locally calculated digest to differ from the provider's valid signature. The code also compares attacker-controlled signature text using ordinary string inequality: ```javascript signature !== expected ``` This comparison is not guaranteed to be constant-time. Depending on the JavaScript runtime, surrounding infrastructure, network conditions, and number of available measurements, comparison timing can potentially reveal information about matching signature prefixes. Exploitability over a remote network may be limited by timing noise, but the pattern should not be presented as production-grade authentication. The example further describes one implementation as applicable to “Stripe, GitHub, etc.” while using GitHub's `x-hub-signature-256` format. Webhook providers use different headers, signed payload formats, time ...[truncated 2042 chars]
Remediation
## Remediation Suggestions 1. Capture and verify the exact raw request bytes before JSON parsing or transformation. Configure n8n or the upstream proxy to preserve the raw body in a byte buffer. 2. Use a provider-specific verification implementation or the provider's official SDK. Do not reuse GitHub's header format for Stripe or other services. 3. Parse and validate the signature header strictly, including the expected algorithm, encoding, and number of signature values. 4. Convert the supplied and calculated digests into buffers, confirm that their lengths are equal, and compare them with `crypto.timingSafeEqual`. 5. Where the provider includes a signed timestamp, enforce a narrow acceptance window and reject stale events to prevent replay. 6. Store processed provider event IDs and reject duplicates when the provider supplies stable event identifiers. 7. Return an explicit authentication failure without forwarding rejected items to downstream nodes. 8. Add tests using official provider fixtures, including raw bodies with alternate whitespace, Unicode, escaped characters, and reordered properties, to confirm that valid events pass and modified events fail. 9. Update the Skill documentation to explain that raw-body access and verification requirements differ among webhook providers.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Missing User Warnings

Medium
Confidence
83% confidence
Finding
The workflow templates include automatic outbound email behavior, including auto-replies to leads, without an explicit warning or approval checkpoint before contacting external recipients. In an agent-assisted context, this can normalize or encourage creation of workflows that send messages to real users, customers, or prospects based on generated logic, increasing the risk of spam, privacy mistakes, and unintended external actions.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The AI support ticket template includes a path to automatically send an LLM-generated response when a category and confidence threshold are met, but it does not include strong safeguards around hallucinations, prompt-injection in ticket content, or user approval before external reply. This is more dangerous in context because the skill is positioned as production-grade guidance, so users may implement automated customer-facing responses directly from the template.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The skill ends with very broad natural-language activation rules such as interpreting generic requests like 'Build a workflow' or 'Audit my n8n setup' as commands to generate complete automations. In an agent setting, this can over-trigger the skill on loosely related n8n conversations and cause the assistant to produce high-impact operational instructions without confirming scope, environment, or safety constraints.

Static analysis

No suspicious patterns detected.