Error sanitize#919
Merged
Merged
Conversation
magik6k
reviewed
Jan 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements error sanitization to prevent exposing internal system details to users. The changes focus on three main areas: sanitizing HTTP error responses in handlers, masking passwords in database connection strings, and filtering database errors that may contain sensitive information.
Changes:
- HTTP handlers now log detailed errors internally while returning generic error messages to clients
- Database connection strings mask passwords with asterisks before being used in error messages
- A new
errFilterfunction in harmonydb intercepts database errors containing sensitive patterns (password, host=, ://) and redacts them - Security documentation added explaining what information should be protected and what can be safely shared
- Updated yugabyte/pgx dependency from v5.5.3-yb-5 to v5.7.6-yb-1
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pdp/handlers.go | Sanitizes error messages in HTTP responses by logging errors internally with detailed context while returning generic messages to clients; adds zondax/golem logger import |
| market/mk20/http/http.go | Removes error details from authentication failure responses |
| market/mk12/mk12_utils.go | Sanitizes database query errors in deal status endpoint |
| harmony/harmonydb/userfuncs.go | Integrates errFilter function into all database operations; improves variable naming |
| harmony/harmonydb/harmonydb.go | Masks password in connection strings with asterisks; adds errFilter function to detect and redact errors containing sensitive database connection information |
| go.mod | Upgrades yugabyte/pgx to v5.7.6-yb-1; moves zondax/golem from indirect to direct dependency |
| go.sum | Updates checksums for yugabyte/pgx version change |
| documentation/en/design/README.md | Adds security boundary documentation explaining what system components should be protected and what can be safely shared with untrusted parties |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LexLuthr
approved these changes
Feb 9, 2026
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.
Stop sharing internal details users do not need.