n8n Source Control can inject SQL through malicious Data Table files

HighSE Fix-First Score 43/100CVE-2026-44792SE-AIV-01802Injection into a database or queryAI softwareMade public 14 May 2026

Download as PDF

What this means

An attacker with write access to a git repository connected to n8n could inject SQL code into the database. When an administrator pulls from that repository, n8n could execute the malicious SQL against the internal PostgreSQL database. This could lead to unauthorized data access, modification, or deletion.

SecurityElites Manager Brief: the decision in one minute

n8n can be tricked into running malicious SQL commands if someone with git write access commits a crafted file and an admin pulls it. This affects n8n instances that use PostgreSQL and have Source Control enabled. You need to upgrade or restrict who can write to that repository immediately.

SecurityElites Fix-First Score43 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 30 days
High severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixPlatform engineering or infrastructure team.
Likely effortAbout 30 minutes per n8n instance: check the version, upgrade to the fixed release, and restart the service. It could take longer if you have many instances or if restarting causes downtime.

Questions to ask your team or supplier

  • Who has write access to the git repository connected to our n8n Source Control, and are all of them fully trusted?
  • Do we have database audit logging enabled so we can detect if this vulnerability was exploited before we patched it?

Message you can forward to the owning team

Security notice: n8n Source Control can inject SQL through malicious Data Table files (CVE-2026-44792)

Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to n8n 2.21.1 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2026-44792-n8n-source-control-can-inject-sql-through-malicious-data/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01802

What is at stake in your AI setup

  • Internal n8n database: an attacker could read, modify, or delete stored workflows, credentials, and execution history.
  • Workflow credentials and API keys: SQL injection could expose stored integration keys and authentication tokens used by n8n workflows.
  • Execution logs and data: sensitive input data, outputs, and logs from workflow runs could be accessed or deleted.

Map where your company uses AI

Who is exposed

  • n8n instances running version 1.123.42 or earlier that use PostgreSQL and have Source Control enabled.
  • n8n instances running version 2.0.0-rc.0 through 2.20.6 with PostgreSQL and Source Control enabled.
  • n8n instances running version 2.21.0 (the first 2.21.x release) with PostgreSQL and Source Control enabled.
  • Teams with write access to git repositories connected to n8n, if they are not fully trusted.

Upgrades you need

SoftwareAffected versionsMove to
n8n
npm
Every version before 1.123.43; 2.21.0 up to, but not including, 2.21.1; 2.0.0-rc.0 up to, but not including, 2.20.72.21.1 or later

Each maintained branch has its own fixed version. Stay on your branch if you cannot jump to the newest: n8n 1.123.43, 2.20.7, 2.21.1.

Am I affected?

Enter the version you run. Nothing you type is stored.

SecurityElites Developer Brief: the technical picture

Is it being attackedNo known attacks and no public attack code when CISA last reviewed it
Where the attacker must beAnywhere that can reach it over a network, including the internet if it is exposed
Account neededAn ordinary user account
Does a person have to do somethingYes. Someone has to click, open or approve something
How hard it is to doEasy. It works reliably once the attacker can reach it
Risk of: data being readHigh
Risk of: data or settings being changedHigh
Risk of: the service being taken downHigh
Can attackers automate it at scaleNo, according to CISA. Each target needs manual work
How much control an attacker gainsTotal control of the affected software, according to CISA

Read from the official severity rating: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H

Kind of coding mistake

  • CWE-89: database queries can be injected

If you cannot upgrade today

  • Disable the Source Control feature in n8n settings if it is not actively used.
  • Restrict write access to the connected git repository to only fully trusted administrators or service accounts.
  • Avoid triggering Source Control Pulls from repositories that may have been modified by people outside your organization.

Signs it may already have been used against you

  • PostgreSQL logs: search for unexpected SQL errors, syntax errors in queries, or failed queries from the n8n user around the time of Source Control Pulls.
  • n8n application logs: look for errors or warnings during Source Control Pull operations, especially around Data Table imports.
  • Git commit history: review recent commits to the connected repository for Data Table JSON files (usually in .n8n/data/database folder or similar) with unusual or suspicious column names.
  • Database audit logs: if enabled, check for unauthorized SELECT, INSERT, UPDATE, or DELETE statements that coincide with Source Control Pull events.

Log searches to start from

PostgreSQL errors during n8n operations (adapt field names for your logs)Splunk

source=postgresql_logs (error OR failed) n8n | search "Data Table" OR "source_control" OR "Pull" | table timestamp, message

n8n Source Control Pull events with errors (adapt field names for your logs)Elastic

application:n8n AND event:"source_control_pull" AND (status:error OR status:failed) | fields @timestamp, error_message, repository_name

Written with AI as a starting point. Review them and change the index and field names to match your own logs before you rely on the result.

