Skip to content

Security: solana-thailand/BeThere

Security

SECURITY.md

Security Policy

Reporting a Vulnerability

Do not report security vulnerabilities through public GitHub Issues.

Instead, report them via:

Please include:

  1. Description of the vulnerability
  2. Affected component (on-chain program, worker backend, frontend)
  3. Steps to reproduce or proof of concept
  4. Potential impact (fund loss, data exposure, access control bypass)
  5. Suggested fix (if available)

We aim to acknowledge reports within 48 hours and provide a substantive response within 7 days.

Scope

In Scope

Component Type Severity
bethere-escrow/ On-chain Solana program (Quasar) Critical, High, Medium
worker/src/solana_escrow.rs TX builders (deposit, refund, claim) Critical, High, Medium
worker/src/handlers/deposit.rs Deposit confirmation, webhook handling Critical, High
worker/src/auth.rs JWT authentication, session management Critical, High
worker/src/middleware.rs Auth guards, security headers High, Medium
Worker secrets handling env.secret(), debug redaction High

Out of Scope

  • Social engineering attacks
  • Denial of service (Cloudflare Workers handles DDoS mitigation)
  • Third-party service vulnerabilities (Google OAuth, Helius RPC)
  • Devnet-only issues (test tokens, faucet abuse)
  • Issues requiring DEV_MODE=1 to exploit

Known Security Findings

The BeThere escrow has undergone an internal security audit with 15 findings (12 fixed, 3 confirmed safe). See docs/security_audit.md for full details.

Force Delete (Devnet Cleanup)

The DELETE /api/events/{id}/delete endpoint with ?force=true allows SuperAdmin to hard-delete events in Draft or Archived status, bypassing the SEC-004 escrow guard. This is intended only for devnet cleanup and is gated at the handler level to SuperAdmin role only. When force mode is used, an explicit warning is logged server-side. In normal mode (no force param), only Archived events with closed escrows can be hard-deleted.

Critical / High (Must Fix Before Mainnet)

ID Severity Title Status
SEC-001 πŸ”΄ Critical Check-in gate enables complete fund theft βœ… Fixed (Phase 3)
SEC-002 🟠 High Escrow fields mutable after on-chain init βœ… Fixed (Phase 1)
SEC-012 🟠 High Refund deadline race with claim_forfeited βœ… Fixed (Phase 5)

Medium

ID Title Status
SEC-003 No maximum deposit cap βœ… Fixed (Phase 1)
SEC-004 Archive doesn't deactivate on-chain escrow βœ… Fixed (Phase 1)
SEC-005 Explorer links hardcoded to devnet βœ… Fixed (Phase 2)
SEC-009 transfer() not transfer_checked() (Token-2022) βœ… Fixed (Phase 3)
SEC-010 AttendeeDeposit PDAs never closed (rent leak) βœ… Fixed (Phase 4)
SEC-011 No event_end guard on mark_checked_in βœ… Fixed (Phase 3)
SEC-013 Vault griefing via external USDC airdrop βœ… Fixed (Phase 5)
SEC-014 No wallet network detection (wrong cluster TX) βœ… Fixed (Phase 6)

Info (Confirmed Safe)

ID Title Status
SEC-007 Worker cannot manipulate funds (non-custodial) βœ… Confirmed Safe
SEC-008 On-chain escrow fields immutable after creation βœ… Confirmed Safe
SEC-015 Stranded lamports on token accounts (never recovered) βœ… Confirmed Safe

Security Audit References

Solana Foundation Security Checklist Compliance

Cross-referenced against the Solana Foundation Security Checklist. Full mapping in docs/security_audit.md.

Category Status Notes
Owner Checks βœ… Compliant Quasar framework enforces owner == program_id via typed Account<>
Signer Checks βœ… Compliant All mutating instructions require Signer + has_one(organizer/attendee)
Arbitrary CPI Prevention βœ… Compliant Program<TokenProgram> enforces CPI target is SPL Token
Reinitialization Prevention βœ… Compliant init constraint on PDA accounts; unique seeds prevent reuse
PDA Sharing Prevention βœ… Compliant Seeds include organizer+event_id (escrow) and event+attendee (deposit)
Type Cosplay Prevention βœ… Compliant Discriminators 1 (EventEscrow) and 2 (AttendeeDeposit)
Duplicate Mutable Accounts βœ… Compliant require_distinct helper checks all 8 instruction handlers for duplicate addresses
Revival / Close Attacks βœ… Compliant close(dest=organizer) in Quasar; vault closed atomically with escrow
Data Matching βœ… Compliant has_one(organizer) and address = Seeds(...) constraints on all accounts
Checked Math βœ… Compliant All arithmetic uses checked_add/checked_sub (SEC-009 audit)
Token-2022 Compatibility βœ… Compliant transfer_checked() with mint + decimals (SEC-009 fix)
Rent Reclamation βœ… Compliant close_deposit instruction + GC path (SEC-010 fix)
Formal Verification βœ… Verified 13 Kani harnesses, 729 checks, all pass
Payment UX/Security βœ… Compliant Custom Solana Pay flow (not Commerce Kit) β€” 6/6 checks pass. Deposits go to PDA escrow, not merchant wallet

Bug Bounty

No formal bug bounty program is currently active. This may change after the mainnet deployment. Security researchers who submit valid findings will be credited in the security audit document.

Disclosure Policy

  • Coordinated disclosure: We ask that vulnerabilities be kept confidential until a fix is deployed.
  • Timeline: We aim to deploy fixes for Critical/High findings within 30 days of confirmation.
  • Credit: Researchers who report valid vulnerabilities will be credited (with permission) in audit documentation.

There aren't any published security advisories