Repository navigation
Restrict cached sync device token to owning user on Linux/macOS - #25
Merged
Merged
Conversation
The device token is bearer auth for every sync request, but was cached with default permissions unlike the server's own bootstrap token (already restricted to user-only). On a shared box another local user could read ~/.strongbox/device-token and impersonate the device.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.strongbox/device-tokenwas written with default file permissions, unlike the sync server's own bootstrap token, which is already locked to user-only.UserRead|UserWriteon Linux/macOS after write, mirroringGet-StrongboxSyncBootstrapToken.ps1.Found during a security review of the new sync server feature (server-side token hashing/auth/crypto were reviewed and are sound - this was the one client-side gap).
Test plan
Initialize-StrongboxSync, skipped on Windows (CI runswindows-latestonly, so this only exercises manually on Linux/macOS today - verified logic against the existing bootstrap-token pattern).Invoke-Pester -Path Tests/Strongbox.Tests.ps1- 43 passed, 1 skipped (the new Linux/macOS-only test, skipped on this Windows machine), 0 failed.