/

CVE-2026-72775

Severity:

HIGH RISK

(8.8)

SQL Injection (CWE-89) in n8n PostgresTrigger Node

CVE-2026-72775

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized database read and write access

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 high-severity SQL injection vulnerability in n8n's PostgresTrigger node allows authenticated users to influence SQL statements through channel, function, and trigger name parameters.

When the node connects to PostgreSQL using configured credentials, an attacker may inject arbitrary SQL and gain read or write access permitted by those credentials.

Affected context

The vulnerability occurs in n8n workflows that use the PostgresTrigger node and connect to a PostgreSQL database. It becomes risky when an authenticated user can configure or influence the node's identifier parameters, and those values are incorporated into SQL without adequate escaping or parameter-safe handling.

Exploit preconditions

  • Attack surface: n8n workflow configuration through the PostgresTrigger node
  • Required access: An authenticated n8n account with sufficient permissions to create or modify the relevant workflow or node configuration
  • Trigger point: Processing channel, function, or trigger name values while constructing PostgreSQL statements
  • Why exploitation is possible: User-controlled identifiers are interpolated into SQL without reliable escaping or structural validation

Why this happens

The underlying bug is improper neutralization of special elements in SQL commands. The PostgresTrigger node treats user-influenced identifier values as trusted SQL fragments rather than as constrained data, allowing input to alter the intended query structure.

This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Identifier handling requires particular care because standard value parameterization may not apply directly; safe designs must constrain permitted identifiers and construct statements through trusted mechanisms.

Potential impact

  • An attacker may read data accessible to the configured PostgreSQL credential
  • An attacker could modify or delete database records
  • Sensitive application or workflow data may be exposed
  • Database integrity and downstream automation could be disrupted
  • The impact may extend to other systems if the database credential has excessive privileges

General mitigation guidance

Mitigation generally focuses on preventing user-controlled values from becoming executable SQL structure.

Common defensive patterns include:

  • Using parameterized database APIs wherever values are involved
  • Restricting identifier inputs to an explicit allowlist of expected names
  • Constructing dynamic identifiers only through trusted, validated mappings
  • Reducing the privileges of credentials used by workflow database connections
  • Limiting which users can create, edit, or activate database-triggering workflows
  • Separating workflow execution identities from administrative database accounts
  • Applying defense-in-depth controls such as database monitoring and network access restrictions

How teams detect issues like this

Organizations can look for SQL injection risks through:

  • Static analysis rules identifying string interpolation or concatenation in SQL construction
  • Code review checks for user-controlled identifiers passed into database queries
  • Tests using unexpected delimiters and SQL metacharacters in node parameters
  • Runtime monitoring for unusual query patterns, schema access, or write activity
  • Policy enforcement requiring parameterized queries or approved identifier-mapping helpers
  • Automated security review tools that flag unsanitized database query construction

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-jqwr-vx3p-r266
vulncheck.comvulncheck.com/advisories/n8n-before-sql-injection-via-postgrestrigger-node

Frequently asked

questions

It may be exploitable through the n8n interface or API when an attacker has authenticated access that permits modification of the affected workflow or node configuration. The exact exposure depends on n8n access controls and deployment architecture.

The attacker generally needs authenticated permissions to configure or influence the PostgresTrigger node. The resulting database access is limited or expanded according to the privileges of the configured PostgreSQL credential.

Avoid interpolating user-controlled input into SQL. Use parameter-safe APIs for values and strict allowlists or trusted mappings for dynamic identifiers.

Apply least-privilege database accounts, restrict workflow editing permissions, review dynamic query construction, and include SQL injection tests and static analysis in the development process.

Find out what's already
exploitable in your codebase.