Skip to content

BitWindow server APIs: 8 fixes from a security review - #2143

Open
giaki3003 wants to merge 8 commits into
LayerTwo-Labs:masterfrom
giaki3003:fix/w5-area-bwsrv-misc
Open

giaki3003 wants to merge 8 commits into
LayerTwo-Labs:masterfrom
giaki3003:fix/w5-area-bwsrv-misc

Conversation

@giaki3003

Copy link
Copy Markdown
Contributor

A set of 8 independent fixes to the BitWindow server APIs, 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 (17 files changed, 713 insertions(+), 114 deletions(-)).

Fixes (oldest first)

  • 0e2ee8bb6 BitWindow CPU miner rejects Bitcoin Core JSON-RPC success responses
  • a329d108c BitWindow multisig group ID is only 24 bits, so a colliding group overwrites another group's saved state
  • 80c451245 BitWindow's GenerateM4Bytes only emits a 2-byte vote per sidechain that has a pending withdrawal bundle and never pads abstains (0xFFFF) for active sidechains without a bundle, so the M4 v0x02 vector is shorter than the enforcer's active-sidechain count and is rejected as InvalidVotes
  • 2c3f91cd6 BitWindow's BIP300 M3/M4 coinbase parser reads the commitment tag at a fixed offset that ignores the OP_RETURN data-push opcode (and uses a hardcoded length 38), and decodes the M3 sidechain-slot/hash fields in the wrong order, so it fails to recognize real enforcer-produced withdrawal-bundle commitments and mis-decodes the M3 slot
  • 21c2d444d BitWindow ListWithdrawals never invalidates its in-memory withdrawalCache when a mainchain reorg orphans the cached tip hash, so it keeps sending that orphaned hash as the incremental GetTwoWayPegData StartBlockHash and the endpoint stays permanently broken until restart
  • 9e347fef6 BitWindow GetNetworkStats races shared bandwidth tracker
  • c0d049276 BitWindow ListWithdrawals cold scan emits duplicate pending and succeeded rows for the same withdrawal bundle
  • e00fe12a9 BitWindow TimestampFile Missing Wallet Unlock Guard

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 8 commits August 30, 2026 21:57
Bug: w5-20260619-1436-kimiclaw-confirm-openclaw- (primary)
Finding: findings/20260619-1436-kimiclaw-confirm-openclaw-drivechain-frontends-bitwindow-cpuminer-jsonrpc-null-error.md
Severity: R3-T2

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 6d5d818)
…p overwrites another group's saved state

Bug: w5-20260604-0630-bitwindow-multisig-group-i (primary)
Finding: findings/20260604-0630-bitwindow-multisig-group-id-24bit-collision-overwrites-group-state.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 5279a4d)
…in that has a pending withdrawal bundle and never pads abstains (0xFFFF) for active sidechains without a bundle, so the M4 v0x02 vector is shorter than the enforcer's active-sidechain count and is rejected as InvalidVotes

Bug: w5-20260611-1130-bitwindow-m4-generator-omi (primary)
Finding: findings/20260611-1130-bitwindow-m4-generator-omits-abstains-for-active-sidechains-enforcer-invalid.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit fd2c591)
…g at a fixed offset that ignores the OP_RETURN data-push opcode (and uses a hardcoded length 38), and decodes the M3 sidechain-slot/hash fields in the wrong order, so it fails to recognize real enforcer-produced withdrawal-bundle commitments and mis-decodes the M3 slot

Bug: w5-20260611-1450-bitwindow-m3-m4-coinbase-p (primary)
Finding: findings/20260611-1450-bitwindow-m3-m4-coinbase-parser-ignores-push-opcode-and-mislays-m3-fields.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 260a6d6)
…awalCache when a mainchain reorg orphans the cached tip hash, so it keeps sending that orphaned hash as the incremental GetTwoWayPegData StartBlockHash and the endpoint stays permanently broken until restart

Bug: w5-20260613-1240-openclaw-confirm-kimiclaw- (primary)
Finding: findings/20260613-1240-openclaw-confirm-kimiclaw-bitwindow-listwithdrawals-reorg-incremental-stale.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 5b563d0)
Bug: w5-20260619-0119-kimiclaw-confirm-openclaw- (primary)
Finding: findings/20260619-0119-kimiclaw-confirm-openclaw-drivechain-frontends-bitwindow-networkstats-race.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit a536a83)
…d succeeded rows for the same withdrawal bundle

Bug: w5-20260619-0209-kimiclaw-confirm-openclaw- (primary)
Finding: findings/20260619-0209-kimiclaw-confirm-openclaw-drivechain-frontends-bitwindow-duplicate-withdrawal-bundles.md
Severity: R3-T4

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 982f744)
Bug: w5-20260704-0446-openclaw-confirm-kimiclaw- (primary)
Finding: findings/20260704-0446-openclaw-confirm-kimiclaw-drivechain-frontends-bitwindow-timestampfile-unlock-guard.md
Severity: R3-T4

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