Custom 500 page is present and does not expose internals
Why it matters
The default framework error page in production often renders stack traces, internal file paths, and framework version information directly in the browser — feeding an attacker a precise map of the application's internal structure (CWE-209). OWASP A05 lists this as a Security Misconfiguration. Equally important: an error page that shows a friendly message but discards the error object silently means production failures are invisible. You need both — a safe user-facing message and server-side error capture so you know the failure happened.
Severity rationale
High because a default or stack-trace-rendering error page exposes application internals per CWE-209, while a completely silent error boundary leaves production failures undetected.
Remediation
Create app/error.tsx and app/global-error.tsx. Log the error server-side or to your monitoring service; show only a generic message to the user. Never render error.message or error.stack in the UI.
// app/error.tsx
'use client'
import { useEffect } from 'react'
export default function Error({
error, reset,
}: { error: Error & { digest?: string }; reset: () => void }) {
useEffect(() => { console.error(error) }, [error])
return (
<main>
<h1>Something went wrong</h1>
<p>We've been notified and are working on a fix.</p>
<button onClick={() => reset()}>Try again</button>
</main>
)
}
Replace console.error with your monitoring service SDK (Sentry, Bugsnag) for production alerting. The digest prop is a safe server-side error ID you can log — it never exposes the original stack trace to the client.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Pre-Launch Checklist Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-209 — Generation of Error Message Containing Sensitive Information
- owasp:2021 · A05 — Security Misconfiguration
- iso-25010:2011 · reliability.fault-tolerance
Taxons
History
- 2026-04-18·v1.0.0·Initial import from pre-launch·automated