SecurityElites Fix Guide: step by step

  1. Find where n8n is installedLog in to the server or container where n8n runs. Run `npm list n8n` or check the package.json file in your n8n installation directory to find the current version.
  2. Check if PostgreSQL is in useLook at the n8n configuration or environment variables (often in a .env file or Docker config). Search for the database connection string or DB_TYPE setting. Confirm it says PostgreSQL or postgres.
  3. Check if Source Control is enabledIn the n8n web interface, go to Settings and look for Source Control configuration. Check if a git repository is connected and what its status is.
  4. Upgrade n8n to the fixed versionRun `npm install n8n@1.123.43` for the 1.x line, `npm install n8n@2.20.7` for the 2.20.x line, or `npm install n8n@2.21.1` for the 2.21.x line. Use the version that matches your current major.minor line. For Docker users, update the image tag to the same fixed version and restart the container.
  5. Restart the n8n serviceStop and start the n8n process or container. If you use systemd, run `systemctl restart n8n`. If you use Docker, run `docker restart [container-name]`. Wait for it to fully start before moving to the next step.
  6. Verify the upgrade workedLog in to the n8n web interface and go to Help (usually a ? icon) or Settings to find the version number. Confirm it shows 1.123.43, 2.20.7, 2.21.1, or later.
  7. Check git repository write accessReview who has write permissions to the git repository connected to n8n Source Control. Remove or restrict access for any accounts that are not needed or not fully trusted.
  8. Look for signs of previous exploitationCheck the n8n database logs and PostgreSQL logs for any unusual SQL queries or errors around the times when Source Control Pulls happened. Look for SQL errors or unexpected data changes in the period before this patch was applied.

How to confirm it is fixed: Log in to the n8n web interface, go to Help or Settings, and confirm the version number is 1.123.43, 2.20.7, 2.21.1, or later.

SecurityElites Quick Fixes: copy and paste

Upgrade n8n with npmupgrade

npm install n8n@2.21.1
npm ls n8n

Check n8n version on Node.js / npmfor this issue

npm list n8n

Check n8n version inside a running containerfor this issue

docker exec [container-name] npm list n8n

Pass values as parameters (Python)general hardening

cur.execute("SELECT * FROM items WHERE id = %s", (item_id,))

Test in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.

Let your AI coding assistant do the upgrade

Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.

Instruction for your coding assistant

You are helping me fix a security vulnerability (CVE-2026-44792) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n   - n8n (npm): must be 2.21.1 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.

SecurityElites Incident Drill: could your team handle this?

Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.

What three conditions must all be true for this vulnerability to be exploitable?A good answer: PostgreSQL must be the database backend, Source Control must be enabled and connected to a repository, and an attacker must have write access to that repository and trigger an admin to pull from it.
What versions of n8n are fixed for this issue?A good answer: Version 1.123.43 or later in the 1.x line, version 2.20.7 or later in the 2.20.x line, and version 2.21.1 or later in the 2.21.x line.
If we cannot upgrade immediately, what is the most effective short-term step?A good answer: Disable Source Control if it is not actively needed, or restrict write access to the connected repository to only fully trusted users.
How would an attacker get their malicious file into n8n?A good answer: They would commit a specially crafted Data Table JSON file with a malicious column name to the git repository, then wait for an administrator to trigger a Source Control Pull, which would import and execute the malicious SQL.

Run a full timed drill with your team

Ticket for your backlog

Paste into Jira, GitHub Issues or any tracker that reads Markdown.

Ready-made ticket

## n8n Source Control can inject SQL through malicious Data Table files (CVE-2026-44792)

**Severity:** High  |  **SE Fix-First Score:** 43/100  |  **Fix window:** Within 30 days
**Record:** SE-AIV-01802 https://securityelites.com/ai-vulnerabilities/cve-2026-44792-n8n-source-control-can-inject-sql-through-malicious-data/

### Why this matters
An attacker with write access to a git repository connected to n8n could inject SQL code into the database. When an administrator pulls from that repository, n8n could execute the malicious SQL against the internal PostgreSQL database. This could lead to unauthorized data access, modification, or deletion.

### What to do
1. Find where n8n is installed
2. Check if PostgreSQL is in use
3. Check if Source Control is enabled
4. Upgrade n8n to the fixed version
5. Restart the n8n service
6. Verify the upgrade worked
7. Check git repository write access
8. Look for signs of previous exploitation

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-44792-n8n-source-control-can-inject-sql-through-malicious-data/

### Done when
- [ ] n8n is at 2.21.1 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Log in to the n8n web interface, go to Help or Settings, and confirm the version number is 1.123.43, 2.20.7, 2.21.1, or later.
- [ ] Logs were checked for signs of earlier use

SecurityElites Fix Tracker

Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.

Sign in to track this fix

Change history

  • 14 May 2026: Made public
  • 2 Dec 2026: Published

Official record

## 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.

Weakness type: CWE-89

Use this record in your own tools

Get this record as JSON

curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-44792

For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker

The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 3 Dec 2026. Read the vendor advisory before changing a production system.