[Bounty proposal] fix(backend/candidates): sanitize store error and task link validation reflections ($50 proposed)
Author: ajin558Created Sep 25, 2026Updated Sep 28, 2026
Following the contribution guide's invitation to propose paid work — @kodjima33, @josancamon19, would a US$50 bounty be appropriate for this? Proposed amount, not an existing award. Fix and tests are already up as PR #18851.
What problem is being solved?
In backend/routers/candidates.py, caught WorkstreamCandidateResolverUnavailableError, generic CandidateStoreError, and TaskLinkValidationError previously reflected raw str(exc) directly into HTTP responses. This risks exposing internal database schemas, collection identifiers, or validator implementation internals in API error envelopes.
What is the proposed solution?
- Introduce
_sanitize_candidate_error(exc: Exception, fallback: str) -> strto log underlying failure classes vialogger.warningserver-side, while strictly returning standardized fallback strings ("Workstream candidate resolver is temporarily unavailable","Candidate operation could not be completed","Invalid candidate task link parameters"). - Wire
_raise_store_errorandaccept_candidateexception handlers through the sanitized error helper. - Add full hermetic test coverage in
backend/tests/unit/test_candidates_error_sanitization.pyverifying sanitized behavior and ensuring zero raw exception leaks remain.
Implemented and tested in PR #18851.
Source: BasedHardware/omi