Skip to content

Hardening: input validation and boundary guards in database feedback #19891

Closed as not planned

Description

@brandonstensby-dotcom

Problem

In backend/database/feedback.py:

  • 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

  1. Validate and strip whitespace for uid and target_id in write operations.
  2. Ensure hash parity across write and replay paths by normalizing uid and feedback_id in _idempotent_event_id.
  3. Guard get_feedback_event, get_report, save_report, and list_negative_events against invalid arguments and boundary conditions.
  4. Catch ValueError in submit_mobile_feedback and return HTTPException(status_code=400, detail=str(exc)).
  5. Add comprehensive hermetic unit tests.

References

Activity

  1. added
    captureLayer: Audio recording, device pairing, BLE
    p3Priority: Backlog (score <14)
    retrieval-actionLayer: Search, questions, tasks, exports
    and removed
    captureLayer: Audio recording, device pairing, BLE
    p3Priority: Backlog (score <14)
    on Oct 6, 2026
  2. aryanorastar commented on Nov 5, 2026

    @aryanorastar
    Collaborator

    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! 🙏

  3. moved this from In progress to In review in omi TODO / bountieson Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3Priority: Backlog (score <14)retrieval-actionLayer: Search, questions, tasks, exports

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions