Skip to content

[Bug] Error boundary showDetails is hardcoded to true, exposing stack traces in production #708

Description

@RUKAYAT-CODER

Overview

src/components/errors/ErrorBoundarySystem.tsx passes showDetails={true} unconditionally to UserFriendlyErrorDisplay. In a production deployment, this renders full stack traces and internal error messages to end users, leaking implementation details and potentially sensitive server paths or data structures.

Specifications

Features:

  • Stack traces are only displayed in development and staging environments
  • Production error UI shows a generic user-friendly message only

Tasks:

  • Replace the hardcoded showDetails={true} with showDetails={process.env.NODE_ENV === 'development'}
  • Add an optional showDetails prop to ErrorBoundarySystem so callers can override for staging
  • Verify global-error.tsx applies the same guard
  • Add a unit test asserting the stack trace element is absent in the production render

Impacted Files:

  • src/components/errors/ErrorBoundarySystem.tsx
  • src/app/error.tsx
  • src/app/global-error.tsx

Acceptance Criteria

  • Stack traces are not visible in the rendered HTML when NODE_ENV=production
  • showDetails defaults to false unless explicitly enabled
  • Existing error boundary tests still pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programbugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions