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
Media authorization in storage/storage.rules is survey-scoped, while the equivalent Firestore rules are owner-scoped.
Storage rules authorize media at survey level, not owner level:
Reads leak: allow read: if canViewSurvey() ignores canViewDataCollectedByOthers, and read includes list — any collector can list and download everyone's photos, even when Firestore hides their submissions.
Cause: the upload path user-media/surveys/{surveyId}/submissions/{taskId}-{uuid}.jpg carries no user or submission ID, and putFile() sets no metadata. The owner is in Firestore (submission['5']) but only reachable submission → path; rules can't query.
Fix: add {submissionId} to the upload path (ground-android) so rules can do an exact firestore.get() and mirror firestore.rules:206-215. Needs a migration for existing objects.
Media authorization in storage/storage.rules is survey-scoped, while the equivalent Firestore rules are owner-scoped.
Storage rules authorize media at survey level, not owner level:
Cause: the upload path user-media/surveys/{surveyId}/submissions/{taskId}-{uuid}.jpg carries no user or submission ID, and putFile() sets no metadata. The owner is in Firestore (submission['5']) but only reachable submission → path; rules can't query.
Fix: add {submissionId} to the upload path (ground-android) so rules can do an exact firestore.get() and mirror firestore.rules:206-215. Needs a migration for existing objects.