Repository navigation
Server 2.0.0-alpha.5: security fix, a signature with every wrapped vault key - #14
Merged
Merged
Conversation
Security fix (SecretSpace 3 test versions only). The server stores each member's wrapped copy of a vault key; a device took whatever copy was listed, so a dishonest server could wrap a key of its own, call it a new key generation, and read the vault uploaded under it. The clients now sign each wrapped key and check the signature before they take one. The server keeps the signature with the key and returns it: - key_sig in POST /v2/vaults and in PUT .../members/<user> (new member), key_sigs in POST .../rotate (one per member who stays; a key change without them clears the old ones); - key_sig and key_signer with each vault in /v2/me; key_signer is the account whose session sent the key, never a name from the request; - PUT /v2/vaults/<id>/key-sig: a member signs the key it already holds (vaults from before this version), only while it has no signature; - /health lists "signed-keys". The server does not verify the signatures; the devices do. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011ojnyVg7ccsR3pZ64s7aRH
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.
Security fix, server side. Server version 2.0.0-alpha.5 (a test version; Latest stays as it is). Affects the SecretSpace 3 test versions only; the 2.x routes and the stable releases are not involved.
The problem
The server stores each member's wrapped copy of a vault key. Until now a device took whatever copy the server listed. A dishonest server, or someone who broke into it, could therefore wrap a key of its own to a member's public key, call it a new key generation, and read the vault the device uploaded under it at its next sync. A test reproduced this and read a stored password.
The fix (most of it is in the clients)
key_siginPOST /v2/vaultsand inPUT /v2/vaults/<id>/members/<user>for a new member;key_sigs, one per member who stays, inPOST /v2/vaults/<id>/rotate;key_sigandkey_signerwith each vault in/v2/me.key_signeris always the account whose session sent the key, never a name from the request.PUT /v2/vaults/<id>/key-sig: a member signs the key it already holds, for vaults made before this version. Only while that key has no signature./healthlists"signed-keys".The server does not verify these signatures: it has no key to verify with, and its being untrusted is the point.
Tests
tests/test_server_v2_key_sigs.py: 25 tests over real HTTP.server/passman_server.pyis the same file in SecretSpace-Server-Linux and SecretSpace-Server-Windows.🤖 Generated with Claude Code
https://claude.ai/code/session_011ojnyVg7ccsR3pZ64s7aRH