Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/core/src/components/default-catch-boundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function DefaultCatchBoundary({ error }: ErrorComponentProps) {

// Format error details for display
const errorMessage = error?.message || 'An unexpected error occurred'
const errorStack = error?.stack || ''
const errorStack = import.meta.env.DEV ? (error?.stack || '') : ''
const hasStack = errorStack.length > 0

const handleReportError = () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/school/src/components/default-catch-boundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function DefaultCatchBoundary({ error, reset }: ErrorComponentProps) {
const [copied, setCopied] = useState(false)

const errorMessage = error?.message || t.common.unexpectedError()
const errorStack = error?.stack || ''
const errorStack = import.meta.env.DEV ? (error?.stack || '') : ''
const hasStack = errorStack.length > 0

const handleCopyError = async () => {
Expand Down
5 changes: 5 additions & 0 deletions pr_desc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
🚨 Severity: MEDIUM
πŸ’‘ Vulnerability: The application was exposing full error stack traces in `DefaultCatchBoundary` to the user interface in production.
🎯 Impact: This could potentially leak internal application paths, code structure, or dependencies to end-users or attackers during an unexpected error.
πŸ”§ Fix: Used `import.meta.env.DEV` to check if we are in development mode and only populated the `errorStack` constant when `DEV` is true.
βœ… Verification: Verify that the error boundary still catches errors correctly and the UI correctly doesn't render stack trace sections when `NODE_ENV` / `import.meta.env.DEV` resolves to false.
Loading