CVE-2026-47375: NocoDB SQL Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-cxv7-gmmp-228p
CVSS 6.0
CWE-89
Published
Advisory Summary

CVE-2026-47375 is a MODERATE (CVSS 6.0) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting NocoDB libraries in the npm ecosystem. The issue involves postgres sql injection in formula `arraysort`. Remediation is available by upgrading affected packages to version 2026.04.1.

CVE-2026-47375 at a Glance

CVE Identifier CVE-2026-47375
GHSA Identifier GHSA-cxv7-gmmp-228p
Severity MODERATE
CVSS v3.1 Base Score 6.0
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product NocoDB
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability High (A:H)

How to Fix CVE-2026-47375

To remediate this vulnerability, upgrade all affected NocoDB dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

nocodb fixed: 2026.04.1
npm install nocodb@2026.04.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls nocodb

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-47375, inspect your project dependencies using npm:

npm ls nocodb

Analyze the terminal output to locate any version of NocoDB in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2026.04.1), your application is affected.

Note: The npm ls nocodb command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In NocoDB, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: 1. `ARRAYSORT` declares only argument count, not `validation.args.type`, so `validate-extract-tree.ts` does not enforce an allowlist on the second argument. 2. The Postgres mapping then passes the attacker-controlled value through `sanitize(knex.raw(...))` into a raw SQL fragment: ```ts 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 `columnAdd` permission (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](https://github.com/leduckhuong).

CVE-2026-47375 Affected NocoDB Versions

1 component(s)
Fixed Versions:
2026.04.1
Product / Package Ecosystem Affected Versions Fixed Version
nocodb
npm
< 2026.04.1
2026.04.1

References

Frequently Asked Questions

What is CVE-2026-47375?
CVE-2026-47375 is a security vulnerability in NocoDB involving Postgres SQL Injection in Formula `ARRAYSORT` under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which NocoDB versions are affected?
Affected versions include releases prior to 2026.04.1 across affected packages: nocodb.
What version fixes CVE-2026-47375?
Upgrading to 2026.04.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nocodb affected?
Yes, nocodb is affected in releases prior to 2026.04.1. Upgrade your dependency to 2026.04.1 or later.
What is the CVSS score of CVE-2026-47375?
CVE-2026-47375 has a CVSS v3.1 base score of 6.0 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:H.
What CWE is associated with CVE-2026-47375?
CVE-2026-47375 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check npm dependencies for CVE-2026-47375?
Run the dependency tree command: 'npm ls nocodb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-cxv7-gmmp-228p",
  "modified" : "2026-07-20T21:17:14Z",
  "published" : "2026-06-05T15:59:28Z",
  "aliases" : [ "CVE-2026-47375" ],
  "summary" : "NocoDB: Postgres SQL Injection in Formula `ARRAYSORT`",
  "details" : "### Summary\n\nAn 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.\n\n### Details\n\nThe vulnerability is specific to the Postgres mapping for `ARRAYSORT` in `packages/nocodb/src/db/functionMappings/pg.ts`. Two factors combine:\n\n1. `ARRAYSORT` declares only argument count, not `validation.args.type`, so `validate-extract-tree.ts` does not enforce an allowlist on the second argument.\n2. The Postgres mapping then passes the attacker-controlled value through `sanitize(knex.raw(...))` into a raw SQL fragment:\n\n```ts\nconst direction = pt.arguments[1]\n  ? sanitize(\n      knex.raw(pt.arguments[1]?.value ?? (await fn(pt.arguments[1])).builder),\n    )\n  : knex.raw('asc');\n\nreturn {\n  builder: knex.raw(`ARRAY(SELECT UNNEST(??) ORDER BY 1 ??)`, [source, direction]),\n};\n```\n\n`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.\n\n### Impact\n\n- Authenticated SQL injection against Postgres-backed bases.\n- Requires `columnAdd` permission (creator/owner-level).\n- Proven impact: attacker-controlled heavy SQL causing multi-second query stalls (DoS).\n- Potentially extendable to broader SQL injection outcomes depending on database permissions and deployment hardening.\n- Limited to Postgres backends.\n\n### Credit\n\nThis issue was reported by [@leduckhuong](https://github.com/leduckhuong).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "nocodb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2026.04.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nocodb/nocodb/security/advisories/GHSA-cxv7-gmmp-228p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-47375"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nocodb/nocodb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nocodb/nocodb/releases/tag/2026.04.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-05T15:59:28Z",
    "nvd_published_at" : "2026-06-23T21:16:59Z"
  }
}