fix(android): disable Auto Backup of on-device health data (allowBackup=false)#253
Conversation
…up=false) Per the secure-storage investigation: the highest-value, cheapest on-device hardening is not moving the token to Keystore — it's closing the `adb backup` extraction path. With allowBackup="true" a device-access adversary could pull the app sandbox, which holds the ENTIRE plaintext Dexie health PII DB (intake, vitals, meds, dose logs, …) plus the session token. Setting allowBackup="false" removes that vector for both, on all Android versions, with zero dependencies. No user data is lost: the data syncs to Neon Postgres (the device is not the system of record), so a reinstall/new device restores via sign-in + sync. The trade-off is that Android cloud/`adb` backup of app data is disabled — which for a health PII app is the privacy-correct default. The Keystore-plugin move is deliberately deferred (medium-cost async refactor across 7 files for marginal at-rest gain on a re-obtainable token); if on-device encryption is later wanted, the target is the Dexie health DB, not the token.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 28 minutes and 32 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why (from the secure-storage investigation)
I investigated moving the Bearer token to Android Keystore (as you asked). The research reframed the problem: that move is medium-cost (a 7-file async refactor) for marginal protection on the cheapest secret (a re-obtainable ~7-day opaque token) — and it misses the real exposure.
The actual currently-open hole:
android:allowBackup="true"means a device-access adversary canadb backupthe app sandbox, which holds the entire plaintext Dexie health-PII database (intake, weight, blood pressure, eating, meds, dose logs, …) plus the session token. Encrypting only the token would leave the crown jewels exposed.This one-line fix (
allowBackup="false") closes that vector for both the DB and the token, on all Android versions, zero dependencies — a strictly larger security win than the whole Keystore project.Trade-off (your call to merge)
adbbackup of app data is disabled. For a health-PII app this is the privacy-correct default (you don't want health data in Google cloud backup).Deferred (deliberately)
@aparajita/capacitor-secure-storage.error-log-servicelogs path-only;captureFailurenever includes headers/token).Validation