/

CVE-2026-77080

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in n8n Snowflake Node

CVE-2026-77080

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary File Read and Write

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A command-injection-related file access flaw in the n8n Snowflake node allows authenticated users with usable Snowflake credentials to pass free-form query content, including client-side commands, directly to the Snowflake SDK. Under those conditions, an attacker may upload a local file from the n8n host or overwrite an existing file with a staged file.

Affected context

The vulnerability occurs in n8n workflows that use the Snowflake node to execute free-form queries through the Snowflake SDK. It becomes risky when an authenticated n8n user can invoke the node, has usable Snowflake credentials, and the SDK interprets client-side commands that can access the n8n host filesystem without n8n's normal file-access restrictions.

Exploit preconditions

  • Attack surface: The n8n Snowflake node and its free-form Execute Query input
  • Required access: An authenticated n8n user with permission to use the relevant workflow or node and usable Snowflake credentials
  • Trigger point: Execution of Snowflake query content containing supported client-side file operations
  • Why exploitation is possible: The node passes unrestricted query input directly to the Snowflake SDK, allowing SDK-level file behavior to bypass application-layer file-access controls

Why this happens

The underlying issue is insufficient restriction of user-controlled command-like input before it reaches a downstream SDK. The Snowflake node accepts free-form Execute Query content and forwards it without filtering or separating server-side SQL from client-side commands that can access local files. This behavior is consistent with CWE-78: Improper Neutralization of Special Elements used in an OS Command, because untrusted input can influence command or command-like execution semantics in a privileged application context.

Potential impact

  • An attacker could read files accessible to the n8n process
  • An attacker could upload local files from the n8n host
  • An attacker could overwrite existing files with staged content
  • Workflows, credentials, configuration, or application data could be exposed or altered
  • File tampering could contribute to broader compromise depending on process privileges and deployment controls

General mitigation guidance

Mitigation generally focuses on reducing trust in free-form query input and preventing client-side command semantics from reaching the SDK.

Common defensive patterns include:

  • Prefer structured query APIs or parameterized operations over unrestricted query text
  • Separate server-side SQL execution from client-side command handling
  • Disable or reject client-side file commands when they are not required
  • Enforce explicit command and path allowlists at the application boundary
  • Apply strict filesystem permissions and run n8n with a dedicated least-privilege identity
  • Use isolated workspaces or sandboxes for any required file-transfer operations
  • Limit Snowflake credential permissions and avoid sharing credentials across unrelated workflows
  • Treat workflow authors and query inputs as untrusted unless their access is explicitly governed

How teams detect issues like this

Detection can combine static analysis, code review, and runtime policy controls:

  • Search for nodes that forward free-form query text directly into database or SDK execution APIs
  • Review whether client-side commands and file-transfer directives are parsed, filtered, or allowlisted
  • Flag file operations whose paths originate from workflow inputs or user-controlled fields
  • Monitor n8n executions and Snowflake client logs for unexpected file upload, download, or overwrite activity
  • Enforce policies requiring structured database operations and rejecting unrestricted command-capable inputs
  • Use automated code review or security scanning tools to identify dangerous data flows into command and SDK interfaces

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-r4j2-j3wm-q689
vulncheck.comvulncheck.com/advisories/n8n-before-arbitrary-file-read-and-write-via-snowflake

Frequently asked

questions

It can be exploitable through the n8n interface or an exposed workflow execution path when the attacker is authenticated and can use the affected Snowflake node.

The attacker generally needs permission to execute or modify a workflow that invokes the Snowflake node, along with usable Snowflake credentials. The resulting file access depends on the n8n process's operating-system permissions.

Avoid passing unrestricted query text to command-capable SDK interfaces. Use structured operations, restrict client-side commands, and enforce path and operation allowlists before execution.

Minimize workflow privileges, isolate file-transfer functionality, apply least-privilege filesystem and database permissions, and monitor for unexpected file operations originating from query execution.

Find out what's already
exploitable in your codebase.