Skip to content

fix: redact production error logs#3361

Open
sanphandinh wants to merge 1 commit into
SecureBananaLabs:mainfrom
sanphandinh:codex/redact-production-error-logs-743
Open

fix: redact production error logs#3361
sanphandinh wants to merge 1 commit into
SecureBananaLabs:mainfrom
sanphandinh:codex/redact-production-error-logs-743

Conversation

@sanphandinh
Copy link
Copy Markdown

@sanphandinh sanphandinh commented Jun 1, 2026

Summary

  • sanitize production error-handler logs so raw error messages and stacks are not serialized to application logs
  • keep verbose local/development logging behavior unchanged
  • add a focused regression test proving a secret-looking error message is omitted while the public 500 response remains generic

Demo

Verification

  • node --test apps/api/src/tests/errorHandler.test.js
  • node --test apps/api/src/tests/*.test.js -> 2 passed when run outside the sandbox because the existing health test opens a localhost listener
  • node --check apps/api/src/middleware/errorHandler.js
  • node --check apps/api/src/tests/errorHandler.test.js
  • git diff --check

Note: npm run test -w apps/api still fails because the existing package script invokes node --test src/tests, which Node treats as a missing module path in this checkout. I used the direct test file glob above to validate this patch.

Closes #3359
/claim #743

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Production error logs should not print raw error objects

1 participant