Mittel

NocoDB: Postgres SQL Injection in Formula `ARRAYSORT`

  • Veröffentlicht: 05.06.2026
  • Aktualisiert: 11.10.2026 10:22

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.

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
npm-Paket nocodb < 2026.04.1 2026.04.1

Verweise

CVSS-Wert 6/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:H
Schwäche (CWE)
CWE-89
Plattform
npm
Paket
nocodb
Veröffentlicht
05.06.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-cxv7-gmmp-228p - CC BY 4.0

Schwachstellenhistorie: nocodb

Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (54) im Archiv
Einträge insgesamt
54
Erste → letzte
06.2022 06.2026
Ohne Fix
13
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Hoch 7
  • Mittel 41
  • Niedrig 6

Veröffentlichungen pro Jahr

  1. 2022: 5
  2. 2023: 2
  3. 2024: 3
  4. 2025: 1
  5. 2026: 43
Schweregrad:
  1. Hoch CVE-2026-47387 < 2026.05.1 2026.05.1
  2. Hoch CVE-2026-47383 < 2026.05.1 2026.05.1
  3. NocoDB: Postgres SQL Injection in Formula `ARRAYSORT` dieser Eintrag
    Mittel · 6.0 CVE-2026-47375 < 2026.04.1 2026.04.1
  4. Hoch · 7.3 CVE-2023-49781 < 0.202.9 0.202.9
  5. Hoch · 8.8 CVE-2022-2064 < 0.91.9 0.91.9
  6. Hoch · 8.8 CVE-2022-2063 < 0.91.8 0.91.8
  7. Hoch · 7.5 CVE-2022-2062 < 0.91.7 0.91.7

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.