CVE-2026-54310: n8n: SQL Injection in Postgres v1/TimesclaeDB Nodes
The legacy Postgres v1 node and the TimescaleDB node in n8n let a user with workflow edit rights inject SQL through crafted parameters. The SQL runs on the connected database with the configured account's privileges. Fixed in n8n 2.25.7 and 2.26.2.
Published Jun 16, 2026 · Updated Jul 20, 2026 · Analysis Nov 2, 2026
What an attacker can do
These two nodes build SQL from node parameters in a way that lets input change the statement itself. The advisory does not name the exact parameter or code path. An authenticated user who can create or modify workflows can craft those parameters and run arbitrary SQL against the database the node is connected to.
The limit is the database account stored in the n8n credential. If that account can read every table, so can the attacker. If it can write or drop, so can the attacker. Many n8n setups use a broad account for convenience, which makes this serious.
The advisory scores n8n itself as unaffected and the connected database as highly affected for confidentiality, integrity and availability. That explains the gap between the 3.1 score of 9.9, where scope is changed, and the 4.0 score of 6.5. The attacker needs an n8n login with workflow permissions. Anyone who can import or edit workflows counts. Data fed into the node by outside parties is not described as the trigger in the advisory.
Who is affected
n8n on npm below 2.25.7, and versions 2.26.0 and 2.26.1. Only workflows that use the TimescaleDB node or the legacy Postgres v1 node are in scope. Check your version:
npm ls n8nThen list workflows using those nodes and the database credentials attached to them.
n8n
- Ecosystem
- npm
- Affected
- >= 2.26.0, < 2.26.2
- Fixed in
- 2.26.2
- Check
npm ls n8n
n8n
- Ecosystem
- npm
- Affected
- < 2.25.7
- Fixed in
- 2.25.7
- Check
npm ls n8n
How to fix it
Upgrade to n8n 2.25.7 or 2.26.2, or later.
npm install -g [email protected]Temporary measures from the advisory, which it says do not fully remove the risk: limit workflow creation and editing to fully trusted users, or add n8n-nodes-base.postgres and n8n-nodes-base.timescaleDb to the NODES_EXCLUDE environment variable. Also consider narrowing the privileges of the database accounts those credentials use.
How to tell if you were hit
The advisory lists no indicators. Turn on statement logging on the Postgres or TimescaleDB server and look for queries from the n8n credential's account that do not match your workflows, such as access to information_schema, pg_catalog, unfamiliar tables, or stacked statements. Review workflow edit history for recent changes to Postgres v1 or TimescaleDB nodes by non-admin users.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
An authenticated user with permission to create or modify workflows could supply a crafted parameters to the TimescaleDB and/or legacy Postgres v1 node's allowing arbitrary SQL to be injected and executed against the connected database within the privileges of the configured database account.
Patches
The issue has been fixed in n8n versions 2.25.7, and 2.26.2. Users should upgrade to one of these versions or later to remediate the vulnerability.
Workarounds
If upgrading is not immediately possible, administrators should consider the following temporary mitigations:
- Limit workflow creation and editing permissions to fully trusted users only.
- Disable the Postgres and TimescaleDB node by adding
n8n-nodes-base.postgres,n8n-nodes-base.timescaleDbto theNODES_EXCLUDEenvironment variable.
These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.
Credited to sm1ee.
Questions
- Does CVE-2026-54310 affect the current Postgres node?
The advisory names the legacy Postgres v1 node and the TimescaleDB node. It does not name later Postgres node versions. Upgrade to 2.25.7 or 2.26.2 or later regardless.
- Why is the CVSS 3.1 score 9.9 but the 4.0 score 6.5?
The 3.1 vector marks scope as changed with high impact on the database. The 4.0 vector puts the high impact on the subsequent system and none on n8n. Both require a low-privilege n8n login.
- Can an unauthenticated user exploit CVE-2026-54310?
No. The advisory says the attacker must be an authenticated user who can create or modify workflows.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More n8n vulnerabilities
All n8n entriesCVE-2026-86073
n8n: Per-Resource OAuth Consent Bypass via Unbound Refresh Token Resource Substitution
medium5.9Sep 10, 2026CVE-2026-86074
n8n: Instance AI Credential Setup Accepts Unvalidated Probe URL from Fetched Content
medium5.9Sep 10, 2026CVE-2026-86075
n8n: Unauthenticated Persistent Storage Exhaustion via OAuth Dynamic Client Registration Endpoint
high8.7Sep 10, 2026CVE-2026-86076
n8n: Expression Sandbox Escape via Class-Field Sanitizer Rebinding Can Lead to Code Execution
high8.7Sep 10, 2026CVE-2026-86077
n8n: Anonymous Approval-Gate Bypass via Reused resumeToken over the Chat WebSocket
medium6.3Sep 10, 2026CVE-2026-86078
n8n: Prototype Pollution via Workflow Structure Summary Can Lead to Denial of Service
medium6.0Sep 10, 2026
