/

CVE-2026-54687

Severity:

CRITICAL RISK

(9.8)

Path Traversal (CWE-22) in n8n SQLite Database Node

CVE-2026-54687

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized File Read and Write

Severity:

CRITICAL RISK

(9.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 path traversal vulnerability in the n8n SQLite node allows database file paths to be supplied through workflow expressions derived from untrusted input. In affected workflows, an attacker may cause the n8n process to open, read from, create, or overwrite SQLite or other files outside the intended database directory.

Affected context

The issue occurs when the SQLite node accepts a database path through a data expression and that expression can be influenced by untrusted workflow input. Risk is highest when a workflow is remotely reachable, processes attacker-controlled values, and the n8n process has access to sensitive or writable files beyond the intended database location.

Exploit preconditions

  • Attack surface: An n8n workflow using the SQLite node with a configurable database path
  • Required access: Ability to submit or influence input consumed by the workflow; the workflow author must have mapped that input to db_path
  • Trigger point: SQLite node execution when the supplied path is opened by the n8n process
  • Why exploitation is possible: The path is evaluated from untrusted workflow data without sufficient restriction to an approved database directory
  • Environmental dependency: The targeted files must be accessible or writable by the n8n process

Why this happens

The underlying bug is insufficient validation and confinement of a filesystem path derived from untrusted input. A node parameter intended to identify a local SQLite database accepts dynamic expressions without reliably enforcing an allowed base directory or rejecting traversal components. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because attacker-influenced path data can escape the intended filesystem boundary.

Potential impact

  • An attacker may read sensitive SQLite databases or other accessible files.
  • An attacker could create or overwrite files writable by the n8n process.
  • Workflow data, credentials, or application state may be exposed or modified.
  • File manipulation could cause denial of service or workflow disruption.
  • A subsequent vulnerability or unsafe file-loading behavior could increase the impact.

General mitigation guidance

Mitigation generally focuses on removing attacker control over filesystem locations and enforcing filesystem boundaries.

Common defensive patterns include:

  • Resolve database paths against a fixed, approved directory and reject paths that escape it.
  • Prefer server-side database identifiers or an allowlist over arbitrary path parameters.
  • Treat workflow expressions and upstream values as untrusted, even when they originate within a trusted workflow.
  • Validate canonical paths before opening files and reject traversal, absolute-path, and unexpected-link cases.
  • Run n8n with least-privilege filesystem permissions and isolate workflow data from sensitive host files.
  • Use dedicated storage locations and restrict write access to only the files required by the node.

How teams detect issues like this

Detection can combine source review, runtime monitoring, and policy enforcement:

  • Use static analysis to identify filesystem APIs receiving values from workflow expressions or request-derived data.
  • Review node parameters that permit dynamic path expressions, especially those passed to database-opening or file-writing APIs.
  • Add tests for traversal sequences, absolute paths, symbolic-link escapes, and paths outside the approved directory.
  • Monitor n8n processes for unexpected file access, creation, or modification outside designated workflow storage.
  • Enforce organization-wide policies that prohibit arbitrary filesystem paths in remotely influenced workflow inputs.
  • Automated code review and dependency scanning tools may help identify path-construction and boundary-validation weaknesses.

Sources

SourceLink
github.comgithub.com/DangerBlack/n8n-node-sqlite3/commit/145a8876ff12375813bdcd4ae4fe78f460c53a98
github.comgithub.com/DangerBlack/n8n-node-sqlite3/pull/25
github.comgithub.com/DangerBlack/n8n-node-sqlite3/security/advisories/GHSA-q7m3-rhxg-7vxr

Frequently asked

questions

Potentially. Remote exploitation depends on whether an attacker can submit input to a reachable n8n workflow that maps untrusted data to the SQLite database path.

Not necessarily. The key requirement is influence over the workflow input or execution context; the targeted files must also be accessible to the n8n process.

Do not allow arbitrary workflow data to select filesystem paths. Use approved database identifiers or confine canonicalized paths to a dedicated, allowlisted directory.

Treat expression-derived paths as untrusted, test boundary enforcement, apply least-privilege filesystem permissions, and monitor for unexpected file access.

Find out what's already
exploitable in your codebase.