Skip to content

[Security/Firebase] Enforce Stricter Firestore Security Rules to Prevent Unauthorized Data Access #406

@basantnema31

Description

@basantnema31

Description

The current firestore.rules configuration appears to be overly permissive in some areas. While it might allow for rapid prototyping, failing to strictly validate incoming data and restrict read/write access based on user authentication claims poses a significant security risk to the application's database.

Proposed Solution

  1. Audit Rules: Review the firestore.rules file to ensure no collections have open allow read, write: if true; rules.
  2. Implement Role-Based Access Control (RBAC): Ensure that only authenticated users can write data, and that users can only modify their own documents (e.g., request.auth.uid == resource.data.userId).
  3. Data Validation: Add request.resource.data checks to ensure incoming payloads contain the correct data types and required fields before writing to Firestore.

Value Added

Prevents malicious actors from scraping user data or polluting the database with invalid entries, ensuring the integrity of the DevPath platform.

Suggested labels: gssoc, quality:exceptional, level:advanced, type:security, area:backend

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions