π‘οΈ Sentinel: [MEDIUM] Mask plain-text passwords and PIN during migration#178
π‘οΈ Sentinel: [MEDIUM] Mask plain-text passwords and PIN during migration#178TargetMisser wants to merge 1 commit into
Conversation
Co-authored-by: TargetMisser <52361977+TargetMisser@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9aa46cd82b
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (legacy) { | ||
| const parsed: PasswordEntry[] = JSON.parse(legacy); | ||
| await SecureStore.setItemAsync(PASSWORDS_KEY, legacy); | ||
| await AsyncStorage.setItem(PASSWORDS_KEY, '***MASKED***'); |
There was a problem hiding this comment.
Do not treat sentinel writes as secure wiping
On Android this does not actually overwrite the previous plaintext password row: I checked @react-native-async-storage/async-storage and its native setItem path uses INSERT OR REPLACE INTO catalystLocalStorage, while removeItem issues a SQLite DELETE, so replacing the value with a sentinel and then deleting it can still leave the original secret in SQLite free pages or WAL/journal data. For legacy password/PIN migrations on the database-backed AsyncStorage path, the sensitive value therefore remains forensically recoverable even after this code runs; use a storage-level secure deletion/vacuum/secure_delete strategy or avoid claiming this as a secure wipe.
Useful? React with πΒ / π.
π¨ Severity: MEDIUM
π‘ Vulnerability: During the initial app launch, legacy plaintext passwords and PINs were migrated from
AsyncStorageto the encryptedSecureStore. Following the transfer, the plaintext entries were removed usingAsyncStorage.removeItem(). In database-backed storage systems (such as SQLite), deleting a row only flags it as deleted but does not immediately overwrite the data on disk, leaving the plaintext secrets recoverable via disk forensics until the database is naturally vacuumed or overwritten. Additionally,getSecurePin()incorrectly assumedSecureStorewould throw an error if missing, breaking its legacy fallback logic.π― Impact: An attacker with physical access to the device or a malicious application with elevated permissions could extract the deleted, unencrypted sensitive information directly from the device's storage files.
π§ Fix:
'***MASKED***'viaAsyncStorage.setItem()prior to invokingremoveItem().getSecurePin()to properly handlenullresolution fromSecureStoreand perform a masked migration.PasswordScreen.tsxandbackupManager.tslegacy import).β Verification:
npm run typecheck).npx jest --passWithNoTests).AsyncStorage.setItem(..., '***MASKED***')step executes beforeremoveItem().PR created automatically by Jules for task 6119115945820354844 started by @TargetMisser