Skip to content

fix(wallet): verify lock-owner identity cross-platform - #1

Open
Ahmett101 wants to merge 1 commit into
Kewe63:fix/wallet-mutation-lockfrom
Ahmett101:fix/763-cross-platform-lock-identity
Open

Ahmett101 wants to merge 1 commit into
Kewe63:fix/wallet-mutation-lockfrom
Ahmett101:fix/763-cross-platform-lock-identity

Conversation

@Ahmett101

Copy link
Copy Markdown

Summary

Follow-up for nansen-ai#763. The wallet mutation lock now records and verifies process-start identity on macOS, Windows, Linux, and Android instead of accepting PID-only liveness outside Linux. Identity-less owner and recovery records are rejected on every platform, so PID reuse cannot repeatedly strand wallet mutations. Lock ownership tokens are also compared with crypto.timingSafeEqual.

Changes

  • src/wallet.js: collect stable process-start identities from procfs, macOS ps, or Windows PowerShell; fail closed when a live process identity cannot be verified; require identity in every lock record; compare lock tokens timing-safely.
  • src/__tests__/wallet-concurrency.test.js: run identity-less-record regressions on every platform and extend PID-reuse coverage beyond Linux.

Verification

  • npm run lint — passed.
  • git diff --check — passed.
  • Wallet concurrency tests excluding two Android hard-link failures: 22 passed, 3 skipped.
  • Other impacted wallet/Privy tests: 138 passed.
  • The two remaining Termux failures reproduce unchanged at the original fix(wallet): serialize wallet mutations (#762) nansen-ai/nansen-cli#763 head eed52e66: Android denies fs.linkSync with EACCES. GitHub's supported Linux CI exercises those tests.

This PR targets Kewe63:fix/wallet-mutation-lock; merging it updates the head branch of nansen-ai#763.

Persist and compare process start identities on macOS, Windows, Linux, and Android so PID reuse cannot strand or steal the wallet mutation lock. Reject identity-less records on every platform and use timing-safe comparisons for lock ownership tokens.
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

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