When a penetration test of self-hosted n8n is worth scheduling
Schedule a penetration test when a self-hosted n8n instance holds live credentials and exposes webhook endpoints to the internet or partners, and when you need evidence that those controls work before production go-live or a customer security review. An internal audit tells you how the instance is configured. A penetration test tells you whether an attacker can get past that configuration, which is the question a CISO or customer assessor will ask. The built-in n8n audit command reviews unused credentials, SQL expressions open to injection, file system nodes, community nodes and unprotected webhooks, so run it first and fix what it reports. Testing after those fixes is what gives the test its value.
A test adds three things the audit cannot. First, it exercises behavior: whether editor and API authentication holds up, whether webhook URLs can be guessed or replayed, whether HTTP nodes can be pointed at internal addresses, and whether a Code node can reach environment variables or the host. Second, it covers the chain between components, such as a webhook that triggers a workflow that writes a credential into an outbound request. Third, it produces a findings report with severity, reproduction steps and retest results. Web scanning with OWASP ZAP, an open-source scanner, is useful for finding common web issues across the editor and webhook endpoints, and its Automation Framework can run on a schedule. It does not replace a tester who understands n8n's workflow model, so confirm with any provider whether their scope includes manual testing of n8n-specific features alongside automated scans.
Decide the timing and scope before you book the work. Schedule the test after any major version upgrade, after enabling queue mode or adding workers, and before a customer or regulator review. Confirm in writing which environment is in scope, whether a staging copy with test credentials is acceptable, what the tester may do to live workflows, and who receives findings. Ask the provider how they handle credentials they encounter during testing and whether they will retest fixes. The quote should follow from that written scope, and it should separate the one-time test and report from any retest or ongoing testing you may want later.
How the test moves from scope to retest
The test starts with a written scope agreement and an n8n audit baseline, which tells the testers which credentials, webhooks and nodes already look risky. Testing then splits into authenticated and unauthenticated tracks covering the editor, API, webhook endpoints, SSRF from HTTP nodes and Code node escape attempts, with ZAP assisting the scanning. Findings flow into a report, the client applies fixes, and a retest confirms each fix before the final report is issued.
Phases of an n8n penetration test, from scope agreement to the retested final report.
What each test area checks and what evidence it produces
This area asks whether someone without a valid login can reach the editor, the REST API or internal endpoints, and whether an authenticated user can act beyond their role. The tester needs one account per role in scope, such as an owner, an admin, a project editor and a viewer, plus an unauthenticated baseline. Results cover session handling, API key use, role checks on each object type and whether SSO settings can be altered by a non-admin. Evidence is a list of requests and responses for each finding, with the role used, the exact endpoint and a reproduction sequence.
- Unauthenticated reachability: which editor, REST and internal paths answer without credentials, and what they reveal.
- Role boundaries: whether a viewer or project editor can read, run or change workflows and credentials outside their project.
- API key handling: creation, scope, expiry and whether keys appear in logs or responses.
- Session and SSO settings: cookie flags, session lifetime and whether non-admins can change authentication configuration.
Confirm in writing which roles, projects and instances are in scope, and whether the tester may create test accounts and keys on a production instance.
Webhook URLs are the instance's public surface, and this area asks who can trigger a workflow, what the trigger does with the request and whether test URLs stay closed. The tester sends crafted requests to production and test paths, with and without the authentication configured on the Webhook node. Evidence includes the path inventory, the authentication result for each webhook, any workflow actions a bare request can start and any response that leaks workflow data or error detail.
- Path discovery: which webhook paths are reachable from outside the network and whether they are predictable.
- Authentication enforcement: whether Basic, Header or JWT settings are actually rejected when omitted or wrong.
- Test URL exposure: whether test webhooks accept requests when they should not.
- Abuse and flooding: whether the proxy or instance limits request rates, and what happens to executions created by bursts of traffic.
- Response content: whether errors reveal stack traces, node names or stored values.
Confirm the source addresses the tester will use, and whether the client's proxy or WAF should be tested together with n8n or excluded.
This area asks whether a workflow author, or an attacker who can influence a workflow input, can make the n8n server request internal services or cloud metadata addresses. The tester builds controlled test workflows that call loopback, private network, link-local and metadata addresses through HTTP Request and similar nodes, and checks redirects and DNS names that resolve to internal hosts. Evidence is the workflow definition used, the target addresses attempted, what the server returned and the network path observed from the n8n host.
- Target ranges: loopback, RFC 1918 private ranges, link-local and cloud metadata addresses.
- Redirect handling: whether a public URL that redirects into an internal address is followed.
- DNS rebinding and hostnames: whether a name resolved at check time differs from the name resolved at request time.
- Credential forwarding: whether stored credentials are sent to an address the workflow author chose.
- Blocking behavior: whether blocked requests fail clearly and are logged.
Confirm which workflow authors are trusted, which internal services are legitimately reachable, and that the test servers and metadata endpoints are owned by the client.
This area asks whether code written in the Code node, or in a custom expression, can read the host filesystem, environment variables, other workflows' data or the n8n database, or run operating system commands. The tester uses a workflow author account, since that is the realistic starting position, and attempts module imports, built-in access and environment reads under the instance's current settings. Evidence is each attempt with its code, the runner used (in-process or external), the result and the file or variable touched, if any.
- Module and built-in access: which imports succeed and which allowed lists apply.
- Environment and file reads: whether secrets such as the encryption key or database password are visible to a script.
- Process execution: whether child processes or shell commands can be started.
- Runner boundary: whether the same attempts behave differently inside an external task runner.
- Impact on the host: whether any escape reaches other containers, volumes or the network.
Confirm the n8n version and runner configuration under test, and agree in writing that escape attempts stay inside the test instance and do not run destructive commands.
This area asks where credential values or secrets can be seen after they are saved, in execution data, logs, exports, error messages and the UI of users who should not see them. The tester reviews what each role can open, runs test workflows that log or return credential-bearing fields, and inspects exported workflows and server logs. Evidence includes the exact screens, API responses and log lines where values appear, with a note on who could see them and whether the value is still readable after rotation.
- Execution history: whether inputs, outputs or error payloads show tokens, passwords or personal data to viewers.
- Exports and sharing: whether workflow exports or copied JSON contain credential values rather than references.
- Logs and monitoring: whether application logs, reverse proxy logs or log forwarders record authorization headers or secrets.
- Credential sharing: whether a credential shared with one project is usable or readable by another.
- Encryption at rest: whether the stored database contents are unreadable without the encryption key.
Confirm which logs and exports the client keeps and for how long, and agree how any real personal or financial data encountered during testing will be handled and deleted.
Where OWASP ZAP fits in an n8n test
ZAP is a free, Apache-2.0 licensed web application scanner that gives a test team repeatable coverage of the n8n editor and webhook endpoints, and experienced pentesters also use it for manual work such as intercepting requests and replaying them. In an n8n engagement, ZAP is best treated as the baseline layer: it crawls the editor and public paths, runs active checks against them, and produces a report that the rest of the test can build on. Confirm the ZAP version you will use against the current release on the ZAP download page before you set up the test environment, since weekly builds ship regularly.
For a repeatable run, define the scan as one Automation Framework plan in YAML. The plan chains jobs such as spider, activeScan and report, and an exitStatus job can set the process exit code from the scan results so a pipeline can fail on findings above your threshold. The stable Docker images include the framework, so the plan can run on a locked-down runner without a desktop session. Ask your team to decide in advance which alert levels should fail a build, and to keep the plan in version control next to the n8n environment it targets. The ZAP API is bound to the local machine by default and requires an API key on all actions, so keep it off any shared network and store the key the same way you store other test secrets.
ZAP output can feed your findings workflow directly: DefectDojo imports ZAP XML reports, with or without requests and responses. ZAP does not replace manual testing of the two areas where n8n risk is highest. A generic scanner does not understand how a Code node script or an HTTP Request node target is chosen, so the Code node escape attempts and SSRF paths from HTTP nodes need hand-built test cases, with a tester checking which internal addresses and metadata endpoints a workflow can reach. Plan those tests as a separate workstream and record their results alongside the ZAP report, not inside it.
Test scope options and when each fits
This table compares four ways to scope a test of a self-hosted n8n instance: external black-box, standard user, admin and staging versus production. Read each row for what the test can reach, what it can disrupt and the situation it suits. The main takeaway is that authenticated testing finds far more than external testing, and that staging is the safer place to run anything active.
| Scope option | What it covers | What it risks | When it fits |
|---|---|---|---|
| Black-box external | Exposed editor login, public webhook URLs, TLS and proxy configuration, unauthenticated API paths and error handling | Shows little about workflows, credentials or internal network reach, so findings may understate real exposure | Early baseline of what an attacker on the internet sees, or when the team needs a quick external check first |
| Authenticated standard user | Workflow sharing and project boundaries, credential visibility for that role, HTTP and Code node behavior the user can build, webhook authentication settings | Active tests may create or run workflows that consume resources or touch real systems if the account has access to them | Checking whether a normal user can read credentials, escape project boundaries or reach internal services through nodes they are allowed to use |
| Authenticated admin | Instance settings, user management, SSO and security policies, API key management, node access settings and the audit output | Admin credentials are high-value, so tester access must be tightly logged and removed afterward, and admin actions can change live settings | Reviewing configuration controls, SSO and role mapping, and verifying what the audit report flags before fixes are applied |
| Staging copy | A restored copy of the production database and encryption key, with the same version, nodes and webhook paths where possible | Test data may still include real personal data, and a copy that differs in version or configuration can hide production issues | Active scanning, fuzzing of webhooks and Code node escape attempts that could cause harm or lock accounts in production |
| Production instance | The exact configuration, network paths, proxies and live credentials that attackers would reach | Scans can trigger alerts, disrupt live workflows, exhaust executions or expose real credentials during testing | Limited, pre-agreed checks with a rollback plan, change window and named contacts, usually after staging results are reviewed |
How to scope and prepare an n8n penetration test
This sequence turns a vague request for an n8n security test into a written scope, a known release and configuration baseline, a staging instance that matches production, and test accounts for each role. The result is a test that the tester and the owner both understand before the first request is sent.
Define the target and its boundaries
The owner names the n8n instance, its public hostnames, the webhook base URL, any private API or editor addresses, and the connected systems the test may touch. The tester confirms which of these are in scope and which are excluded, such as third-party SaaS accounts behind credentials. This is done when the scope document lists every hostname and every integration, each marked in or out, and both parties have signed it.
Confirm the n8n release in use
The owner records the exact n8n version running in production, including the image tag or package version and whether the instance uses the Community edition or a paid plan. The tester compares that version with the n8n release notes to identify which fixes are already present and which features, such as the public API or the Code node runner, are active. This is complete when the version, edition and enabled features are written into the test plan.
Collect the n8n security audit report
The owner runs the n8n security audit on production and shares the output with the tester before testing starts. The report lists unused credentials, SQL expressions open to injection, file system nodes, community nodes and unprotected webhooks, so the tester can prioritize these areas and avoid spending time rediscovering items already known to the owner. This step is done when the report is attached to the scope, with a note of which findings the owner has already fixed.
Agree a staging environment that matches production
The owner provides a staging instance that mirrors production, including queue mode if production uses it, the same database type, the same reverse proxy and the same encryption key handling. In queue mode, the main instance key must also reach each worker and webhook processor, so the staging design should show where that key lives and who can read it. The check is a documented topology diagram and a confirmation that staging holds only test data and test credentials.
Create test accounts for each role
The owner creates one test account per role the production instance uses, such as owner, admin, project member with editor rights and viewer, along with an unprivileged account that has no project access. The tester uses these accounts to check whether authorization limits hold across the editor, the API and the webhook endpoints. Setup is verified when each account can log in, the tester has the expected role, and the owner has recorded who holds each account.
Write rules of engagement
The tester and owner write the limits of the test: request rate ceilings for webhooks and the editor, the times when active testing may run, how test data is created and deleted, and how any discovered customer data is handled and reported. The document also states how test credentials are issued, rotated and revoked after the test. It is done when both parties sign the rules and the owner confirms who can stop the test at any time.
Verify the scope and test access before starting
The tester runs a short access check against staging and production targets to confirm that each test account logs in, that the in-scope webhooks respond, and that the agreed rate limits are not triggered by normal probing. The owner confirms that monitoring and logs capture the test traffic so that both sides can later match findings to requests. The step is complete when each test account has been verified and a written go or no-go note is recorded.
Safety rules that protect data during an n8n test
A penetration test of n8n runs against a system that holds live credentials, webhooks and business data, so the rules below decide what the testers can touch and what they leave behind. Each card names one control that should be agreed in writing before the first request is sent to the instance.
Test data only
Build the test workflows, credentials and sample payloads from synthetic data that the team created for the exercise. Confirm that no production workflow is executed, edited or re-run during testing, because a single webhook call can start a live process that writes to a real system. Agree in the scope document which projects and workflows are in bounds.
No real customer credentials
Testers should authenticate with dedicated test accounts and sandbox credentials for each connected service, never with credentials that reach customer records. Ask the client to rotate any test credential that was used during the engagement once the report is delivered. This keeps a finding from turning into a live compromise of a customer system.
Avoiding destructive workflows
Active tests can trigger nodes that send email, post messages, delete rows or call payment APIs. Require that test workflows point at non-production endpoints and that any node with side effects is disabled or mocked before testing begins. Confirm who can stop a running execution if a payload behaves in an unexpected way.
Handling exposed secrets
If a test reveals a token, password or encryption key in an execution log, a workflow export or a response body, the tester stops, records only the location and a redacted fragment, and notifies the named client contact the same day. Do not copy the secret into notes, tickets or the report. Confirm the escalation path and the owner who will rotate the value.
Keeping the ZAP API closed
When the ZAP API is used to drive scans, it should be bound to the tester's workstation or a dedicated scanning host and protected with an API key. Confirm that no other host on the network can reach the port, and shut the daemon down when the scan ends. An open ZAP API on a shared network could let third parties start scans against the client's instance.
Secure storage of the report
The test report describes exploitable paths in detail, so store it in an access-controlled location, limit distribution to named recipients and encrypt it at rest. Remove raw ZAP exports that contain full requests and responses unless the team needs them for retest evidence. Agree the retention period and deletion steps before the report is issued.
Questions buyers ask before a pentest of n8n
What drives the cost of a penetration test of a self-hosted n8n instance?
The main cost drivers are the number of attack surfaces in scope, the depth of testing, and how much preparation the client's team must do. A single instance with local authentication and a few public webhooks is a narrower job than a queue-mode deployment with workers, SSO, several projects, custom nodes and an exposed public API. Ask for a written scope that lists the editor, API, webhook endpoints, HTTP nodes, Code node and credential handling as separate items, and ask which of them are in or out. Quotes should state what is one-time (the test, the report and the retest) and what recurs (scheduled retests or continuous testing under a retainer). DeployOpen does not publish a price list, so a quote follows from the written scope.
How long does a penetration test of n8n take, and what sets that duration?
The duration is set by the scope agreed in writing, the number of distinct attack surfaces, and how quickly the client provides accounts, access and fixes for blocking issues. Testing the editor and API authentication, webhook endpoints, SSRF paths from HTTP nodes and Code node escape attempts takes longer when each workflow pattern needs its own test. Before signing, ask the provider for the planned phases, the dates of the test window, and the date the draft report will arrive. Those dates should be in the statement of work, not inferred from a general estimate.
What must our team provide before a pentest of n8n starts?
Plan to provide the following before testing begins:
- Test accounts with the roles you want reviewed, such as an owner, an editor, a project member and a viewer, so authorization can be checked from each side.
- Network access to the staging or production instance, including the paths to the main instance, webhook URLs, workers and the reverse proxy, plus an agreed source address for the testers.
- The output of the n8n security audit, with workflows, credentials and nodes it flagged, so testers do not repeat known findings and can focus on the gaps.
- Change windows for active testing, a named contact for stopping the test, and an agreed process for handling any data that the tests expose.
Confirm the exact list in the scope document, because it depends on whether testing runs against staging or production.
Can our internal security team run a penetration test of n8n alone?
An internal team can run parts of the work, especially with the free OWASP ZAP scanner, which is licensed under Apache-2.0 and offers a Docker image and an Automation Framework for repeatable scans. Authenticated scanning, Code node escape attempts, SSRF checks and authorization testing across projects need a tester who understands n8n's internals and its execution model. Ask yourself whether your team has someone who can build the test accounts, read the workflow context, and judge whether a finding is exploitable in your deployment. If not, a partner can run the test while your team reviews the same evidence and owns the fixes.
Does the n8n security audit replace a penetration test?
No. The n8n security audit is a useful starting point, because it reports unused credentials, SQL expressions open to injection, file system nodes, community nodes and unprotected webhooks. It inspects configuration and workflow content, but it does not show whether an attacker can reach the editor, bypass webhook authentication, pivot through an HTTP node to an internal service, or escape the Code node. A penetration test checks those paths against the running instance. Use the audit output as input to the test scope, then compare the test findings against the audit to see what the configuration review missed.
How are retests handled after a penetration test of n8n?
A retest checks whether the fixes for reported findings work in the environment, and it should be written into the statement of work with its own scope and deliverable. Ask the provider whether a retest is included, how many rounds are covered, how the fixed findings are verified, and whether the retest report replaces or extends the original report. Fixes often change workflows, credentials or environment variables, so schedule retests after your team has tested those changes in staging. Ongoing retests, including scheduled or continuous testing after major n8n upgrades, can be agreed as a retainer.
Does DeployOpen issue certifications or audit reports for a penetration test?
No. DeployOpen runs security testing and delivers a findings report with fixes and a retest, but it does not issue audit reports, attestations or certifications. Those come from independent auditors and certification bodies. A penetration test report can be one piece of evidence an auditor reviews, but the auditor decides what it proves for a given control. Ask your auditor in advance which evidence they expect for the controls in scope, and agree with the provider on the report format before testing starts.
What the findings report should contain
Every finding in the report for an n8n test should carry the same fields so the client can act on it without a second meeting. Each entry needs a severity rating with the reasoning behind it, the affected component (for example the editor login, a specific webhook path, an HTTP Request node in a named workflow, or a Code node running on a particular worker), numbered reproduction steps that a client engineer can follow in a staging copy, and the evidence itself: request and response captures with secrets redacted, screenshots of the affected screen and the exact n8n version observed. The recommended fix should name the setting, control or workflow change, such as N8N_SSRF_PROTECTION_ENABLED, an external task runner configuration or Webhook node authentication, not a general instruction to harden the instance. Each finding also records a retest result, marked as fixed, partially fixed or open, with the date and the build it was checked against.
The n8n security audit is a starting point for this work, not a substitute for the test. Its output lists unused credentials, SQL expressions open to injection, file system nodes, community and custom nodes and unprotected webhooks, so testers can confirm which items are reachable by an attacker and which are only configuration noise. Findings then map to the hardening topics in this section: a Code node escape attempt belongs with external task runner isolation and Code node module restrictions, an SSRF result belongs with SSRF protection and allowlists for internal APIs, and an exposed webhook belongs with authentication and IP allowlists. Before the report is written, confirm with the client which of these controls were already in place, because a finding that a control was never enabled is a different remediation task from a bypass of a control that exists.
How DeployOpen scopes and delivers n8n security testing
DeployOpen runs security testing of self-hosted n8n as a fixed-scope engagement, with the scope, deliverables and timeline agreed in writing before testing starts. The work covers the editor, API, webhooks, HTTP nodes and Code node paths of your own instance, and ends with a findings report and a retest.
How we scope
- Confirm which n8n edition, deployment mode and queue setup are in scope before testing begins.
- List the editor accounts, roles, API keys and SSO settings the testers will examine.
- Agree which public webhook endpoints, HTTP node targets and credential types are included.
How we test and build
- Set up a staging copy of your instance so active tests never touch production workflows.
- Test authentication, authorization and session handling in the editor and the public API.
- Attempt SSRF from HTTP nodes and sandbox escape from the Code node within the agreed boundaries.
How we hand over
- Deliver a written findings report that ranks each issue by severity and affected component.
- Include reproduction steps, evidence, and concrete fix guidance for your n8n configuration.
- Retest the fixed issues and document which findings are closed and which remain open.
How we support
- Engagements are fixed-scope, and ongoing support and continuous testing are available as a retainer.
- Use the retest results to plan the next round of testing as your workflows and nodes change.
- Ask DeployOpen to confirm the scope and quote in writing from your own environment details.

