---
id: "CVE-2026-112306"
kind: "vulnerability"
aliases: ["CVE-2026-112306"]
title: "NocoBase collection-sql plugin: privileged users can run arbitrary SQL"
severity: "high"
cvss: 8.6
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["nocobase", "package", "postgresql", "self-hosted"]
not_affected_if: ["no-untrusted-privileged-users", "plugin-collection-sql-not-installed"]
published_at: "2026-10-19T16:17:06+00:00"
first_seen_at: "2026-10-23T21:57:18+00:00"
updated_at: "2026-10-23T22:39:46+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-112306", "first_seen_at": "2026-10-23T21:57:18+00:00"}]
---

# NocoBase collection-sql plugin: privileged users can run arbitrary SQL

The @nocobase/plugin-collection-sql plugin through 2.2.28 lets a privileged user store SQL that bypasses the checkSQL() validation via the sqlCollection:setFields action. The stored query runs on reload, so an attacker can read database password hashes (pg_shadow) or read server files (pg_read_file).

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

Check the installed version of @nocobase/plugin-collection-sql in package.json or the lockfile; versions through 2.2.28 are affected.

## Fix

Upgrade @nocobase/plugin-collection-sql past 2.2.28; the sources do not name the fixed version.
Rotate database credentials if untrusted users had snippet-edit rights.

## Timeline

- 2026-10-23T21:57:18+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-112306

## From the sources

NocoBase @nocobase/plugin-collection-sql through 2.2.28 contains an SQL injection vulnerability that allows privileged users to store unvalidated SQL by bypassing checkSQL() through the sqlCollection:setFields action. Attackers holding the collection-sql snippet can replace a benign collection query with dangerous statements executed on reload, reading pg_shadow password hashes or calling pg_read_file.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
