OAuth token storage: should the default become keyring or encrypted file? #1033
PierrunoYT
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem to decide
Zero's unified OAuth store currently documents/selects the plaintext file backend when storage is unspecified. The implementation publishes state atomically under a mode-0700 directory using mode-0600 files and a cross-process lock. Optional AES-GCM and keyring backends already exist.
This is not a claim that the file is world-readable: the existing permissions and atomicity controls are strong. The remaining tradeoff is at-rest confidentiality from same-account malware, backup/snapshot exposure, and accidental disclosure. The API-key credential store uses a stronger automatic default—keyring where supported or encrypted file—without silently selecting plaintext.
Audit context: finding
SEC-07atmainrevision1b5db1765672820caac1684b168c9898b5ba3593.Related issue #937 / PR #1007 address oversized multi-login keyring blobs; they do not decide the default OAuth storage policy.
Proposed direction
Consider an
autoOAuth storage policy aligned with the credential store:Existing plaintext stores must not be silently deleted, overwritten, or made inaccessible.
Design questions
autodo in CI, SSH/headless sessions, containers, and systems with a locked or size-limited keyring?Required migration properties
Full audit proposal: https://github.com/PierrunoYT/zero/blob/audit/codebase-audit-2026-09-08/docs/audit/SECURITY_AUDIT.md#sec-07--oauth-file-storage-defaults-to-plaintext
All reactions