security: redact internal error messages from 500 responses#164
Closed
CleanDev-Fix wants to merge 1 commit into
Closed
security: redact internal error messages from 500 responses#164CleanDev-Fix wants to merge 1 commit into
CleanDev-Fix wants to merge 1 commit into
Conversation
Contributor
|
thanks for the effort @CleanDev-Fix! 🙏 issue #139 isn't assigned to you, and we merge from the assigned contributor to keep the campaign fair. please claim an open unassigned issue first, then open your PR. closing for now — hope to see it back 🙌 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #139 by redacting unexpected internal error messages from
500 internal_errorresponses while preserving request correlation for operators.Changes
Unexpected server errormessage for 500 responses.requestId, method, and path.Errormessages, non-Errorthrows, existing validation 400 responses, and existing 413 responses.Testing/Verification
npm run lintnpm run buildnpx prettier --check README.md src/routes/errors.ts src/error-redaction.test.ts$env:NODE_ENV='test'; node --test dist/*.test.js dist/**/*.test.js(73/73 passing)Note: On Windows, the existing
npm testscript fails before executing tests because it uses Unix-styleNODE_ENV=test; the equivalent command above ran the full compiled test suite.Threat Model Note
Unexpected thrown errors can contain file paths, dependency internals, or sensitive operational context. This change keeps those details in server logs correlated by
requestIdand returns only a generic fixed message to clients. Caller-actionable 400 and 413 responses are intentionally unchanged.Fixes #139