Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAuthenticate as NocoDB creator/owner
-
DeliverySelect Postgres-backed base
-
ExploitCreate formula column with malicious ARRAYSORT direction payload
-
InstallPayload bypasses sanitize() and embeds in knex.raw ORDER BY clause
-
C2Injected SQL executes on column creation
-
ExecuteInjected SQL re-executes on every formula column read
-
ImpactDatabase DoS or data access achieved
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Persistence The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires an authenticated NocoDB session with |
| Impact | The CVSS 6.0 score with vector AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:H reflects the key tension in this vulnerability: it is network-reachable with low complexity, but gated behind high-privilege authentication (PR:H), requiring a creator or owner-level role with explicit |
| Exploit ScenarioDerived | An authenticated NocoDB creator on a Postgres-backed base adds a formula column using |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 05, 2026
SQL injection in NocoDB's Postgres formula engine exposes authenticated creators to arbitrary SQL execution via the unvalidated direction argument of the ARRAYSORT(...) formula function. All NocoDB instances on npm/nocodb versions prior to 2026.04.1 using Postgres-backed bases are affected; MySQL and SQLite backends are not. An attacker holding creator/owner-level columnAdd permission can inject persistent SQL that executes during column creation and re-executes on every subsequent read of the formula column, enabling confirmed denial-of-service and potentially broader data access depending on database-level permissions. No public exploit identified at time of analysis; this vulnerability is not listed in CISA KEV.
RemediationAI
Upgrade NocoDB to version 2026.04.1 or later - vendor-released patch confirmed via GitHub release https://github.com/nocodb/nocodb/releases/tag/2026.04.1 and advisory GHSA-cxv7-gmmp-228p at https://github.com/nocodb/nocodb/security/advisories/GHSA-cxv7-gmmp-228p. If immediate upgrade is not feasible, restrict columnAdd permission exclusively to highly trusted administrators, reducing the accounts that can reach the vulnerable code path; this does not eliminate the injection vector but limits exposure. As an additional compensating control, reduce the NocoDB database user's Postgres permissions - for example, revoke access to resource-intensive functions like generate_series - to bound the DoS impact and constrain potential data access from broader SQL injection. Note that permission restrictions are not a substitute for patching, as the root injection vector remains present. Self-hosted operators should also audit existing formula columns for suspicious ARRAYSORT usage with unusual direction values to detect prior exploitation.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
NocoDB is an open-source no-code database platform (npm package: nocodb) that maps spreadsheet-style formula functions to database-specific SQL via a pluggable function mapping layer. The vulnerable code resides in packages/nocodb/src/db/functionMappings/pg.ts, the Postgres-specific formula mapper built on the knex query builder. The root cause is CWE-89 (Improper Neutralization of Special Elements in an SQL Command), arising from two compounding flaws: first, ARRAYSORT is defined with only an argument count constraint and no validation.args.type declaration, so the formula validator in validate-extract-tree.ts skips allowlist enforcement on the second (direction) argument; second, the Postgres mapper passes the raw user-supplied value through sanitize(knex.raw(...)) where sanitize() in sqlSanitize.ts only escapes ? placeholder characters and performs no SQL syntax validation, allowing the unfiltered value to be embedded directly into a knex.raw ORDER BY clause. The affected CPE is pkg:npm/nocodb.
Know when PostgreSQL gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:H
Primary rating from Vendor (https://github.com/nocodb/nocodb) · only source for this CVE.
CVSS VectorVendor: https://github.com/nocodb/nocodb
DescriptionCVE.org
Summary
An authenticated user with columnAdd permission on a Postgres-backed base can inject arbitrary SQL into the formula engine via the optional direction argument of ARRAYSORT(...). The value is unrestricted by formula validation and embedded into a knex.raw ORDER BY clause, executing during column creation and on every subsequent record read of the formula column.
Details
The vulnerability is specific to the Postgres mapping for ARRAYSORT in packages/nocodb/src/db/functionMappings/pg.ts. Two factors combine:
ARRAYSORTdeclares only argument count, notvalidation.args.type, sovalidate-extract-tree.tsdoes not enforce an allowlist on the second argument.- The Postgres mapping then passes the attacker-controlled value through
sanitize(knex.raw(...))into a raw SQL fragment:
const direction = pt.arguments[1]
? sanitize(
knex.raw(pt.arguments[1]?.value ?? (await fn(pt.arguments[1])).builder),
)
: knex.raw('asc');
return {
builder: knex.raw(`ARRAY(SELECT UNNEST(??) ORDER BY 1 ??)`, [source, direction]),
};sanitize() in sqlSanitize.ts only escapes ? placeholder characters; it does not validate SQL syntax. A payload such as "desc, (SELECT COUNT(*) FROM generate_series(1,30000000))" is accepted, persisted, and re-executed on every read of the formula column.
Impact
- Authenticated SQL injection against Postgres-backed bases.
- Requires
columnAddpermission (creator/owner-level). - Proven impact: attacker-controlled heavy SQL causing multi-second query stalls (DoS).
- Potentially extendable to broader SQL injection outcomes depending on database permissions and deployment hardening.
- Limited to Postgres backends.
Credit
This issue was reported by @leduckhuong.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
More in PostgreSQL
View allPostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows re
Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.
Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar
PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allow
The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t
A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra
In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve
Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the
Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot
Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al
EUVD-2026-38628
GHSA-cxv7-gmmp-228p
NVD
CVE.org
EPSS
VulDB
Exploit-DB