Feb 27, 2026·6 min read·11 visits
The Chat Trigger node in n8n checked if an auth cookie existed but didn't verify it. Attackers can bypass authentication by sending a request with `Cookie: n8n-auth=anything`, triggering potentially sensitive workflows without credentials.
n8n, the popular workflow automation tool that serves as the central nervous system for many modern tech stacks, suffered from a critical logic flaw in its Chat Trigger node. The vulnerability allowed attackers to bypass authentication simply by providing a cookie—any cookie. The system checked for the *presence* of an authentication token but failed to validate its *contents* or signature, effectively treating a cardboard badge the same as a valid ID card.
Automation tools like n8n are the silent workhorses of the internet. They glue APIs together, move data between databases, and occasionally, they talk to humans. The Chat Trigger node is specifically designed for the latter—it allows users to interact with workflows via a chat interface. It's a fantastic feature that turns a static script into an interactive bot.
But here is the rub: when you expose a workflow to the internet, you are effectively opening a door into your internal infrastructure. If that door has a lock, you expect it to work. In this case, the lock was painted on.
This vulnerability isn't a complex memory corruption bug or a deep cryptographic failure. It is a logic error so simple it hurts. It fundamentally undermines the trust model of the application, allowing anyone who knows where the door is to walk right in, provided they knock in a very specific, low-effort way.
In security engineering, we often talk about "Authentication vs. Authorization." But before we even get there, we have a more primal concept: Verification. The root cause of this vulnerability is a classic case of "Authentication by Presence."
When the Chat Trigger node is configured to use n8n User Auth, it expects the user to be logged in. The code responsible for this check resides in packages/@n8n/nodes-langchain/nodes/trigger/ChatTrigger/GenericFunctions.ts. The logic was intended to gatekeep access, ensuring only legitimate users could trigger the workflow.
However, the developers made a fatal assumption. They assumed that if a cookie named n8n-auth existed in the request headers, the user must be authenticated. They forgot the most important part: checking if the cookie is actually valid, signed, and belongs to a real session. It's the digital equivalent of a bouncer letting you into a club because you're holding a piece of paper—it doesn't matter that the paper is a gum wrapper, as long as you're holding something.
Let's look at the TypeScript that caused the headache. This is a perfect example of how a single missing line of code can negate an entire security model.
The Vulnerable Code:
// The code retrieves the cookie
const authCookie = getCookie('n8n-auth');
// The logic check
if (!authCookie && webhookName !== 'setup') {
// If NO cookie exists, throw an error
throw new ChatTriggerAuthorizationError(500, 'User not authenticated!');
}
// ... Execution continues happily ...Do you see the gap? The code checks !authCookie. If authCookie is defined (i.e., not null, not undefined, not empty string), the if block is skipped. The code assumes that existence implies validity. There is no call to a session manager, no JWT verification, nothing.
The Fix:
The patch introduces the missing step: actually validating the token.
const authCookie = getCookie('n8n-auth');
// Still check existence
if (!authCookie) {
throw new ChatTriggerAuthorizationError(401, 'User not authenticated!');
}
// The new mandatory check
try {
await context.validateCookieAuth(authCookie);
} catch {
throw new ChatTriggerAuthorizationError(401, 'Invalid authentication token');
}By adding context.validateCookieAuth(authCookie), the system now cryptographically verifies the session. If you send a garbage cookie now, it throws a 401.
Exploiting this is embarrassingly easy. You don't need Metasploit, you don't need a disassembler, and you certainly don't need a PhD in cryptography. You just need curl.
Imagine you find an n8n instance with a Chat Trigger endpoint. Usually, these look something like https://n8n.target.com/webhook/your-chat-trigger-uuid. If you try to access it normally, you might get a 500 or 403 error saying "User not authenticated!"
To bypass this, we simply inject a cookie. Any cookie. It doesn't need to be a JWT. It doesn't need to be base64 encoded. It can be the word "pwned".
Attack Scenario Diagram:
Proof of Concept:
curl -X POST https://target-n8n.com/webhook/chat-endpoint \
-H "Cookie: n8n-auth=LetMeIn" \
-H "Content-Type: application/json" \
-d '{"message": "Execute Order 66"}'If the node is vulnerable, it will process the input as if it came from the system administrator.
The CVSS score for this is technically "Medium" (4.2) because the Chat Trigger node must be explicitly configured to use n8n User Auth (which is not the default). However, do not let the low score fool you into complacency.
If an organization does use this feature, they likely use it to gatekeep internal tools. A Chat Trigger might be connected to an LLM that has access to internal documentation, or it might trigger DevOps pipelines.
Potential Consequences:
It is a classic pivot point: a small hole in a non-critical component that leads to the compromise of the critical infrastructure behind it.
The remediation is straightforward: upgrade. The n8n team patched this in versions 1.123.22, 2.9.3, and 2.10.1. These versions enforce the validation logic we discussed earlier.
Mitigation Strategies:
n8n User Auth to Basic Auth or handle authentication within the workflow itself (though that is risky).This vulnerability serves as a stark reminder: checking for the existence of a credential is never enough. Always verify your inputs, especially when that input is the key to the castle.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
n8n n8n | < 1.123.22 | 1.123.22 |
n8n n8n | >= 2.0.0, < 2.9.3 | 2.9.3 |
n8n n8n | >= 2.10.0, < 2.10.1 | 2.10.1 |
| Attribute | Detail |
|---|---|
| Bug Class | Authentication Bypass |
| Attack Vector | Network (Web) |
| Root Cause | Improper Validation of Cookie Existence vs. Validity |
| CVSS v3.1 | 4.2 (Medium) |
| CVSS v4.0 | 2.3 (Low) |
| Component | Chat Trigger Node |