Debug endpoints exposed in production
A debug endpoint is any route added for development, such as a config dump, a seed script trigger or a detailed status page, that still answers in production. Find them in your own source, remove or authenticate them, and confirm the live URLs no longer respond with internal details.
Check your app free, first fix freeAI builders often generate helper routes while debugging and nobody removes them. Some only leak environment names; others reset data or print secrets. Search your code for route definitions, decide which belong in production, and protect the rest behind server-side checks. Verify on the live domain. ProofForge does not run a dedicated check for this.
What counts as a debug endpoint
Common examples from generated projects: /api/debug, /api/test, /api/seed, /api/env, a status route that prints process.env, a route that returns the last error with a stack trace, or a framework development page left enabled. A plain health check that returns "ok" is fine. The problem is detail or power: internal configuration, user records, or the ability to change data without being signed in.
Guessing URLs on a live site is slow and incomplete. Your source code is the reliable list.
Find them in your own code
# From your project root. Review every match by hand.
grep -rniE "(debug|test|seed|reset|env|dump|internal)" \
--include="*.ts" --include="*.js" app pages src server api 2>/dev/null \
| grep -iE "route|get\(|post\(|export (async )?function"Ask your builder or coding agent for a list of every server route with its method and whether it requires a session. Compare that list with what the product really needs.
Decide per route
- Delete routes that only served development.
- Keep genuinely useful ones but require an authenticated admin session checked on the server, not a hidden button.
- Never return environment variables, stack traces or raw SQL errors to the browser. Log them server-side instead.
// Example guard for a route you decide to keep
export async function GET(req: Request) {
const user = await getSessionUser(req);
if (!user || user.role !== "admin") {
return new Response("Not found", { status: 404 });
}
return Response.json({ ok: true, version: process.env.APP_VERSION });
}Verify on the deployed app
Request each removed or guarded path signed out, from a private window. You want a 404 or 401 without internal detail, and the app's normal pages still working. Remember that previews and production may run different code.
If a debug route ever printed real secrets, rotate them; removing the route does not undo the exposure.
What ProofForge does and does not check here
ProofForge does not currently perform a dedicated debug-endpoint check. This is a manual guide, not a claim of detection: a clean ProofForge report says nothing either way about this issue. The public scan covers the areas listed on the methodology page, such as exposed files, bundle secrets, security headers, CORS and selected database access. Use the steps above on an app you own or have permission to test, and keep your own notes as evidence.
Turn the check into a release decision
Keep a small record of the production URL, the time you checked it, the exact finding and the action you took. A local preview and a deployed application can have different environment variables, response headers and database projects. After a repair, deploy the intended version and check the public address again. Do not assume that changing a repository file changed the live system.
Read coverage as carefully as the score. A timed-out asset, an ambiguous backend configuration or a request that could not safely establish access should remain unknown. It should not disappear from your release notes merely because there is no red finding. If a check was not completed, decide who will review it and what additional evidence is needed.
ProofForge's free report includes the first fix. The $9 Fix Report unlocks all findings' available repair guidance and builder prompts, with a PDF and private report link. Fix + Guard costs $29 once and adds builder rules, on-demand deploy-hook scans for 30 days and four weekly rechecks you start yourself. These are different deliverables, not different promises that an application is completely secure.
Keep private report URLs out of public issues and commits. If you need shareable evidence, use the owner-verification and publication flow for an eligible receipt. A signature protects the recorded assessment against undetected changes; it does not make the assessment exhaustive, prove a business outcome, or show that a later deployment still matches an earlier result.
Questions builders ask
Is a /health endpoint a debug endpoint?
Should guarded routes return 404 or 401?
Does ProofForge find debug routes?
Related checks and fixes
Continue with a related guide
Sources
Scan your app free
See what your live app ships to every visitor, with the first fix free. A clean scan is not a full audit. Run it only on an app you own or have permission to test.
Scan your app free