Sensitive operations
Include project lists, messages, contact submissions, model credentials, create/update/delete actions, and agent calls. Record method and route for each.
If your Replit API returns private data or accepts a write without login, check the server route before changing the UI. Require a verified session before sensitive work, then constrain each record operation to the caller’s allowed role, owner, or tenant. Test anonymous and cross-user requests directly; hiding a button does not protect the API.
This guide covers check 01: Authentication and access control; check 02: Authorization and data isolation in the Zenveus Production Readiness Standard.
For builders
Your Replit app can look private while its API still accepts requests from anyone. A login screen protects data only when the server checks the caller too. The repair must reject anonymous users and users requesting someone else’s records before any read or write.
A scoped repair request
Use this prompt in Lovable, Cursor, Replit, or Claude Code with the relevant server files available.
Audit my Replit server routes for missing authentication and record ownership checks. Inventory public versus private operations, put session validation before sensitive work, and bind each record query to the authorized user. Work on a branch with synthetic data and mocked external services. Show the smallest diff, identify required adapters and deployment settings, and add allowed and denied tests that prove side effects cannot happen before checks pass. Do not disable security checks to make a test pass.The same failure may appear as
Find the failure layer
Each check removes a class of causes. Keep the first failing result, its timestamp, and the production log beside it.
Include project lists, messages, contact submissions, model credentials, create/update/delete actions, and agent calls. Record method and route for each.
In an isolated test environment with synthetic data, call each route without a session and as a normal user. A hidden page or client redirect does not enforce API authorization. An anonymous sensitive request should fail before any side effect.
Read middleware registration and router mount order. A guard imported but never mounted, commented out, or placed after the router offers no protection. Check route-level exemptions deliberately.
An authenticated user should be denied another user's or tenant's record, including direct requests with a guessed ID.
Ranked diagnosis
The interface hides an action while the server still accepts a direct request.
An authentication guard is imported, commented out, or mounted after the sensitive router.
The route accepts a record ID without checking that the caller may access that record.
An intended public submission path leaves private list or delete actions unguarded.
Step-by-step repair
Edit the server entry point that mounts /api routes and the handler that reads a project by ID. In Express this is usually app.ts or index.ts plus routes/projects.ts; use the equivalent server handler in your framework.
Production safety ruleNever disable access controls, expose service keys, or add wildcard CORS as a routine shortcut.
Load the session middleware first. Place a guard before /api/projects so an absent identity returns 401 before any query. Read identity from a verified session or token, never a userId in the request body.
Query by both project ID and the authenticated owner ID. Return 404 for a record the caller cannot access. For shared projects, replace owner-only logic with your explicit membership and operation policy.
Keep an intended contact POST public only if the product requires it. Put contact listing and deletion behind a server-side admin check. Add CSRF protection to cookie-authenticated writes.
Create a synthetic project for user A. Call its endpoint anonymously, as A, and as B. Inspect query and write logs to confirm a denied request performs no protected action.
Implementation example
// Existing session middleware must run before this guard.
function requireUser(req, res, next) {
if (!req.session?.userId) return res.sendStatus(401);
next();
}
app.get('/api/projects/:id', requireUser, async (req, res, next) => {
try {
const project = await db.project.findFirst({
where: { id: req.params.id, ownerId: req.session.userId }
});
if (!project) return res.sendStatus(404);
res.json({ id: project.id, title: project.title });
} catch (error) { next(error); }
});Adapt the Prisma-style query to your database. The session must be established by your authentication library, and the response must expose only fields this caller may read.
Prove the repair
Run these checks with synthetic data in your test environment, then repeat the relevant acceptance checks after deployment.
When the built-in AI fix makes it worse
Pause generated changes, restore a known working branch, and capture one failing request with its logs. Change one layer and rerun the allowed and denied checks before proceeding.
Engineering handoff
We trace one production request through the complete path, isolate the failing boundary, and leave behind evidence your team can repeat.
Which Replit endpoints expose private reads, writes, or admin actions.
Whether session validation runs before database and provider work.
How each record query binds its owner or tenant to trusted identity.
Direct anonymous and cross-user requests, including their side effects.
Typical repair pattern
The same request succeeds for an allowed user and fails for anonymous and cross-user callers before database or provider work.
Before the next release
Clear answers
No. Check the endpoint directly with no session and with a non-admin account. The server must make the authorization decision.
CORS controls which browser origins may read responses. It is not authentication. Diagnose the missing server guard separately.
Public submission may be intentional. Reading all submissions or deleting them generally needs admin authorization.
Run the verification checks on this page against your test environment, then repeat the relevant checks after deployment. Example code needs your app's authentication, data model, and configuration; reading the guide alone does not verify your deployment.
Official documentation and library references
Free next step
The free tool helps you inspect this symptom. Its result does not establish whether the whole app is production ready.
The Verdict
We can see the symptom from here. What we cannot tell you from outside is whether it is contained or structural. A scanner collects evidence. A named senior engineer makes the decision. For $299, a named senior engineer reads your code and signs a written Verdict against the nine checks in the Zenveus Production Readiness Standard. The 48-hour clock begins when the required access and context are available. If the report does not give your developer a list they can act on, you do not pay.
The 48-hour clock starts when the required access and context are available.
Free decision aid
Get a senior view of the constraint, the evidence you have, and the next decision that removes the most risk.
No email required for this decision aid. Dismiss once and this popup stays closed for the session.