إرسال #1075029: n8n-io n8n >= 2.28.0 <= 2.46.6 Race Conditionالمعلومات

عنوانn8n-io n8n >= 2.28.0 <= 2.46.6 Race Condition
الوصفn8n resolves production webhook paths through a database primary key, but the check that a path is free and the installation of that path are not atomic. An authenticated low-privilege user can hijack another user's production webhook path by racing workflow activation. When a workflow is activated, n8n (1) checks synchronously whether the webhook path is already taken, then (2) installs the webhook later, in a background outbox worker. Two different workflows claiming the same path both pass the check (neither row is inserted yet) and both activations return success; whichever worker's apply inserts the primary-key row first wins the path, regardless of which user requested activation first. Root cause (verified at tag [email protected], commit bb72d756104542adb549b6966a57e21459bd52a2): - packages/cli/src/workflows/workflow.service.ts: _detectWebhookConflicts() runs the conflict check synchronously during the activate request; activation then enqueues an outbox record (_publishViaOutbox) applied later by a pool of concurrent workers. - packages/cli/src/workflows/publication/workflow-publication-applier.ts: advancePublishedVersion() marks the workflow active/advances the version BEFORE activate() installs the trigger; a primary-key conflict on webhook_entity is caught and returned as a failed result, with no rollback of active/activeVersionId. - The per-workflow lifecycle lock does not serialize two different workflows contending for the same path; the database primary key is the only thing preventing dual ownership. - publication-status-reporter.ts now pushes a "failed to activate" notice to connected clients, but still does not roll back the losing workflow's active state. Impact: every delivery to the contested webhook path (e.g. /webhook/payments) executes the attacker's workflow from then on. The attacker controls the HTTP response returned to the sender, and the payloads commonly contain sensitive data (payment events, signing secrets, push tokens, PII). The victim's workflow continues to display active=true with no error, and the stolen deliveries appear only in the attacker's execution history. Proof of concept (live, reproduced end-to-end on n8nio/n8n:2.46.6 and 2.42.0): an instance owner (victim) and a plain member (attacker) each own a workflow whose Webhook node claims the same path "sharedpoc"; the victim's responds VICTIM-RESPONSE, the attacker's responds PWNED-BY-ATTACKER. The attacker activates ~50 ms after the victim. Within two rounds, GET /webhook/sharedpoc returns PWNED-BY-ATTACKER, the webhook registry lists the attacker's workflow as the path owner, and both workflows report active=true (silent failure for the victim). CWE-367 (Time-of-check Time-of-use Race Condition). CVSS 4.0 base 7.6 (High): CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N. Distinct from GHSA-4c7j-qff5-r9cx (unauthenticated cross-project webhook execution via path-only resolution, fixed 2.42.1): that is a request-time resolution flaw; this is an activation-time TOCTOU race, which remains present in the current 2.46.6 release (demonstrated by the fact that 4c7j's fix shipped yet this race still succeeds). Remediation: perform the conflict check at the moment the webhook is installed (inside the applier, under a lock that is global per path, not per workflow), and on install failure roll back the workflow's active/activeVersionId instead of leaving it active. Tested exclusively against a local, self-hosted instance per n8n's VDP testing guidelines; no cloud or third-party assets were touched.
المصدر⚠️ https://drive.google.com/drive/folders/1Ix0jngGZjAlua_V6oV8S0lFFS_J6XY4J?usp=sharing
المستخدم
 Chamal Bandara (UID 102762)
ارسال04/11/2026 10:28 PM (28 أيام منذ)
الاعتدال02/12/2026 11:40 AM (28 days later)
الحالةتمت الموافقة
إدخال VulDB447695 [n8n-io n8n حتى 2.50.5 Webhook workflow-publication-applier.ts publish حالة سباق]
النقاط20

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!