Critical n8n flaws allow remote code execution and exposure of stored credentials

March 20, 20268 min read5 sources
Share:
Critical n8n flaws allow remote code execution and exposure of stored credentials

Background and why this disclosure matters

Two critical vulnerabilities in the n8n workflow automation platform have drawn attention because they hit one of the most sensitive parts of modern IT environments: automation systems that sit between cloud apps, internal services, and stored secrets. According to reporting by The Hacker News, the flaws include CVE-2026-27577, an expression sandbox escape that can lead to remote code execution, and CVE-2026-27493, an unauthenticated issue that can expose stored credentials [1].

n8n is widely used to connect SaaS tools, APIs, databases, messaging platforms, and internal workflows. That makes it useful, but also dangerous to lose control of. A compromised automation server may hold OAuth tokens, API keys, webhook secrets, database credentials, and cloud access material for many different systems at once. n8n’s own documentation reflects this central role, describing workflow execution, credential management, and both self-hosted and cloud deployment models [2][3].

This is why the story goes beyond a single application bug. When an attacker can both run code on the automation host and access stored secrets, the platform can become a stepping stone into email, source code repositories, ticketing systems, cloud accounts, and internal databases.

What the vulnerabilities do

The first flaw, CVE-2026-27577 (CVSS 9.4), is described as an expression sandbox escape leading to remote code execution [1]. In practical terms, n8n supports expressions so workflows can transform data dynamically. Those expressions are supposed to run inside a restricted environment. A sandbox escape means attacker-controlled input can break out of those limits and interact with the underlying runtime or operating system.

That kind of bug is especially serious in JavaScript and Node.js-based applications because expressions, templates, and dynamic evaluation features can sometimes expose dangerous objects or execution paths if isolation is incomplete. Public reporting has not included full exploit code in the summary, but the likely chain is straightforward: an attacker crafts malicious expression content, the application evaluates it, sandbox controls fail, and arbitrary commands execute in the context of the n8n process [1][2].

The second flaw, CVE-2026-27493 (CVSS 9.5), is reportedly an unauthenticated access issue that exposes stored credentials [1]. This is arguably just as damaging as code execution. Workflow platforms act as secret concentrators. They often store credentials for GitHub, Slack, Google Workspace, Microsoft 365, AWS, Azure, GCP, CRMs, databases, and custom APIs. If an attacker can retrieve those credentials without logging in, the blast radius can extend well beyond the automation server itself.

While vulnerability databases may take time to fill in technical specifics after initial disclosure, the core risk is already clear from the descriptions and severity scores: one bug gives attackers a path to execute commands, and the other may hand them the keys to connected systems [1][4][5].

Technical context for informed readers

Expression engine flaws are a recurring problem across automation, low-code, and orchestration products. The pattern is familiar: a platform allows user-supplied logic for convenience, then tries to confine it in a sandbox. If that sandbox exposes unexpected globals, prototype chains, constructors, or runtime internals, attackers may be able to reach file system access, child process execution, or sensitive in-memory objects.

In n8n’s case, expressions are a core feature rather than a niche add-on. That increases the attack surface. Any feature that evaluates dynamic content should be treated as high risk, especially in a product that also manages secrets and talks to many external systems. If the vulnerable path was reachable through workflow editing, webhook-triggered flows, imported workflow definitions, or other user-controlled inputs, exploitation opportunities could vary based on deployment and permissions. The reporting so far does not fully define those preconditions, but defenders should assume that any exposed or weakly segmented n8n instance deserves urgent review [1][2].

The unauthenticated credential exposure issue points to a different class of weakness: broken access control. In many products, secrets are stored encrypted at rest, but the application itself can decrypt them when needed. That means an authorization flaw in the application layer can still expose credential material even if storage uses encryption. Security teams sometimes overestimate the protection offered by at-rest encryption when the real gatekeeper is application logic.

From an attacker’s perspective, the combination is ideal. Remote code execution can provide persistence, local discovery, and direct host access. Credential exposure can provide quieter, more scalable access to downstream services. Together, they support data theft, lateral movement, and operational disruption.

Impact assessment

The most exposed group is organizations running self-hosted n8n, especially instances reachable from the internet or accessible from broad internal networks. Self-hosting often brings patching delays, inconsistent hardening, and limited monitoring. Teams may deploy n8n quickly for productivity reasons, then forget it is effectively privileged middleware [2][3].

Cloud-hosted users may be less exposed if patches were applied centrally before public disclosure, but that depends on whether the flaws affected hosted environments and how quickly fixes were rolled out. At the time of the initial reporting, the strongest operational assumption is that any unpatched deployment should be treated as high risk until verified otherwise [1].

The severity is high for several reasons:

First, n8n often has access to many systems at once. A single compromise can cascade into multiple services.

Second, secrets stored in workflow tools are often long-lived and highly privileged. Stolen tokens may continue to work until they are rotated.

