NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · n8n

CVE-2026-44792: n8n Has a Source Control Pull SQL Injection

highCVSS 4.0 8.9 · 3.1 9.0GHSA-mhrx-qhrj-673w

n8n's Source Control Pull imports Data Table JSON files without safe handling of column names. Someone with write access to the connected git repository can plant a crafted column name and, when an administrator pulls, inject SQL into n8n's PostgreSQL database. Fixed in n8n 1.123.43, 2.20.7 and 2.21.1.

Published May 14, 2026 · Updated Jul 20, 2026 · Analysis Oct 27, 2026

What an attacker can do

The attack runs through the git repository, not through n8n's own login. The attacker commits a Data Table JSON file whose column name holds SQL. Nothing happens until an administrator runs a Source Control Pull. Then n8n imports the file and the column name reaches the internal PostgreSQL database as SQL (CWE-89). The scores reflect the required user action: the CVSS 4.0 vector has UI:A and attack requirements present.

The advisory sets three conditions, all of which must hold: n8n uses PostgreSQL, Source Control is enabled and connected to a repository the attacker can write to, and an admin pulls. SQLite instances are outside the conditions. When they hold, the injected SQL runs against n8n's own database, which stores workflows, users and encrypted credentials. The changed-scope rating in CVSS 3.1 reflects that reach. In practice this matters to teams whose Source Control repo has many contributors, or a repo reachable through a compromised developer account or a malicious pull request merged without review.

Who is affected

n8n on npm below 1.123.43, from 2.0.0-rc.0 up to before 2.20.7, and 2.21.0 up to before 2.21.1. Only instances that use PostgreSQL with Source Control enabled are exposed. Check the version and the database type:

npm ls n8n

The database type is set by the DB_TYPE environment variable (postgresdb for PostgreSQL). Check Settings, then Environments, for Source Control.

n8n

Ecosystem
npm
Affected
< 1.123.43
Fixed in
1.123.43
Check
npm ls n8n

n8n

Ecosystem
npm
Affected
>= 2.21.0, < 2.21.1
Fixed in
2.21.1
Check
npm ls n8n

n8n

Ecosystem
npm
Affected
>= 2.0.0-rc.0, < 2.20.7
Fixed in
2.20.7
Check
npm ls n8n

How to fix it

Upgrade to n8n 1.123.43, 2.20.7 or 2.21.1, or later:

npm install -g [email protected]

The advisory's temporary measures, which it says do not fully remediate the risk: disable Source Control if you do not need it, limit write access to the connected repository to fully trusted users, and avoid pulling from repositories that untrusted parties may have changed.

How to tell if you were hit

Review the git history of the connected repository for recent commits to Data Table JSON files, and read their column names for quotes, semicolons, SQL keywords or comment markers. Check who made those commits. In PostgreSQL logs, look for errors or unusual statements around the time of an administrator's Source Control Pull. Audit the n8n database for new users, changed credentials or new tables after a pull.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

An attacker with write access to the git repository connected to an n8n Source Control configuration could commit a malicious Data Table JSON file containing a crafted column name. When an administrator performed a Source Control Pull, n8n imported the file and could lead to SQL injection on the internal PostgreSQL instance.

Exploitation requires all of the following conditions:

  • The n8n instance uses PostgreSQL as its database backend.
  • The Source Control feature is enabled and connected to a repository the attacker can write to.
  • An administrator triggers a Source Control Pull.

Patches

The issue has been fixed in n8n version 1.123.43, 2.20.7, and 2.21.1. Users should upgrade to this version or later to remediate the vulnerability.

Workarounds

If upgrading is not immediately possible, administrators should consider the following temporary mitigations:

  • Disable the Source Control feature if it is not actively required.
  • Restrict write access to the connected git repository to fully trusted users only.
  • Avoid pulling from repositories that may have been modified by untrusted parties.

These workarounds do not fully remediate the risk and should only be used as short-term mitigation measures.

Credited to sm1ee.

Questions

Is CVE-2026-44792 exploitable on SQLite?

The advisory requires PostgreSQL as the database backend. It lists that as one of three conditions that must all be met.

Does it need an administrator to do something?

Yes. The injection fires when an administrator performs a Source Control Pull of the repository containing the crafted file.

Which versions are fixed?

1.123.43, 2.20.7 and 2.21.1, or later. Note the 2.21 line is fixed at 2.21.1, not 2.22.1.

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 entries