CVE-2026-47375: NocoDB Postgres SQL Injection via ARRAYSORT Direction Parameter
NocoDB, a spreadsheet-like database-building platform, contains a SQL injection vulnerability that allows authenticated users to run arbitrary database commands. An attacker with permission to add columns can exploit the ARRAYSORT function's direction parameter to inject malicious SQL code. Once injected, the code executes both when the column is created and every time records are read from that column. This only affects Postgres databases and has been patched in version 2026.04.1.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 6.0 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:H
- Weaknesses (CWE)
- CWE-89
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-06-23 / 2026-06-25
NVD description (verbatim)
NocoDB is software for building databases as spreadsheets. Prior to 2026.04.1, 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. The vulnerability is specific to the Postgres mapping for ARRAYSORT in packages/nocodb/src/db/functionMappings/pg.ts. This vulnerability is fixed in 2026.04.1.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists in NocoDB's formula engine, specifically in the Postgres-specific ARRAYSORT function implementation located in packages/nocodb/src/db/functionMappings/pg.ts. The direction argument of ARRAYSORT is passed directly into a knex.raw ORDER BY clause without validation or sanitization by the formula engine. Because the value is embedded unescaped into the SQL query, an authenticated user with columnAdd permissions can craft a direction parameter containing arbitrary SQL syntax. The injected SQL executes immediately during column creation and re-executes on every subsequent read operation against that formula column, creating a persistent code execution vector. The vulnerability is specific to Postgres backends; other database mappings are not affected.
Business impact
Organizations using NocoDB with Postgres backends face data exposure and manipulation risks from internal users. An attacker with column-creation privileges—whether a malicious employee, contractor, or compromised account—can read sensitive data, modify records, or corrupt the database without leaving obvious traces in application logs. The persistent nature of the injection means each record read triggers the malicious SQL, enabling exfiltration of large datasets or gradual data poisoning. Incident response becomes complex because the attack executes through normal application queries rather than direct database access.
Affected systems
NocoDB versions prior to 2026.04.1 using Postgres as the database backend are vulnerable. The attack requires authenticated access with columnAdd permission, which is typically granted to collaborators with editing rights on a shared base. Self-hosted and cloud instances are both affected if running vulnerable versions. Non-Postgres databases (MySQL, SQLite, etc.) are not affected by this specific vulnerability.
Exploitability
Exploitation requires valid NocoDB credentials and columnAdd permissions, setting a relatively high barrier compared to unauthenticated exploits. However, within organizations using NocoDB for collaborative data work, column-creation access is often broadly distributed. The attack is straightforward to execute—an attacker simply creates or modifies a column with a crafted ARRAYSORT formula—and requires no complex tooling or timing. The CVSS score of 6.0 (MEDIUM) reflects this authentication prerequisite, though the impact on confidentiality, integrity, and availability once inside is notable.
Remediation
Upgrade NocoDB to version 2026.04.1 or later. This version includes validation and proper parameterization of the ARRAYSORT direction argument, preventing SQL injection. Verify the upgrade applies to your deployment method (cloud-hosted, self-hosted Docker, npm installation, etc.). After upgrading, audit existing columns using ARRAYSORT formulas for any suspicious direction parameters, particularly if columnAdd activity has been unusual.
Patch guidance
Apply NocoDB 2026.04.1 or later. If running NocoDB in a containerized environment, pull the latest image and redeploy. For self-hosted npm installations, run npm update nocodb to the patched version. For cloud instances, verify your platform auto-updates or manually trigger an upgrade. Test in a non-production environment first to confirm application compatibility. No data migration is required; the patch only affects the formula validation logic.
Detection guidance
Review NocoDB audit logs for columnAdd operations, particularly those using ARRAYSORT with unusual direction values containing SQL keywords (SELECT, UNION, ';', '--', etc.). Monitor Postgres query logs for unexpected commands originating from NocoDB connections during column creation or record reads. Inspect existing formula columns in your bases for suspicious ARRAYSORT configurations. Network-level detection is difficult since malicious queries appear as legitimate database traffic; focus on access control review and formula auditing.
Why prioritize this
Although labeled MEDIUM severity, this vulnerability warrants prompt attention for any organization using NocoDB with Postgres and collaborative editing. The attack surface is internal (requires authentication and specific permissions) but the persistence of injected code and the potential for wide data access make it a material insider risk. Organizations with restrictive column-creation policies or limited Postgres data sensitivity may deprioritize slightly; those with broad sharing or sensitive databases should patch within standard patch windows.
Risk score, explained
The CVSS 3.1 score of 6.0 reflects a high-impact vulnerability (data confidentiality, integrity, and availability all affected as indicated by the vector) tempered by authentication and high-privilege requirements (PR:H). The network-accessible attack vector (AV:N) acknowledges that the exploit is delivered remotely, but the prerequisites of valid credentials and column-add permissions prevent casual exploitation. The complete lack of user interaction (UI:N) and unchanged security scope (S:U) acknowledge that no social engineering or privilege escalation is needed once the attacker has the required role.
Frequently asked questions
Can this vulnerability be exploited if I restrict who can create columns?
Yes, but it significantly reduces your risk. If you limit column-creation permissions to trusted admins and audit their actions, the attack surface shrinks. However, any user with columnAdd permissions remains capable of exploitation, so access control is essential but not a complete mitigation—upgrading is still required.
Does this affect my NocoDB base if it's not using Postgres?
No. This vulnerability is specific to Postgres backends. If your NocoDB instance uses MySQL, SQLite, or other databases, you are not affected by this particular issue. Check your base configuration to confirm your database type.
If I upgrade to 2026.04.1, do I need to do anything about existing columns?
Review existing ARRAYSORT formulas for suspicious direction parameters, but the upgrade itself does not require column deletion or recreation. The fix prevents new injections and re-validates existing formulas on startup or next edit. If you discover suspicious formulas during review, remove or correct them.
Will the injected SQL continue to execute after I patch if I don't delete the formula?
After patching, the direction parameter will be properly escaped and treated as a literal value rather than SQL syntax. Existing injected code will no longer execute as SQL; however, the formula itself may still produce unexpected results. Remove any suspicious ARRAYSORT formulas you identify.
This analysis is provided for informational purposes to support vulnerability assessment and patch planning. The technical details, CVSS score, affected versions, and patch information are derived from official CVE records and vendor disclosures. Organizations should verify patch availability and compatibility with their specific deployment before applying updates. This vulnerability requires authenticated access and specific permissions; it does not affect NocoDB instances using non-Postgres databases. No exploit code, proof-of-concept, or weaponized tooling is provided. Consult official NocoDB documentation and your vendor for definitive guidance on remediation timelines and compatibility. Source: NVD (public-domain), retrieved 2026-07-29. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2026-0075MEDIUMAndroid SQL Injection in Contacts Database – Privilege Escalation Risk
- CVE-2026-10039MEDIUMFrontend Admin WordPress Plugin SQL Injection Vulnerability
- CVE-2026-10155MEDIUMSQL Injection in Bdtask Multi-Store Inventory Management System 1.0
- CVE-2026-10170MEDIUMSQL Injection in code-projects Visitor Management System 1.0
- CVE-2026-10171MEDIUMSQL Injection in code-projects Online Music Site 1.0 AdminUpdateAlbum.php
- CVE-2026-10176MEDIUMSQL Injection in Aider-AI Aider 0.86.3 Code Generation
- CVE-2026-10193MEDIUMSQL Injection in OFCMS ComnController – Authentication Required
- CVE-2026-10202MEDIUMOFCMS 1.1.3 SQL Injection in SystemDictController