Summary
Speakr contains a CSRF protection bypass caused by trusting any supplied API token and permanently exempting a view from CSRF checks for the worker lifetime. A network-reachable attacker who can meet the browser cookie and sibling-subdomain conditions may use cross-origin requests to change account settings, administrative status, or passwords, potentially bypassing SSO protections.
Affected context
The issue occurs in Speakr deployments using the affected request hook and token-authentication logic. A token supplied through a request, including a query parameter, may be treated as valid without cryptographic verification or database lookup. The risk is highest where browser cookies are sent to the application and attacker-controlled content can run on a sibling subdomain under the deployment's cookie configuration.
Exploit preconditions
- Attack surface: Network-reachable Speakr HTTP endpoints and browser-authenticated sessions
- Required access: The attacker generally needs control of content on a qualifying sibling subdomain or another way to induce a victim browser to make cross-origin requests
- Trigger point: A request containing a token causes the targeted view to be added to the process-global CSRF exemption set
- Why exploitation is possible: Token presence is accepted as authentication without validation, and the exemption persists for the worker lifetime across HTTP methods, allowing a later state-changing request to bypass CSRF validation
Why this happens
The vulnerability combines improper authentication validation with incorrect CSRF exemption state management. The token-authentication function treats the presence of any token as proof of authentication rather than verifying its integrity, existence, or authorization, which maps to CWE-287: Improper Authentication. The request hook then permanently modifies a process-global exemption collection for a view, allowing a cross-origin request to affect later state-changing requests; this maps to CWE-352: Cross-Site Request Forgery because browser ambient authority can be used without a valid anti-CSRF control.
Potential impact
- An attacker could modify profile data, prompts, transcription settings, or preferences
- An attacker could change administrative status where the affected route is reachable
- An attacker could set a local password on an SSO-only account when the current-password check is skipped
- An attacker could weaken account authentication and potentially bypass intended SSO controls
- A compromised worker process could expose the CSRF bypass to subsequent requests handled by that worker
General mitigation guidance
Mitigation generally focuses on validating authentication independently of token presence and keeping CSRF policy deterministic for every request.
Common defensive patterns include:
- Hashing and verifying tokens against an authoritative store before treating them as authenticated
- Rejecting malformed, expired, unknown, or otherwise unauthorized tokens
- Avoiding request-time mutation of process-global CSRF exemption state
- Applying CSRF checks consistently to state-changing methods and requiring explicit, validated exemptions only where justified
- Requiring current credentials or an equivalent verified recovery flow before setting a password or changing authentication mode
- Using secure cookie attributes and avoiding sibling-domain cookie scope when it is not required
- Enforcing least privilege for administrative operations and separating SSO-only account behavior from local-password workflows
How teams detect issues like this
Detection approaches can include:
- Static analysis for authentication decisions based only on token presence
- Code review checks for query-string credentials, missing token hashing or database validation, and password changes without current-credential verification
- Searches for CSRF exemption APIs called inside request hooks or other paths that mutate process-global state
- Tests that make cross-origin requests across HTTP methods and verify that exemptions do not persist between requests
- Policy enforcement requiring CSRF protection for state-changing routes and validated authentication for every privileged action
- Automated security review tools configured to flag CWE-287 and CWE-352 patterns

