Hide upstream exception details from readiness responses #113

Closed
opened 2026-08-06 14:46:51 +00:00 by rockachopa · 0 comments
Member

The /readyz error path currently serializes str(exc) for arbitrary upstream failures. A Gitea/httpx exception can contain internal hostnames, request details, or other sensitive diagnostics. Reproduce by making current_user() raise RuntimeError("internal upstream detail"); the response returns that text. Preserve the specific timeout and invalid-payload messages, but return a stable generic message for unexpected upstream exceptions.

Acceptance: an unexpected exception yields HTTP 503 with Gitea readiness check is temporarily unavailable, without the exception text; focused and full tests pass.

The `/readyz` error path currently serializes `str(exc)` for arbitrary upstream failures. A Gitea/httpx exception can contain internal hostnames, request details, or other sensitive diagnostics. Reproduce by making `current_user()` raise `RuntimeError("internal upstream detail")`; the response returns that text. Preserve the specific timeout and invalid-payload messages, but return a stable generic message for unexpected upstream exceptions. Acceptance: an unexpected exception yields HTTP 503 with `Gitea readiness check is temporarily unavailable`, without the exception text; focused and full tests pass.
timmy was assigned by rockachopa 2026-08-06 14:46:51 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: stackchain/stackchain-dashboard#113
No description provided.