The vulnerability, identified as GHSA-jxx9-px88-pj69, is an improper access control issue within the n8n-mcp package affecting multi-tenant deployments. The root cause is the system's failure to enforce the presence of tenant-specific headers (x-n8n-url, x-n8n-key) on incoming requests when multi-tenancy is enabled. When these headers are omitted, the application would silently and improperly fall back to using the operator's high-privilege credentials configured at the process level (i.e., from environment variables N8N_API_URL and N8N_API_KEY).
This flaw allows an authenticated tenant to escalate their privileges to that of the operator. By sending a request without the tenant headers, an attacker could trigger the getN8nApiClient function to generate an API client using the operator's credentials. This would grant the attacker the ability to read and write sensitive data, including workflows, executions, and credentials, on the operator's n8n instance, potentially leading to remote code execution.
The patch addresses this vulnerability by implementing a "fail-closed" approach. Firstly, the HTTP request handler in SingleSessionHTTPServer now explicitly rejects any request in multi-tenant mode that lacks the required headers, returning an HTTP 400 error. Secondly, the getN8nApiClient function was modified to refuse to fall back to environment credentials when in multi-tenant mode. Additional fixes were implemented in several other handlers (handleHealthCheck, handleDiagnostic, etc.) to prevent the operator's configuration details from being leaked in responses to tenants.