/

CVE-2026-44792

Severity:

CRITICAL RISK

(9.0)

SQL Injection (CWE-89) via n8n Source Control Data Table

CVE-2026-44792

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database Compromise and Remote Code Execution (via SQL)

Severity:

CRITICAL RISK

(9.0)

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

n8n's Source Control feature can be abused to inject crafted Data Table JSON that results in SQL injection against the internal PostgreSQL database.

If an attacker can write to the connected git repository and an administrator pulls those changes, malicious column names may be executed as SQL, potentially compromising the instance and its data.

Affected context

This vulnerability appears in n8n deployments that:

  • Use PostgreSQL as the database backend
  • Have Source Control enabled and connected to a writable git repository
  • Import Data Table workflow assets from version-controlled JSON files

It manifests when column names from these JSON files are interpolated into SQL queries without robust validation or sanitization. The issue is triggered only when an administrator initiates a Source Control Pull, so environments without this feature or workflow are less exposed.

Exploit preconditions

  • Attack surface: n8n Source Control pull operation that imports Data Table JSON from a git repository.
  • Required access: Ability to commit changes to the git repository configured in n8n Source Control; no direct access to n8n's database required.
  • Trigger point: An administrator performs a Source Control Pull, causing n8n to deserialize the Data Table JSON and construct SQL using attacker-controlled column names.
  • Why exploitation is possible: The application builds SQL statements directly from JSON-defined column metadata without strict validation or safe query construction, allowing crafted column names to alter the intended SQL logic.

Why this happens

The core issue is the use of untrusted metadata to dynamically construct SQL queries without enforcing strict separation between data and query syntax. Data Table column names from JSON configuration are treated as safe identifiers and interpolated into SQL statements in a way that lets attackers inject arbitrary SQL fragments.

This aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection). Instead of using parameterized queries and vetted identifier lists, the code path trusts repository-sourced JSON as configuration, blurring the boundary between configuration and executable query structure.

Potential impact

  • Attackers may read sensitive workflow and user data stored in PostgreSQL.
  • Malicious SQL could modify or delete Data Tables and other application records.
  • SQL injection can lead to privilege escalation within the application's data layer.
  • In some setups, attackers could execute database-level functions that may enable further system compromise.

General mitigation guidance

Effective mitigation focuses on treating all repository-sourced configuration as untrusted input and enforcing safe query construction patterns. Recommended approaches include:

  • Using parameterized queries for all dynamic data values and avoiding direct string concatenation of identifiers where possible.
  • Restricting accepted column names to an explicit allowlist or validating them against a strict schema before building queries.
  • Introducing a layer that normalizes or maps logical column names from JSON to internal, pre-defined identifiers rather than using raw values.
  • Running the database with least-privilege credentials so that even if a query is abused, accessible operations are minimized.
  • Designing Source Control import logic to fail closed when configuration metadata contains unexpected characters or shapes that could impact query syntax.

How teams detect issues like this

Detection generally involves identifying insecure SQL construction patterns around configuration-driven metadata and monitoring for anomalous repository changes:

  • Static analysis rules targeting dynamic SQL creation that use column or table names derived from JSON or other configuration files.
  • Code reviews that flag any use of unvalidated identifiers in SQL strings and ensure parameterization of values.
  • Policies that require schemas and allowlists for configuration-driven Data Tables, enforced during pull requests and CI pipelines.
  • Runtime monitoring and database logging to detect unusual or highly-privileged queries triggered immediately after Source Control pulls.
  • Optional use of automated security scanning tools integrated with the n8n codebase and workflows to highlight SQL injection-prone patterns.

Sources

SourceLink
github.comgithub.com/n8n-io/n8n/security/advisories/GHSA-mhrx-qhrj-673w

Frequently asked

questions

Exploitation is limited to environments where Source Control is enabled and linked to a repository the attacker can write to, and where PostgreSQL is used as the backend. It is not exploitable in isolation without these conditions.

An attacker must be able to push commits to the git repository configured for n8n Source Control. They do not need direct access to the n8n interface or database, but administrator interaction (a Source Control Pull) is required to trigger the import.

The safest pattern is to eliminate any direct construction of SQL from untrusted column metadata, enforcing strict validation of identifiers and using parameterized queries wherever dynamic content is involved. Configuration-driven structures should be mapped to predefined schema elements rather than executed as-is.

Future prevention relies on treating all external configuration sources (such as git repositories) as untrusted, enforcing schema validation, restricting allowed identifiers, and mandating parameterized query patterns. Complement this with robust code review, static analysis rules for dynamic SQL, and security-focused checks in CI pipelines for data-driven query construction.

Find out what's already
exploitable in your codebase.