n8n Token Exchange: Briefly the World’s Worst Valet

The n8n token exchange worked – briefly – like a parking valet attendant who follows one rule: anyone allowed to look at a claim ticket is also allowed to replace the car attached to it. That’s more or less what happened inside n8n’s OAuth credential reconnect process. The flaw, now tracked as CVE-2026-45732, was published by n8n through a GitHub security advisory on May 13, 2026. The National Vulnerability Database added the CVE record on June 23. It received a high-severity CVSS 4.0 score of 8.3.

a illustration visualizing the n8n oauth key security vulnerability

It’s unclear how long the authorization flaw remained in n8n before researchers found it. The public advisory identifies the patched releases and its May 13, 2026 disclosure date, but doesn’t provide the original introduction date or the researchers’ private reporting timeline.

This wasn’t the sort of bug where someone on the open internet could tap a few keys and commandeer every n8n server in sight. The attacker needed an authenticated account and read-only access to a credential shared through an n8n instance or project. “Read-only,” however, turned out to be doing some heroic linguistic work.

A Reconnect That Did More Than Reconnect

OAuth credentials are the keys n8n workflows use to operate inside services such as cloud storage platforms, CRMs, email systems, and other APIs. When a connection expires or needs reauthorization, n8n provides a reconnect process that exchanges an OAuth authorization code for fresh tokens. The vulnerable OAuth1 and OAuth2 reconnect endpoints checked for the permission credential:read.

That sounds reasonable until you consider what the endpoint actually did. Completing the reconnect process could overwrite the credential’s stored token material. That’s not reading. That’s changing the identity behind the integration.

An authenticated user who could access a shared credential—but wasn’t supposed to edit it—could begin a reconnect flow and supply tokens linked to an external account they controlled. The shared credential would still exist. The workflows would still run. But they’d now run under the attacker’s OAuth identity.

It’s the software equivalent of changing the bank account number on a standing payment while leaving the payee’s name untouched.

Why That’s Worse Than a Broken Workflow

A failed automation tends to announce itself. Jobs stop. Alerts fire. Someone complains. This flaw offered a more deceptive outcome: successful execution in the wrong security context.

Imagine a workflow that collects customer files and uploads them to cloud storage. After the token exchange, it might continue reporting successful uploads—but the destination account could belong to the attacker. A CRM synchronization might send records into an unauthorized environment. An integration trusted by several teams could remain operational while its underlying identity had been replaced.

The advisory describes possible data exfiltration to attacker-controlled services and persistent takeover of shared integrations. The vulnerability applied specifically where credentials were shared with other users or projects.

n8n Response

n8n responded immediately: they published the flaw through its official GitHub security advisory and classified it as high severity. By the time of disclosure, fixes were available in versions 1.123.43, 2.20.7, and 2.21.1. The company told users to upgrade to one of those releases or anything later.

For administrators unable to patch immediately, n8n recommended restricting credential sharing to fully trusted users, auditing shared credentials for unexpected OAuth token changes, and revoking any tokens that may have been replaced. It also made clear that these were temporary measures, not substitutes for installing the fix.

That was the right response: patch the authorization check, publish the affected versions, and give administrators something practical to inspect.

The Lesson Hiding in the Permission Name

The coding mistake was small enough to fit on a coffee-stained sticky note: the endpoint checked for credential:read when it should have required credential:update.

Its reach was much larger.

Authorization should be based on what an operation can change, not what the endpoint happens to be called. “Reconnect” sounds harmless. In reality, reconnecting an OAuth credential can replace the account, permissions, and destination behind an entire chain of automated actions. That’s the uncomfortable thing about automation security. A workflow platform doesn’t merely hold credentials. It gives those credentials legs.