Skip to content

Conversation

@jonathanlab
Copy link
Contributor

@jonathanlab jonathanlab commented Dec 2, 2025

We need to store our auth and refresh token somewhere else than in local storage. We temporarily put it there because the safe storage prompt was annoying in dev.

This PR makes its so it's instead stored encrypted in application support in renderer-store.json.

The encryption key is derived from node-machine-id which returns a stable hardware UUID.

Format is like so.

  {
    "v": 1, // we could bump this if needed.
    "iv": "<random 16 bytes, base64>",
    "data": "<ciphertext, base64>",
    "tag": "<auth tag, base64>"
  }

If someone has file access on your machine, they can derive the same key. But if an attacker has that level of access, the user has bigger problems. The encryption primarily prevents token theft via cloud sync/backups/similar cases.

@jonathanlab jonathanlab requested a review from a team as a code owner December 2, 2025 16:10
@wiz-7ad640923b
Copy link

wiz-7ad640923b bot commented Dec 2, 2025

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities 2 Medium 1 Low
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Total 2 Medium 1 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@jonathanlab jonathanlab merged commit 159a7a9 into main Dec 2, 2025
10 checks passed
@jonathanlab jonathanlab deleted the fix/persist-auth-outside-renderer branch December 2, 2025 16:53
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.

3 participants