Repository navigation
Closed as not planned
Labels
Description
Summary
The desktop free trial paywall has a client-side enforcement gap that allows trial-expired users to continue using features without upgrading.
Current Architecture
The trial enforcement has two layers:
1. Backend (server-side) — enforces on specific endpoints
- Chat (
/v2/messages):enforce_chat_quota()checksis_trial_paywalled(uid, platform)and returns HTTP 402 when trial expired - Chat WebSocket: checks
is_trial_paywalled()and closes with code 1008 - Push-to-talk: checks
is_trial_paywalled()before hitting Deepgram - Platform gating: only applies when
X-App-Platformheader ismacosordesktop
2. Client (desktop app) — enforces on capture toggles
fetchTrialMetadata()callsGET /v1/users/me/trialevery 60 seconds- If
trialExpired == true, setsisPaywalled = true blockIfPaywalled()gatesstartTranscription()and shows upgrade popupisPaywalledpersisted to UserDefaults (desktop_isPaywalled)
Bypass Vectors
A. Missing X-App-Platform header bypass
is_trial_paywalled()returnsFalsewhen platform isNoneor not in{"macos", "desktop"}- A modified client omitting the
X-App-Platformheader bypasses all server-side trial checks - Chat, PTT, and listen WebSocket all gate on this header
B. Client-side fetch failure = fail-open
fetchTrialMetadata()catch block only logs the error —isPaywalledstaysfalse- Backend
get_trial_metadata()also fails open: returnstrial_expired=Falseon any exception - A client blocking requests to
/v1/users/me/trial(e.g., DNS override, proxy rule) keeps the app unpaywalled indefinitely
C. isPaywalled defaults to false on fresh launch
isPaywalledinitializes from UserDefaults (desktop_isPaywalled), which defaults tofalse- Deleting the app's UserDefaults plist resets
isPaywalledtofalse - The app is usable between launch and the first successful
fetchTrialMetadata()response (up to 60s polling interval)
D. Listen WebSocket not gated by trial
startTranscription()is gated byblockIfPaywalled()on the client side- The backend listen WebSocket (
/v4/listen) does not checkis_trial_paywalled()— it relies on the client to not connect - A modified client or direct WebSocket connection bypasses the transcription paywall
Affected Code
- Client:
desktop/Desktop/Sources/AppState.swift—fetchTrialMetadata(),blockIfPaywalled(),isPaywalled - Backend:
backend/utils/subscription.py—is_trial_paywalled(),get_trial_metadata() - Backend:
backend/routers/chat.py—enforce_chat_quota()with platform header check - Backend:
backend/routers/transcribe.py— listen WebSocket (no trial check)
Related
- PR feat: Free trial paywall — backend endpoint, desktop countdown UI, pre-expiry nudges (#7329) #7341 — Desktop free trial paywall UX (merged)
- PR feat(backend): Add trial metadata endpoint for desktop paywall UX #7330 — Trial metadata endpoint
by AI for @beastoin
Activity
beastoin commentedon Jun 10, 2026
Closing as not planned per CTO directive (2026-06-10).
by AI for @beastoin