Skip to content

Plugins share one Postgres superuser — any plugin can read/write another plugin's or the host's data #245

Description

@PianoNic

`src/Schuly.API/Plugins/PluginHost.cs:278-284` (`PluginConnectionString`) builds each plugin's DB connection string by swapping only `Database=` on the same underlying Postgres credentials — there's one superuser role behind every plugin database (see also `compose.dev.yml`, a single `POSTGRES_PASSWORD`).

Exploit: a plugin opens its own `NpgsqlConnection` with `Database=schuly-dev` (or another plugin's DB name) using its already-injected credentials and reads/writes the entire host DB or any other plugin's tables.

Fix: create a dedicated least-privilege Postgres role per plugin, granted only on its own database.

Found during the Aug 2026 security sweep.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions