Advisories for Npm/@Nocobase/Plugin-Collection-Sql package

2026

NocoBase: Sensitive Data Exposure via SQL Blacklist Bypass

The checkSQL() function in plugin-collection-sql implements a keyword-based blacklist to prevent dangerous SQL queries from being executed through the SQL Collection feature. However, the blacklist is incomplete: it only checks for a subset of dangerous PostgreSQL system functions and does not restrict access to sensitive system catalog tables such as pg_shadow, pg_roles, or pg_stat_activity. An authenticated user with the admin role can exploit this to dump PostgreSQL password hashes (pg_shadow), …

@nocobase/plugin-collection-sql: SQL Validation Bypass Through Missing `checkSQL` Call

The checkSQL() validation function that blocks dangerous SQL keywords (e.g., pg_read_file, LOAD_FILE, dblink) is applied on the collections:create and sqlCollection:execute endpoints but is entirely missing on the sqlCollection:update endpoint. An attacker with collection management permissions can create a SQL collection with benign SQL, then update it with arbitrary SQL that bypasses all validation, and query the collection to execute the injected SQL and exfiltrate data. Affected component: @nocobase/plugin-collection-sql Affected versions: …