You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hardening: input validation and boundary guards in database feedback #19891
record_feedback_event accepted raw unvalidated uid and target_id strings, potentially persisting blank whitespace strings into Firestore documents.
_idempotent_event_id hashed f'{uid}:{feedback_id}' without normalization; leading/trailing whitespace variances across retries would result in differing SHA-256 hashes for logically identical actions.
Document lookup functions (get_feedback_event, get_report) did not validate argument types/blank strings before calling Firestore collection .document(...).
backend/routers/mobile_feedback.py did not explicitly catch database ValueError exceptions and map them to HTTP 400.
Proposed Solution
Validate and strip whitespace for uid and target_id in write operations.
Ensure hash parity across write and replay paths by normalizing uid and feedback_id in _idempotent_event_id.
Guard get_feedback_event, get_report, save_report, and list_negative_events against invalid arguments and boundary conditions.
Catch ValueError in submit_mobile_feedback and return HTTPException(status_code=400, detail=str(exc)).
Activity
aryanorastar commentedon Nov 5, 2026
Thanks for putting this together. We aren't doing bounties at the moment, so we're closing the bounty proposal issues for now — thanks for the fix! 🙏