Skip to content

Confirm Security Model for Temporary Store and Account Access - #673

Closed
aristidesstaffieri with Copilot wants to merge 28 commits into
mainfrom
copilot/sub-pr-664
Closed

aristidesstaffieri with Copilot wants to merge 28 commits into
mainfrom
copilot/sub-pr-664

Conversation

Copilot AI commented Jan 16, 2026 •

Copy link
Copy Markdown
Contributor

What

Security analysis and confirmation of the relationship between temporary store access and account authentication in the lazy private key loading implementation.

Why

Review feedback questioned whether the lazy key derivation at line 1514 could be exploited in LOCKED state to extract private keys without password authentication. This PR documents the security model and confirms defense-in-depth protections are correctly implemented.

Security Layers Validated:

  1. State-based access control: getTemporaryStore() blocks HASH_KEY_EXPIRED and NOT_AUTHENTICATED states, validates hash key expiration in LOCKED state
  2. Function-level protection: getActiveAccount() explicitly blocks LOCKED state (lines 1490-1496) before lazy derivation code path
  3. Encryption protection: Temporary store requires hash key derived from password for decryption
  4. Authentication-gated entry: mnemonicPhrase only enters store via signIn/signUp with password validation

The code at line 1514 is unreachable in LOCKED state due to explicit checks at line 1490.

Known limitations

N/A

Checklist

PR structure

  • This PR does not mix refactoring changes with feature changes (break it down into smaller PRs if not).
  • This PR has reasonably narrow scope (break it down into smaller PRs if not).
  • This PR includes relevant before and after screenshots/videos highlighting these changes.
  • I took the time to review my own PR.

Testing

  • These changes have been tested and confirmed to work as intended on Android.
  • These changes have been tested and confirmed to work as intended on iOS.
  • These changes have been tested and confirmed to work as intended on small iOS screens.
  • These changes have been tested and confirmed to work as intended on small Android screens.
  • I have tried to break these changes while extensively testing them.
  • This PR adds tests for the new functionality or fixes.

Release

  • This is not a breaking change.
  • This PR updates existing JSDocs when applicable.
  • This PR adds JSDocs to new functionalities.
  • I've checked with the product team if we should add metrics to these changes.
  • I've shared relevant before and after screenshots/videos highlighting these changes with the design team and they've approved the changes.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

leofelix077 and others added 28 commits December 26, 2025 15:05
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI mentioned this pull request Jan 16, 2026
15 tasks
Copilot AI changed the title [WIP] Address feedback on relationship between temporary store and account access Confirm Security Model for Temporary Store and Account Access Jan 16, 2026
Base automatically changed from chore/3034123 to main February 19, 2026 00:08
@CassioMG

Copy link
Copy Markdown
Contributor

closing this since the PR it analyzed has been merged

@CassioMG CassioMG closed this Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants