This document establishes the security policy, production hardening requirements, and deployment verification procedures for Inqoura.
We take security seriously. If you discover a vulnerability in Inqoura, please report it responsibly rather than opening a public issue.
- Reporting Email:
support@inqoura.app - Information to Include:
- Description of the vulnerability and potential impact
- Step-by-step reproduction instructions or proof-of-concept
- Affected platform, screen, endpoint, or configuration
- Any relevant logs, screenshots, or code references
We will review reports promptly, determine severity, and coordinate a fix before public disclosure.
In React Native and Expo applications, client-side JavaScript code and configuration bundles (such as google-services.json and EXPO_PUBLIC_* environment variables) are publicly readable by design. Anyone can decompile or inspect the mobile bundle.
Therefore, security must never rely on client-side secrets. Trust is enforced through:
- Firestore & Storage Security Rules: Strict boundaries defining read/write access per UID and role.
- Firebase Auth Custom Claims: Server-verified roles (
admin,premium) that cannot be modified by client requests. - Firebase App Check & Play Integrity: Cryptographic attestation verifying that incoming traffic originates from genuine, untampered app instances on Android.
- Environment Isolation: Dedicated Firebase projects for development and production.
- Client Privilege Isolation: Normal authenticated users cannot alter their own
role,plan, or administrative flags. - Admin Access: Requires either a verified Firebase custom claim (
admin: true) or an explicit admin document verified against the user's verified email. - Premium Access: Verified against active RevenueCat server-side entitlements and Firebase custom claims. The app never grants premium access solely from locally cached client state.
Deploy production Firestore and Storage rules:
firebase login
firebase use <your-production-project-id>
firebase deploy --only firestore:rules,storageConfirm the following production behaviors:
- Signed-out users cannot read private user profile documents or scan histories.
- Authenticated users cannot modify their own
roleorplanfields. - Authenticated users cannot write to
adminConfigor overrideproducts. - Scan history writes are strictly scoped to
users/{uid}/scanHistory/{scanId}and bounded to 500 items. - Correction reports (
correctionReports) can only be created with valid schema and cannot overwrite existing reports.
Admin privileges must be granted server-side using the project's provisioning script:
GOOGLE_OAUTH_ACCESS_TOKEN="$(gcloud auth print-access-token)" \
FIREBASE_PROJECT_ID=<your-production-project-id> \
TARGET_UID=<firebase-auth-uid> \
node scripts/grant_admin_claim.mjsAfter executing:
- Sign out and sign back in on the target client device.
- Verify that administrative panels and endpoints are accessible.
- Verify that non-admin accounts receive permission denied errors on admin resources.
To prevent API abuse, data scraping, and unauthorized backend access from modified clones:
- Client-side token validation and secure Firebase Firestore rules.
- RevenueCat entitlement checks with fallback verification.
- Public client configs decoupled from administrative authorization.
- Route RevenueCat subscription webhook events to a secure Cloud Function / backend.
- Automatically set or revoke Firebase custom claims (
premium: true) based on verified server-to-server webhook payloads.
- Enable Firebase App Check in the Firebase Console for Firestore, Storage, and Cloud Functions.
- Register Android app with Google Play Integrity attestation.
- Observe metrics in monitoring mode before turning on strict enforcement.
- No Secret Commits: Verify that
.env,.env.local,google-services.json,keystore.properties, and service account JSONs remain in.gitignore. - Branch Protection: Enable branch protection on
mainrequiring pull request reviews and passing CI checks. - Secret Scanning: Keep GitHub Secret Scanning and Dependabot alerts active.