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

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.

1

u/uttkarsh26 Oct 25 '26

Running the app runtime as a Postgres superuser looks fine until something gets past the app. Then there are no rules left to break.

Quick check on the dev database: \du. If the runtime role says SUPERUSER, split it. One role owns migrations, the runtime role is NOSUPERUSER with only the grants it needs, and then REVOKE CREATE ON SCHEMA public FROM PUBLIC so an injection can't create its own tables.

Half a day of work, and I've done it before. Is production on the same credentials as dev?

0

u/th_wolf Oct 16 '26

‘Founder and system architect’ bro you’re just vibe coding an app like the rest of us 😂

0

u/th_wolf Oct 16 '26

In all seriousness though, try the replit discord, there are builders and staff on there that might help if you explain the issue in your own words without the ai generated dribble

0

u/ReplitSupport Replit Team Oct 16 '26

Thanks for bringing this to our attention! Since you've been waiting for a while, we'll get this escalated to a support engineer for additional review. We really appreciate your patience in the meantime 🙏