Skip to content

fix(keystore): await aborted relock task in lock()#468

Open
ouicate wants to merge 1 commit into
zcash:mainfrom
ouicate:fix/keystore-lock-relock-race
Open

fix(keystore): await aborted relock task in lock()#468
ouicate wants to merge 1 commit into
zcash:mainfrom
ouicate:fix/keystore-lock-relock-race

Conversation

@ouicate

@ouicate ouicate commented Jun 10, 2026

Copy link
Copy Markdown

Summary

  • Fixes GHSA-8cfr-hmvc-2333: KeyStore::lock() now awaits aborted relock tasks before clearing identities, matching the existing unlock() behavior.
  • Without this, a rapid walletpassphrase after walletlock could report success while leaving the wallet locked, because a stale relock task could clear identities after unlock() repopulated them.
  • Adds a regression test that exercises repeated lock/unlock cycles with an active relock task.

KeyStore::lock() aborted the background relock task but did not await its
completion, unlike unlock(). A rapid walletpassphrase after walletlock could
therefore leave the wallet locked despite reporting success when the stale
task cleared identities after unlock() repopulated them.

Fixes GHSA-8cfr-hmvc-2333.

Co-Authored-By: Cursor <cursoragent@cursor.com>
@ouicate

ouicate commented Jun 16, 2026

Copy link
Copy Markdown
Author

Please review @nullcopy

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.

1 participant