Fair Labs · Smart Contract Security AssessmentFair Labs Client Hub

Fair Casino Core Pentest

Zealynx audited the Fair Casino TypeScript backend services and frontend verification utilities. The fourteen-day review covered critical money flows (deposits, withdrawals, atomic balance mutations) and the provably-fair game integrity surface (commit-reveal cryptography, seed derivation, server-side game state). Thirteen issues were identified: four High (wallet auth DoS via unstable challenge endpoint; deposit credited to wrong user via sender inference fallback; provably-fair guarantees weakened when client omits seed; server can choose serverSeed after seeing clientSeed), six Medium (mostly around WebSocket subscription enforcement, input validation, and verification consistency), and three Low. All findings were fixed by Fair Casino and verified by Zealynx.

TypescriptSmart Contract Code Review2026-01-27Zealynx methodology
Total findings
13
13 fixed
Critical
00
High
04
Medium
06
Low + Info
03
02

Scope

6 files · 6,500 SLOC
Initial commit
955864f390f5
Platform
- · Typescript
Methodology
File
backend/src/services/deposit-monitor.ts
backend/src/services/auth
backend/src/services/withdrawal
backend/src/services/provably-fair
backend/src/websocket
frontend/verification utilities
03

Findings

click any row for the full write-up
04

Key Findings

  • Wallet authentication blocked by unstable challenge endpoint (H-01, fixed). The challenge endpoint returned HTTP 429 and 500 errors, blocking wallet login and effectively causing denial of service for legitimate users. Phantom never reached the signature step.
  • Deposits credited to the wrong user via sender inference fallback (H-02, fixed). When the parsed token transfer returned an unknown sender, the deposit monitor fell back to the first signer in the transaction. In multi-instruction transactions (aggregators, multisig, relayers) the first signer was not the depositor, so credit landed on the wrong account.
  • Provably-fair guarantees weakened when the client omits its seed (H-03, fixed). The session initialization allowed the server to generate both serverSeed and clientSeed when no client seed was provided, enabling cherry-picking of seed pairs that produced house-favorable outcomes while still passing verification.
  • Server could choose serverSeed after seeing clientSeed (H-04, fixed). The commit-reveal order was breakable: the server could observe clientSeed before committing to serverSeedHash, enabling outcome manipulation without detection by a verifier.
  • Six Medium findings covered client-seed validation (whitespace, low-entropy, no charset bounds), WebSocket crash events broadcast to all clients without subscription enforcement, WebSocket JWT validation bypassing centralized HTTP controls, verification logic using inconsistent hash/derivation vs gameplay, hexadecimal-string bet amount coercion, and a duplicate Mines start that desynchronized client/server state.
  • Three Low findings covered Fairness "Verifier" producing "Verification Successful" results for games that never occurred (not bound to game history), insecure randomness in session ID generation, and a reflected request path in error responses (unnormalized route handling).

All thirteen issues were fixed by Fair Casino and verified by Zealynx during the validation pass.

05

Team & approval

Lead Auditor
Fernando
@0xMrjory
06

Disclaimer

This audit is not an endorsement and does not constitute investment advice. Zealynx reviewed the codebase at the commits listed in section 02 over the engagement window. Findings are limited to issues identified within that scope and do not preclude the existence of other vulnerabilities. Subsequent code changes are not covered by this report unless the engagement is explicitly extended.

Download PDF (38p)
ZEALYNX SECURITY · published 2026-01-27
13 findings · Typescript