Skip to content

BitWindow wallet & cheque API (1 of 4): 9 fixes from a security review - #2147

Open
giaki3003 wants to merge 9 commits into
LayerTwo-Labs:masterfrom
giaki3003:fix/w5-area-bwsrv-wallet-1
Open

giaki3003 wants to merge 9 commits into
LayerTwo-Labs:masterfrom
giaki3003:fix/w5-area-bwsrv-wallet-1

Conversation

@giaki3003

Copy link
Copy Markdown
Contributor

A set of 9 independent fixes to the BitWindow wallet & cheque API, stacked on one branch so they can be reviewed together and cherry-picked individually. Based on current master; the branch builds and its tests pass at the tip (9 files changed, 652 insertions(+), 40 deletions(-)).

Fixes (oldest first)

  • 4af0a2431 BitWindow marks zero-confirmation cheques as funded and exposes the bearer private key before any confirmation
  • 3dba42257 BitWindow CreateSidechainDeposit accepts negative int64 slot and wraps it to uint32, forwarding 0xffffffff as SidechainId to the enforcer
  • 142a663e3 BitWindow CreateCheque accepts zero expected amount and locks the record once funded
  • 47aaea5b3 BitWindow cheques.GetNextIndex reuses HD indices after delete → deterministic address reuse and cross-cheque fund attribution
  • 59109e8e2 BitWindow SweepCheque cross-wallet walletId skips UpdateSwept, leaving owner cheque row with swept_txid = NULL
  • 2a673ddfd BitWindow LockWallet lets an in-flight send complete after locked
  • 2eaa85a74 BitWindow GetNewAddress succeeds while wallet is locked
  • 91d1e766b BitWindow RestoreBackup missing IsUnlocked() guard — wallet.json overwrite while observably locked
  • cd263494b BitWindow CreateBackup missing IsUnlocked() guard — wallet.json + multisig + tx DB exfiltration while observably locked

Each commit is self-contained — git cherry-pick <sha> works for any of them. Happy to split, reorder, or drop any. Finding reports for individual fixes available on request.

giaki3003 and others added 9 commits August 30, 2026 21:42
…the bearer private key before any confirmation

Bug: w5-20260602-0750-bitwindow-zero-conf-cheque (primary)
Finding: findings/20260602-0750-bitwindow-zero-conf-cheque-marked-funded-exposes-bearer-key.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 6a7be61)
… and wraps it to `uint32`, forwarding `0xffffffff` as `SidechainId` to the enforcer

Bug: w5-20260620-0137-glmclaw-confirm-kimiclaw-d (primary)
Finding: findings/20260620-0137-glmclaw-confirm-kimiclaw-drivechain-frontends-bitwindow-createdeposit-negative-slot-wrap.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit ab405d5)
…e record once funded

Bug: w5-20260620-2157-glmclaw-confirm-kimiclaw-d (primary)
Finding: findings/20260620-2157-glmclaw-confirm-kimiclaw-drivechain-frontends-bitwindow-createcheque-zero-expected-locks-record.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 55c05a2)
…→ deterministic address reuse and cross-cheque fund attribution

Bug: w5-20260624-1220-kimiclaw-confirm-glmclaw-d (primary)
Finding: findings/20260624-1220-kimiclaw-confirm-glmclaw-drivechain-frontends-bitwindow-cheque-getnextindex-reuse-after-delete.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 561bef7)
…pt`, leaving owner cheque row with `swept_txid = NULL`

Bug: w5-20260625-0221-kimiclaw-confirm-glmclaw-d (primary)
Finding: findings/20260625-0221-kimiclaw-confirm-glmclaw-drivechain-frontends-bitwindow-sweepcheque-cross-wallet-skips-updateswept.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 39f6e99)
Bug: w5-20260625-1508-kimiclaw-confirm-openclaw- (primary)
Finding: findings/20260625-1508-kimiclaw-confirm-openclaw-drivechain-frontends-bitwindow-lockwallet-send-toctou.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 4ab561f)
Bug: w5-20260626-1707-kimiclaw-confirm-openclaw- (primary)
Finding: findings/20260626-1707-kimiclaw-confirm-openclaw-drivechain-frontends-bitwindow-getnewaddress-locked-wallet.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 0d72248)
…json overwrite while observably locked

Bug: w5-20260627-1044-kimiclaw-confirm-glmclaw-d (primary)
Finding: findings/20260627-1044-kimiclaw-confirm-glmclaw-drivechain-frontends-bitwindow-restorebackup-locked-wallet-swap.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit cd02f22)
…son + multisig + tx DB exfiltration while observably locked

Bug: w5-20260627-1052-kimiclaw-confirm-glmclaw-d (primary)
Finding: findings/20260627-1052-kimiclaw-confirm-glmclaw-drivechain-frontends-bitwindow-createbackup-locked-wallet-exfiltration.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 550b409)
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