Third, automation servers frequently have network paths to internal APIs, databases, CI/CD systems, and admin interfaces that ordinary endpoints do not.

Fourth, the two bugs complement each other. Even if one path is blocked in a particular environment, the other may still offer a route to compromise.

For business impact, affected organizations could face data exposure, unauthorized workflow changes, abuse of cloud resources, source code theft, mailbox access, fraudulent automation runs, or service disruption. In regulated sectors, credential exposure may also trigger breach notification analysis if protected data or regulated systems were reachable through those secrets.

What defenders should look for

Public indicators of compromise have not been widely detailed in the initial article, but defenders should review n8n and surrounding infrastructure for signs of misuse. Useful checks include unusual workflow edits, newly created workflows or webhooks, unexpected outbound network connections, suspicious API activity in connected services, and any evidence of shell execution or child process creation on the n8n host [1][2].

Teams should also inspect reverse proxy logs, container logs, host audit trails, and cloud audit records. If there is any chance credentials were exposed, downstream systems matter as much as the n8n server itself. Review recent access to Git repositories, SaaS admin consoles, cloud APIs, databases, and messaging platforms tied to n8n credentials.

How to protect yourself

1. Patch immediately. Identify all n8n deployments, including forgotten test or departmental instances, and update to the vendor-fixed release as soon as possible. Confirm versions rather than assuming automation handled it [1][2].

2. Rotate stored credentials. If an instance was exposed, do not stop at patching. Rotate API keys, OAuth tokens, database passwords, webhook secrets, and cloud credentials stored in n8n. Revoke and reissue where possible.

3. Review connected systems for suspicious use. Check GitHub, Slack, Microsoft 365, Google Workspace, AWS, Azure, GCP, and other linked platforms for unusual logins, token use, or configuration changes after the likely exposure window.

4. Restrict network exposure. Self-hosted automation tools should not be broadly internet-accessible unless there is a clear need. Place administrative interfaces behind access controls, IP restrictions, SSO, and, where appropriate, a VPN service.

5. Minimize stored privileges. Audit what n8n actually needs. Replace broad admin credentials with scoped service accounts and short-lived tokens where supported.

6. Monitor for workflow tampering. Enable logging around workflow creation, modification, credential access, and webhook activity. Alert on unusual changes, especially outside business hours.

7. Segment the host. Limit what the n8n server can reach on the network. If remote code execution occurs, segmentation can reduce lateral movement.

8. Treat automation platforms as tier-one assets. Include n8n in vulnerability management, backup, logging, incident response playbooks, and security architecture reviews. It may not look like a crown-jewel system, but it often has crown-jewel access.

The bigger lesson

The n8n disclosure fits a broader pattern in which attackers target orchestration and automation platforms because they aggregate trust. These systems are not just productivity tools. They are control points loaded with credentials, business logic, and connectivity to sensitive environments. When a product combines dynamic code-like features with centralized secret storage, the consequences of a flaw rise sharply.

For defenders, the takeaway is simple: patch fast, rotate secrets, and assume downstream exposure until proven otherwise. For organizations that rely heavily on workflow automation, this incident is a reminder to inventory where that trust is concentrated and whether the surrounding controls match the risk.

Sources: The Hacker News [1]; n8n documentation and vendor site [2][3]; MITRE CVE records [4][5].

Share:

// FAQ

What are the two critical n8n vulnerabilities?

They are CVE-2026-27577, an expression sandbox escape that can lead to remote code execution, and CVE-2026-27493, an unauthenticated issue that can expose stored credentials.

Why is an n8n compromise so serious?

n8n often stores API keys, OAuth tokens, database credentials, and cloud secrets for many connected services. A compromise can therefore spread beyond the server to SaaS apps, cloud environments, and internal systems.

Who is most at risk from these flaws?

Self-hosted n8n users are the main concern, especially if their instances are internet-facing, poorly segmented, or slow to receive updates.

What should organizations do after patching?

They should rotate all credentials stored in n8n, review logs for suspicious workflow or API activity, inspect downstream systems for misuse, and tighten network exposure and access controls.

// SOURCES

// RELATED

The collapse of predictive security in the age of machine-speed attacks

Attackers now weaponize flaws in hours or days, forcing defenders to shift from predictive patching to preemptive exposure reduction.

8 min readMar 20

New ‘PolyShell’ flaw allows unauthenticated RCE on Magento e-stores

PolyShell reportedly enables unauthenticated RCE on Magento 2.x stores, raising urgent patching and compromise-check demands for merchants.

8 min readMar 20

ThreatsDay Bulletin shows how old tricks keep finding new ways in

This week’s threats show attackers blending OAuth abuse, EDR tampering, chat phishing, malicious ZIPs, and AI platform compromise.

9 min readMar 20

DoJ disrupts 3 million-device IoT botnets tied to record 31.4 Tbps DDoS attacks

DoJ’s IoT botnet disruption highlights how millions of insecure devices can fuel record 31.4 Tbps DDoS attacks across the internet.

8 min readMar 20