n8n External Secrets Exposure via Workflow Expressions
First seen Jul 23, 2026 · Updated Jul 23, 2026
A vulnerability in n8n allows authenticated users with only project editor access to read plaintext external secrets by referencing them directly in node expressions, bypassing the intended secrets access permission model. This affects instances that have the external secrets feature configured, potentially exposing sensitive credentials to users who should not have access to them. The issue has been patched in n8n 2.27.4 and 2.28.1.
Technical Analysis
The vulnerability stems from improper scoping of external secrets resolution within the n8n workflow expression engine. Node expressions, which are meant to operate on workflow data and configured credentials, incorrectly had visibility into external secrets that were never explicitly attached to that node or credential context. An authenticated user with project editor rights (a relatively low privilege tier) could craft an expression referencing the external secret directly, causing the engine to resolve and display its plaintext value in workflow output or logs. This crosses an intended trust boundary between workflow authors and secrets administrators, since the permission model assumes editor access does not equate to secrets access. In agentic or automation contexts where n8n orchestrates AI agent tool calls, this could allow a lower-privileged workflow editor to exfiltrate API keys or credentials used by other agents/tools in the same instance.
Affected Systems
n8n
Detection Signatures
- Audit workflow expressions for direct references to external secrets variables/namespaces not explicitly bound to node credentials.
- Review workflow execution logs for unexpected resolution of secret values in node output.
- Monitor for editor-role users accessing or modifying expressions referencing $secrets or equivalent external secret syntax.
- Check instance configuration for external secrets feature enabled combined with broad editor role assignments.
Remediation Steps
- 1
Upgrade n8n
Update to n8n version 2.27.4, 2.28.1, or later where the expression-scoping fix is applied.
- 2
Restrict project membership
Limit project editor access to fully trusted users only until the upgrade is completed.
- 3
Review external secrets usage
Audit which projects have external secrets configured and reduce editor privileges on those projects where possible.
- 4
Audit historical workflows
Review existing workflow expressions and execution logs for evidence of secret values having been exposed prior to patching.
- 5
Rotate exposed secrets
If evidence of exploitation is found, rotate any external secrets that may have been accessible to non-privileged editors.
CVE / Advisory IDs
Industries Most Exposed
Respond to this threat
Pro subscribers get a full AI-generated incident-response playbook for this threat — detection, containment, eradication, and recovery steps — plus an unlimited AI Threat Advisor for questions about your environment.