Skip to content

verify the passphrase on every unlock and bound the ttl - #48

Open
quocle108 wants to merge 2 commits into
tetherto:mainfrom
quocle108:fix/daemon-verify-passphrase-on-unlock
Open

quocle108 wants to merge 2 commits into
tetherto:mainfrom
quocle108:fix/daemon-verify-passphrase-on-unlock

Conversation

@quocle108

Copy link
Copy Markdown
Member

Description

The daemon verified the passphrase only when opening a wallet from cold. On the already-unlocked path it reset the session timer and returned ok without checking, so unlock_wallet is now verified on every call. It also rejects a ttl it cannot honour, in the CLI parser and in the daemon.

Motivation and Context

Any socket peer could extend or shorten a live session with a wrong passphrase, including setting it to never expire. The CLI masked this by decrypting locally before contacting the daemon, but scripts and raw socket peers get no such check

Related Issue

Closes #

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@quocle108
quocle108 requested a review from jonathunne October 23, 2026 03:05
@quocle108 quocle108 self-assigned this Oct 23, 2026

@jonathunne jonathunne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One remaining gap: for a wallet that's already unlocked, the passphrase is checked against the seed file on disk, not against the seed the live session holds. A process running as the same user can swap in its own seed file, unlock with its own passphrase and ttl: 0, then put the original back, and the real session never expires.

I'd suggest storing a hash of the seed at first unlock and refusing later unlocks that don't match.

This branch has not been deployed

No deployments
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.

2 participants