Error messages that leak stack traces, queries or keys
Quick answer: AI-generated apps often return raw errors to the browser, exposing file paths, SQL, environment details or even keys. Return a generic message to users and log details server-side.
Last updated November 11, 2026
Steps
- On your own app, trigger a few errors: a bad ID in a URL, an empty form, a logged-out API call.
- Look at the response body and the browser console: stack traces, SQL text, file paths or env values should not appear.
- Wrap API handlers so users get a short generic message plus a request ID.
- Send full error details to server logs or an error tracker instead.
- Make sure production builds don't run in debug or development mode.
Why it matters
Detailed errors help attackers map your database and code. OWASP lists improper error handling under security misconfiguration.
Sources
OWASP Top 10 A05: Security Misconfiguration — https://owasp.org/Top10/A05_2021-Security_Misconfiguration/
OWASP Error Handling Cheat Sheet — https://cheatsheetseries.owasp.org/cheatsheets/Error_Handling_Cheat_Sheet.html
Related patterns
- SQL built from strings in raw queries (SQL injection)
- Production source maps that publish your app's original source code
- Login and signup messages that reveal which accounts exist (account enumeration)
- Passwords, tokens and personal data written to your logs
- Debug or preview mode left on in production
- API responses that return whole database records (excessive data exposure)
- GraphQL APIs with introspection on and no depth or cost limits
Found a problem you'd rather not fix yourself?
Tell us what's wrong. A StorenTech engineer reviews your app and replies with a fixed quote, so you know the cost before any work starts.
Get it fixed by StorenTechVibe Security Weekly
One email a week with new failure patterns and how to fix them.
By joining you agree we may email you this newsletter. See our privacy policy. Free. Unsubscribe anytime. We'll never sell your email.