fix: sanitize health check error responses - #891
Merged
feyishola merged 1 commit intoSep 1, 2026
Merged
Conversation
Contributor
|
@mazzam2006 (please sanitize health errors) |
feyishola
approved these changes
Sep 1, 2026
feyishola
left a comment
Contributor
There was a problem hiding this comment.
Approved — thanks for contributing! 🎉
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.
Overview
This PR fixes a security issue in the public health controller where raw caught errors were embedded in 503 responses. When a DB, Redis, or Stellar dependency check failed, unauthenticated callers hitting
/api/v1/health/*could see internal details such as connection strings, hostnames, and stack fragments. The fix logs each caught error server-side and returns only a generic status string to the client.Related Issue
Changes
🔒 Health Check Error Sanitization
backend/src/modules/health/health.controller.tserrorobjects in every catch block'sHttpExceptionbody with a generic status string (e.g."Service Unavailable").Logger.errorcalls to preserve full error context for diagnostic use without exposing it to callers.Verification Results
Closes #838