DEV Community

SolutionsCraft
SolutionsCraft

Posted on Originally published at solutionscraft.com on

n8n's OAuth Endpoint Can Fill Your Disk

An unauthenticated attacker doesn't need a login, a workflow-editor account, or even a valid n8n credential to make your database grow until it runs out of room. That's the entire point of the n8n OAuth client vulnerability patched on 30 September 2026: a flaw in how the instance's authorize endpoint persists OAuth clients lets anyone who can reach that endpoint create new database rows forever, with no permission check in the way. Rated High, tracked as GHSA-3qcw-p65v-c7vq, no CVE assigned as of publication.

If that sounds different from the last two posts in this series, the sandbox-escape bug from July and the $fromAI prototype leak from August, it is. Both of those needed an authenticated account with permission to build or edit workflows before anything bad could happen. This one needs nothing but network access to the instance.

This walkthrough is for self-hosted instances you manage yourself, Docker or npm/pnpm. If you're on n8n Cloud, patching is handled for you.

Who's affected

Because there's no authentication check on the vulnerable path, exposure isn't about who has an account on your instance, it's about who can reach it over the network. If your instance is reachable from the open internet (or from any network you don't fully trust), you're exposed to an anonymous caller today, not a theoretical one who first needs stolen credentials.

The advisory's technical detail is specific: the authorize endpoint resolves an OAuth client by its URL path, but then persists the caller's full, unmodified identifier, query string and all, as the database key. Two requests that differ only in an arbitrary query parameter produce two separate database rows. Those rows get marked as a trusted "first-party" client, which bypasses whatever registration caps would normally apply, and nothing enforces a size limit or an expiration on them. An attacker who just loops that request can keep growing your database indefinitely, no rate limit required on their end to make it hurt, until the disk it lives on fills up and takes workflow executions, logging, and anything else sharing that volume down with it.

Affected versions: anything below 2.41.4 on the stable line, plus 2.42.0 specifically on the beta line. Patched versions: 2.41.4 (stable) and 2.42.1 (beta).

Blip: A denial-of-service bug that needs a login first is annoying. One that needs nothing but a URL is the kind that finds you whether or not you were ever planning to get around to patching this week.

Before you start

You'll need shell access to the machine (or container) running n8n, so you can check its version and, if needed, pull a new image or run an npm install. If you also want to check whether you've already taken a hit from this, you'll want access to wherever n8n's data actually lives: its data directory for SQLite, or your Postgres volume.

Step 1: Check your installed version

npm/pnpm install:

n8n --version

Enter fullscreen mode Exit fullscreen mode

Docker:

docker exec <container-name> n8n --version

Enter fullscreen mode Exit fullscreen mode

Step 2: Check your instance for the OAuth client vulnerability

Here the two currently-maintained lines split in an unusual way: the newer 2.42.0 beta release is vulnerable even though it's numerically ahead of the 2.41.4 stable patch, because 2.42.0 shipped before 2.42.1 fixed it on that line. Eyeballing one version number against one threshold misses that case, so this script checks both:

#!/usr/bin/env bash
# Checks an n8n version string against GHSA-3qcw-p65v-c7vq's affected ranges:
# vulnerable: <2.41.4 OR exactly 2.42.0 (the beta release before 2.42.1 patched it)
set -euo pipefail

version="${1:?Usage: check-n8n-version.sh <n8n-version>}"

ver_lt() {
  ["$1" = "$2"] && return 1
  lower=$(printf '%s\n%s\n' "$1" "$2" | sort -V | head -n1)
  ["$lower" = "$1"]
}

if ["$version" = "2.42.0"]; then
  echo "VULNERABLE: $version is the 2.42.0 beta, which needs 2.42.1"
  exit 1
elif ver_lt "$version" "2.41.4"; then
  echo "VULNERABLE: $version is below 2.41.4"
  exit 1
fi

echo "OK: $version is patched against GHSA-3qcw-p65v-c7vq"
exit 0

Enter fullscreen mode Exit fullscreen mode

Save it as check-n8n-version.sh, then pipe your actual version straight in:

