fix: redact dashboard health exception details#5457
Conversation
Signed-off-by: minyanyi <109479933+minyanyi@users.noreply.github.com>
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
kekehanshujun
left a comment
There was a problem hiding this comment.
Reviewed the dashboard health redaction changes.
The patch now keeps raw database/RPC/mint exception text out of the client-facing details payload while preserving server-side diagnostic context via logger.exception(...). The added tests cover sensitive filesystem paths, private RPC URLs, and mint lookup errors, and the existing health response shape remains intact.
Verification run locally on the PR version:
python -m pytest bridge\test_dashboard_api.py::TestBridgeHealth -q -o addopts=''-> 7 passedpython -m pytest bridge\test_dashboard_api.py -q -o addopts=''-> 25 passedpython -m py_compile bridge\dashboard_api.py bridge\test_dashboard_api.py-> passed
jaxint
left a comment
There was a problem hiding this comment.
LGTM! Thanks for contributing. Approved.
|
I took a look at the failing The CI failure does not appear to come from the dashboard health redaction changes. The failing step is the broad
The earlier CI steps passed, including lint, the security scan, and the attestation fuzz gate. The targeted bridge dashboard tests reported in the PR body are the right scope for this change, so this looks like a repo-wide CI dependency/setup issue rather than a regression introduced by #5457. |
ZacharyZhang-NY
left a comment
There was a problem hiding this comment.
Reviewed PR #5457 at head 0894074.
Validation performed:
- Checked issue #5442. The scoped bug is raw exception detail disclosure from
/bridge/dashboard/healthfor database, Solana RPC, and configured wRTC mint checks. - git fetch origin pull/5457/head:review-pr-5457 --force
- git diff --check origin/main...review-pr-5457 -- bridge/dashboard_api.py bridge/test_dashboard_api.py -> passed.
- python -m py_compile bridge/dashboard_api.py bridge/test_dashboard_api.py on an extracted PR-head tree -> passed.
- python -m pytest bridge/test_dashboard_api.py::TestBridgeHealth -q --confcutdir= -> 7 passed.
- python -m pytest bridge/test_dashboard_api.py -q --confcutdir= -> 25 passed.
The health endpoint now reports degraded component status with stable client-facing detail strings for database, Solana RPC, and wRTC mint failures, while preserving full exception details in server-side logs through logger.exception(...). The regression coverage injects private paths/tokens/account text and confirms those values stay out of the HTTP response. Approving.
TJCurnutte
left a comment
There was a problem hiding this comment.
Approved. I focused on the /bridge/dashboard/health failure paths that previously returned raw exception text.
Validation run against head 0894074db7c1071f8575fc58e8d66552bee9b9a2:
git diff --check origin/main...HEAD -- bridge/dashboard_api.py bridge/test_dashboard_api.py
PYTHONPATH=. python3 -B -m py_compile bridge/dashboard_api.py bridge/test_dashboard_api.py
PYTHONPATH=. uv run --no-project --with pytest --with flask --with requests python -B -m pytest -q bridge/test_dashboard_api.py --noconftestResults: diff-check and py_compile passed; the focused dashboard API test file passed with 25 passed in 1.64s.
The patch keeps the health endpoint useful while avoiding disclosure: database exceptions now return Database unavailable, Solana RPC exceptions return RPC unavailable, and mint lookup exceptions return Mint check unavailable, while the detailed exception still goes to the server log via logger.exception(...). The added tests exercise each failure class with secret-looking values and assert those values are not present in the HTTP response body.
Code Review — Bounty #73PR: fix: redact dashboard health exception details by @minyanyi
SummaryThis is a bug fix PR. Changes appear consistent with project patterns. Wallet: Reviewing under Bounty #73 — Code Review Bounty Program |
508704820
left a comment
There was a problem hiding this comment.
Redact dashboard health exception details. Good - health checks can expose service topology. Verify redaction is consistent across all health endpoints. - Xeophon (security review)
|
CI follow-up: I opened #5587 to fix the current blocking Focused validation for this PR remains the relevant signal for the changed files; the branch is still mergeable and already has review coverage. |
|
Closing as duplicate of #5443 by @hungle123-dev (first-posted 90 min earlier on the same issue). Per first-poster rule, only the original submitter gets bounty credit on a given issue. The fix in #5443 addresses the same root cause and is already under review. Appreciate the effort — for next time, please check open PRs against the same issue before filing. Thanks for the contribution. |
Fixes #5442.
Summary
/bridge/dashboard/health.logger.exception(...).Verification
python -m pytest bridge/test_dashboard_api.py::TestBridgeHealth -q-> 7 passedpython -m pytest bridge/test_dashboard_api.py -q-> 25 passedpython -m py_compile bridge\dashboard_api.py bridge\test_dashboard_api.pygit diff --checkWallet for accepted bounty payout:
RTC0197a0573c0239ab6a4483108b27769317d3490b