← All advisories
CVE-2026-130595mediumPrompt injection2026-11-17

CVE-2026-130595: SQLBot never applied its PostgreSQL dangerous-function denylist, so LLM-generated SQL could call pg_read_file / pg_write_file (1.10.0-1.10.3)

SQLBot, DataEase's open-source LLM text-to-SQL assistant, checks generated SQL with check_sql_read() and a per-database denylist of dangerous functions. In 1.10.0 through 1.10.3 the PostgreSQL list was stored under the key 'postgresql' while lookups used the datasource type 'pg', so it was never applied. An authenticated user could steer the model's SQL past the read-only check and use pg_read_file, pg_write_file, lo_import or lo_export to read or write files on the database host, depending on the database role's privileges. The fix (PR #1439, commit 67d213f, 5 November 2026) is on main; no release containing it was listed when this was published.

01.

What it is

DS_SPECIFIC_DANGEROUS_FUNCTIONS in backend/apps/db/db.py used 'postgresql'; the datasource type is 'pg', so the PostgreSQL rules were silently skipped (dataease/SQLBot issue #1438, reported 3 November by w5n4n and qxyuan853).

Impact grows with the database account SQLBot uses: superuser or pg_read_server_files / pg_write_server_files roles turn a chat question into file access on the DB server.

Fix: commit 67d213fc 'fix: apply the PostgreSQL dangerous-function denylist under the pg datasource type (#1439)', with regression tests.

02.

How to check

  1. If SQLBot 1.10.0-1.10.3 is connected to PostgreSQL, check the privileges of the role it uses: SELECT rolsuper FROM pg_roles WHERE rolname = current_user; and membership in pg_read_server_files / pg_write_server_files / pg_execute_server_program.
03.

How to fix

  1. Upgrade to the first SQLBot release after 1.10.3 that includes commit 67d213f, or build from main.
  2. Connect SQLBot to PostgreSQL with a dedicated read-only role that is not superuser and has none of the pg_*_server_* roles; this is the real boundary, since a denylist on LLM output is easy to miss.
SELECT current_user, rolsuper,
  pg_has_role(current_user, 'pg_read_server_files', 'member')  AS read_files,
  pg_has_role(current_user, 'pg_write_server_files', 'member') AS write_files
FROM pg_roles WHERE rolname = current_user;
04.

Sources

The weekly email

One email a week. Only what changed.

Every new security hole in AI coding tools, MCP servers, app builders and the stacks they generate (Next.js, Supabase, Node, PHP), each with how to check your app and the fix. No roundups of things you already read.

Free, one email a week. Read the latest issue first if you like. One-click unsubscribe in every email. We never sell or share addresses.