Is your app showing stack traces to strangers? A 3-minute error-page check
When your app breaks, what does a stranger see? In many AI-built apps, the answer is a full error page with a stack trace, file paths, database table names and sometimes a connection string. That is a free map of your ap
When your app breaks, what does a stranger see? In many AI-built apps, the answer is a full error page with a stack trace, file paths, database table names and sometimes a connection string. That is a free map of your app for anyone who wants to attack it.
Error pages written for debugging are fine on your laptop. In production they leak.
Who is at risk
Any app that runs in development mode in production, or returns raw exception messages from its API. AI tools often leave debug mode on because it makes the demo easier to fix.
What tends to leak
- Stack traces with file paths and library versions.
- SQL errors that name tables, columns and sometimes the query itself.
- Framework debug pages that show environment variables and settings.
- API errors that echo back a provider key or an internal URL.
- Different messages for "user not found" and "wrong password".
The 3-minute check (your own app only)
- Open a URL that does not exist, like
/this-page-should-not-exist. You should see a plain 404 page. - Send your API something it does not expect: a missing field, a wrong type, or a very long string. Look at the error body in the Network tab.
- Add a stray quote
'to a search box or ID parameter on a test record and see what comes back. - Look for words like
Traceback,at Object.,node_modules,SELECT,ECONNREFUSED, or a file path such as/app/src. - Check that the page does not say "debug", "development" or show a settings dump.
Pass: every failure returns a short, generic message and the right status code, with details only in your private logs.
What to fix
- Turn debug mode off in production. Set the environment to production on your host.
- Return a generic message to the client and log the full error on the server.
- Use a global error handler so no route can return a raw exception.
- Keep one message for "no such user" and "wrong password".
- Never include keys or internal URLs in an error response.
A prompt you can paste into your AI builder
"Make sure the app runs in production mode in production. Add a global error handler that returns a short generic message and the right status code, logs the full error on the server only, and never returns stack traces, file paths, SQL, or environment values to the client."
What a scanner can and cannot tell you
An outside scan can request a missing page and a few simple malformed inputs, and report what comes back. It cannot trigger every error path in your app, so a clean result is not proof that no route leaks. Run the check above on the routes that matter most.
I work on ProofForge. The free scan covers what a visitor can see and says plainly what it could not check.
Check your own app from the outside, free. Run the free ProofForge scan on your live URL. No account needed for the first scan. It looks at your public site the way a stranger would and says pass, fail or inconclusive, so you know what is confirmed and what it could not see. One-time reports start at $9: see pricing. Building with an AI agent? There is an MCP server so it can check before it deploys.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.