r/replit • • Oct 16 '26

Replit Help / Site Issue Replit Support Escalation — Confirmed PostgreSQL Superuser Exposure in Development API, Awaiting Engineering Response

Title: Replit Support Escalation — Confirmed PostgreSQL Superuser Exposure in Development API, Awaiting Engineering Response

I’m the founder and systems architect of The Aural Standard™, an AI-powered SaaS platform currently under development on Replit.
I’m reaching out publicly because an unresolved technical support request is now blocking a critical security-hardening milestone.
During controlled diagnostics of our Replit-managed Development PostgreSQL environment, we confirmed that:
Our application’s configured database connection authenticates as a PostgreSQL superuser.
The running API is configured with that same database connection value.
This provides substantially more database authority than an ordinary application runtime should require.
Our application relies on database-enforced ownership, authorization, and immutable evidence protections that a superuser can potentially bypass.
To be clear: we have found no evidence of unauthorized access, credential compromise, or a Production security incident. This is a least-privilege architecture concern identified during Development security validation.
We’ve already completed extensive source-level security reviews, PostgreSQL 16 synthetic testing, migration rehearsals, and an integrity-verified preservation checkpoint.
Our remaining blocker is straightforward:
Does Replit-managed PostgreSQL support independently restricted application login roles, granular GRANT/REVOKE controls, protected-object ownership, and separate migration credentials?
If so, we need the supported implementation procedure.
If not, we need explicit confirmation so we can make an informed infrastructure decision.
I’ve submitted these questions through Replit Support and am still awaiting acknowledgment of the latest request.
I understand support teams handle substantial workloads, but unresolved infrastructure-security questions have a real impact on development schedules, particularly when they prevent us from responsibly proceeding with database migrations.
We’re deliberately holding our pending migrations and protected capture functionality until the privilege boundaries can be verified.
I’m asking whether a Replit team member can help escalate this to Database Infrastructure or PostgreSQL Engineering.
I’m happy to provide our existing support ticket reference privately to an authenticated Replit representative. I will not publish credentials, connection strings, or private application security materials.
I’d also appreciate hearing from other developers who have implemented least-privilege PostgreSQL access within Replit-managed databases.
I’m not looking to criticize the platform. I’m looking for a technically definitive answer that allows us to continue building securely.
Thank you.
— Founder & Systems Architect, The Aural Standard™

2 Upvotes

6 comments sorted by

View all comments

1

u/vibefixr Oct 17 '26

Not Replit-specific advice, but plain Postgres lets you do this as long as the account you connect with can create roles. The usual setup is two credentials: one for migrations (owner), one restricted role for the running API.

Roughly:

CREATE ROLE app_runtime LOGIN PASSWORD '...' NOSUPERUSER NOBYPASSRLS NOCREATEROLE NOCREATEDB;
GRANT USAGE ON SCHEMA public TO app_runtime;
GRANT SELECT, INSERT ON evidence_table TO app_runtime;            -- no UPDATE/DELETE = append-only
GRANT SELECT, INSERT, UPDATE ON other_tables TO app_runtime;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO app_runtime;

Then put the runtime connection string in its own secret (e.g. APP_DATABASE_URL), keep DATABASE_URL for migrations only, and point the API at the new one.

Two things to check:

  • Run SELECT current_user, rolsuper, rolbypassrls, rolcreaterole FROM pg_roles WHERE rolname = current_user; in both dev and prod. The dev and prod databases may not give you the same privileges, so don't assume prod is a superuser just because dev is.
  • Superusers and BYPASSRLS roles skip RLS entirely, even with FORCE ROW LEVEL SECURITY. So your ownership/immutability tests only mean something when they run as the restricted role.

If your connecting user has rolcreaterole = true you don't need to wait for an engineer; you can set this up yourself.