OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-wallet commits / 0b481c0

Phase 2: Fix core dump - timingSafeEqual not in Bare
- crypto.timingSafeEqual doesn't exist in Bare runtime - Implemented manual constant-time comparison using XOR - Prevents timing attacks while being Bare-compatible - Fixes core dump on API authentication Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
0b481c00a70c175c0efb54eb53053aea6b730ffb
by plankatron <fleeky@gmail.com> · 2026-01-27T20:45:03.000Z

Changed files (2) +13 -5

.claude/tmux-registry.json +1 -1
……@@ -8,7 +8,7 @@
88 "purpose": "Seeding pear://18x3enb54ttcr6uuhg5hh1cqzwi8ydnm658fmgyyjkzoqxd1ybso",
99 "command": "pear seed pear://18x3enb54ttcr6uuhg5hh1cqzwi8ydnm658fmgyyjkzoqxd1ybso .",
1010 "persistent": true,
11 "latest_version": "11447",
11 "latest_version": "11451",
1212 "last_deployed": "2026-01-27",
1313 "features": "Phase 2 COMPLETE: Auth + Encryption + Validation + Rate Limiting + CORS + Signed Invites + Password Unlock UI ✅"
1414 },
lib/auth.cjs +12 -4
……@@ -102,10 +102,18 @@ function verifyToken(req) {
102102 }
103103
104104 // Use constant-time comparison to prevent timing attacks
105 return crypto.timingSafeEqual(
106 Buffer.from(token),
107 Buffer.from(storedToken)
108 )
105 // Note: crypto.timingSafeEqual doesn't exist in Bare runtime
106 // Implement manual constant-time comparison
107 if (token.length !== storedToken.length) {
108 return false
109 }
110
111 let diff = 0
112 for (let i = 0; i < token.length; i++) {
113 diff |= token.charCodeAt(i) ^ storedToken.charCodeAt(i)
114 }
115
116 return diff === 0
109117}
110118
111119/**