chmod +x check-n8n-version.sh
./check-n8n-version.sh "$(n8n --version)"
# or, for Docker:
./check-n8n-version.sh "$(docker exec <container-name> n8n --version)"

Enter fullscreen mode Exit fullscreen mode

Step 3: Patch

Docker / Docker Compose , pin the image tag to a patched version for whichever line you're on and redeploy:

# docker-compose.yml
services:
  n8n:
    image: n8nio/n8n:2.41.4 # or 2.42.1 if you're tracking the beta line


docker compose pull
docker compose up -d

Enter fullscreen mode Exit fullscreen mode

npm/pnpm global install:

npm install -g n8n@2.41.4

Enter fullscreen mode Exit fullscreen mode

Step 4: Confirm the patch took

Re-run the same check, it should now report OK:

./check-n8n-version.sh "$(n8n --version)"

Enter fullscreen mode Exit fullscreen mode

Check whether you've already taken a hit

Because this bug does its damage quietly, over time, in the background, before you patch is worth a quick look at whether it's already been happening to you. For a default SQLite setup, check the size of n8n's data directory:

du -sh ~/.n8n
# or, for Docker:
docker exec <container-name> du -sh /home/node/.n8n

Enter fullscreen mode Exit fullscreen mode

If you're on Postgres, check the database size directly:

SELECT pg_size_pretty(pg_database_size('n8n'));

Enter fullscreen mode Exit fullscreen mode

Neither command tells you why a database is large on its own, a busy instance with years of execution history is large too, for perfectly normal reasons. What you're looking for is an unexplained jump, especially one with no corresponding jump in actual workflow activity. That mismatch is the pattern the advisory itself calls out as the thing to watch for.

What was actually happening

The part worth understanding, not just patching around: this bug lives in how the authorize endpoint decides what counts as "the same" OAuth client. A correctly-scoped lookup would resolve a client by some stable identifier and treat two requests for that same identifier as one client, however many irrelevant query parameters get tacked onto the URL. This endpoint didn't do that. It took the caller's identifier exactly as sent, query string included, and used that whole string as the database key. Add a harmless, unused query parameter, and congratulations, you've just described a brand-new "client" as far as the database is concerned.

That alone would be a nuisance. What makes it a real vulnerability is the second part: clients created this way get marked as first-party, a trust level that's meant for n8n's own internal clients and that skips the caps and limits a normal client registration would run into. No authentication gate, no size limit, no expiration, and a label that waves the request past whatever guardrails exist elsewhere. Put those three together and a single unauthenticated caller, in a tight loop, with no special tooling, turns into a disk-filling denial-of-service.

If you can't upgrade right away

n8n's own advisory lists a few stopgaps, worth repeating because none of them closes the hole on its own:

  • Restrict network access to the instance to trusted users and systems only, rather than leaving it reachable from the open internet.
  • Deactivate or reconfigure any workflows using Form Trigger or Chat Trigger nodes that use n8nUserAuth authentication until you've patched, since that's the surface this vulnerable path sits behind.
  • Monitor your database size for unexpected growth and set filesystem-level disk usage alerts, so you catch exploitation in progress rather than finding out when the disk is already full.

Treat all three as a stopgap, not a substitute for patching. The advisory is explicit that none of them fully remediates the risk.

If keeping up with a bi-weekly cadence of advisories like this one isn't something you want to own yourself, a free n8n Cloud trial hands this one, and every future one, to n8n's own team instead.

Disclosure: the n8n Cloud link above is an affiliate link, if you sign up through it, we may earn a commission at no extra cost to you. See our affiliate disclosure for details.

Where to start

Check your version today, whether or not you remember building anything that touches OAuth. Unlike the last two advisories in this series, there's no "if you don't use AI Agent tools, this door isn't open to you" clause here, the only requirement is that your instance answers requests on a network someone else can reach. If you're already running the version checks from the sandbox-escape post or the $fromAI post as part of a regular routine, fold this one into the same habit rather than treating it as a one-off.

Top comments (0)