Skip to content

[SPIKE] Investigate encrypting cached session/profile data at rest in browser storage #791

Open

Description

@meshackyaro

Description

Cached data (profile info, possibly session tokens depending on how the auth hook enhancement is implemented) is currently stored in plaintext in localStorage/IndexedDB, which is readable by any script with page access (e.g. a successful XSS elsewhere on the same origin).

Component

storage

Research Questions

  • What's actually being cached today that would be meaningfully sensitive if read by a malicious script on the same origin?
  • Would client-side encryption (e.g. deriving a key from a non-exportable WebCrypto key) meaningfully raise the bar, given the key would need to live somewhere accessible to the same origin anyway?
  • What's the performance/complexity cost versus the realistic security benefit, given XSS already implies a fairly compromised page?

Context

This is worth evaluating rigorously rather than assuming encryption is automatically a win, since the threat model (same-origin script access) can make client-side-only encryption provide limited real protection.

Proposed Approach

Review exactly what's cached today, research how comparable SDKs/wallets handle this tradeoff, and write up a threat-model-grounded recommendation.

Deliverables

A short threat-model doc with a clear recommendation: encrypt, don't bother, or reduce what's cached in the first place.

Difficulty

🟡 Medium

Estimated Time

1 day

Related Issues

Should inform the storage adapter interface enhancement — if encryption is recommended, it affects that interface's design.

Activity

  1. added
    priority: low
    difficulty: spike
    on Oct 29, 2026
  2. ranjan1969x commented on Nov 3, 2026

    @ranjan1969x

    Hi everyone,

    I reviewed the issue for Investigate encrypting cached session/profile data at rest in browser storage. We need to resolve 'investigate encrypting cached session/profile data at rest in browser storage' cleanly across the target modules.

    Proposed Implementation:

    1. Trace the current code execution path to isolate the behavior boundary.
    2. Implement a focused, modular fix for 'Investigate encrypting cached session/profile data at rest in browser storage' adhering strictly to repository architecture.
    3. Ensure defensive guards and backward compatibility are maintained.

    Testing & Verification:
    I will reproduce the target scenario locally, add regression unit tests, and confirm all CI checks pass 100% green.

    Happy to take this on. Please assign it over and I'll get the PR ready.

  3. GangDev6707 commented on Nov 7, 2026

    @GangDev6707

    Hi folks,

    I'd like to help resolve this issue. We need to resolve 'investigate encrypting cached session/profile data at rest in browser storage' cleanly across the target modules. I plan to trace the current code execution path to isolate the behavior boundary and implement a focused, modular fix for 'investigate encrypting cached session/profile data at rest in browser storage' adhering strictly to repository architecture, followed by ensure defensive guards and backward compatibility are maintained.

    I'll reproduce the target scenario locally, add regression unit tests, and confirm all CI checks pass 100% green to verify everything passes cleanly.

    Please assign this to me, ready to submit a tested patch with zero regressions.

  4. maxx-GENIUS commented on Nov 8, 2026

    @maxx-GENIUS
    Contributor

    Hi team,

    I reviewed the issue for Investigate encrypting cached session/profile data at rest in browser storage. We need to resolve 'investigate encrypting cached session/profile data at rest in browser storage' cleanly across the target modules.

    Proposed Implementation:

    1. Trace the current code execution path to isolate the behavior boundary.
    2. Implement a focused, modular fix for 'Investigate encrypting cached session/profile data at rest in browser storage' adhering strictly to repository architecture.
    3. Ensure defensive guards and backward compatibility are maintained.

    Testing & Verification:
    I will reproduce the target scenario locally, add regression unit tests, and confirm all CI checks pass 100% green.

    Please assign this to me and I will deliver a clean PR with passing tests shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: spikeinfrastructurepriority: lowsdk

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions