GHSA-VXJW-GV4F-VQ58

Vulnerability from github – Published: 2026-12-03 17:24 – Updated: 2026-12-03 17:24
VLAI
Summary
Fider: Multi-tenant verification-key bypass enables cross-tenant account takeover
Details

Summary

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.

Affected Component

app/services/sqlstore/postgres/tenant.go:133 — getVerificationByKey

Vulnerability Details

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

Attack Scenario

Prerequisite: the attacker only needs an account on any tenant (zero special privilege).

  1. Attacker registers on tenanta.example.com with attacker@evil.com
  2. Attacker requests a sign-in email on tenanta.example.com and obtains the verification key from the email
  3. Attacker visits https://tenantb.example.com/signin/verify?k=<KEY>
  4. Fider looks up the key without tenant_id filtering, finds Tenant A's verification record
  5. Fider authenticates the attacker on Tenant B using the email from Tenant A's record

Consequence: - If attacker@evil.com already exists as an administrator on Tenant B → full administrative access is granted - If the account does not exist on Tenant B → a new account is silently created under the attacker's email

Proof of Concept

Verified 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.

Suggested Fix

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
    })
}

CVSS

Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N — 8.5 (High)

Resources

  • 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)

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/getfider/fider"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.36.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-65840"
  ],
  "database_specific": {
    "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"
  },
  "details": "## Summary\n\nIn 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.\n\n**Single-host deployments (`HOST_MODE=single`, the default) are NOT affected.**\n\n## Affected Component\n\n`app/services/sqlstore/postgres/tenant.go:133` \u2014 `getVerificationByKey`\n\n## Vulnerability Details\n\nThe `getVerificationByKey` function queries the `email_verifications` table without filtering by `tenant_id`:\n\n```sql\n-- Vulnerable query (line 133)\nSELECT id, email, name, key, created_at, verified_at, expires_at, kind, user_id, attempts\nFROM email_verifications\nWHERE key = $1 AND kind = $2\nLIMIT 1\n```\n\nThe table\u0027s unique index is `(tenant_id, key)` \u2014 the same key can theoretically exist across tenants. Without the `tenant_id` filter, the query returns the first matching row regardless of tenant.\n\nSibling queries in the same file correctly scope by `tenant_id`, making this a clear regression from the established secure pattern:\n\n```sql\n-- Secure pattern at line 148\nWHERE tenant_id = $1 AND email = $2 AND code = $3 AND kind = $4\n\n-- Secure pattern at line 182 (setKeyAsVerified)\nWHERE tenant_id = $2 AND key = $3 AND verified_at IS NULL\n```\n\n## Attack Scenario\n\n**Prerequisite:** the attacker only needs an account on any tenant (zero special privilege).\n\n1. Attacker registers on `tenanta.example.com` with `attacker@evil.com`\n2. Attacker requests a sign-in email on `tenanta.example.com` and obtains the verification key from the email\n3. Attacker visits `https://tenantb.example.com/signin/verify?k=\u003cKEY\u003e`\n4. Fider looks up the key without `tenant_id` filtering, finds Tenant A\u0027s verification record\n5. Fider authenticates the attacker on **Tenant B** using the email from Tenant A\u0027s record\n\n**Consequence:**\n- If `attacker@evil.com` already exists as an administrator on Tenant B \u2192 full administrative access is granted\n- If the account does not exist on Tenant B \u2192 a new account is silently created under the attacker\u0027s email\n\n## Proof of Concept\n\nVerified on a local Docker environment with `HOST_MODE=multi`, `getfider/fider:stable` (commit `d5a80ea5`).\n\n```bash\n# Step 1 \u2014 Request sign-in email on Tenant A\nPOST http://tenanta.fider.local/_api/signin\n{\"email\": \"admin-a@test.com\"}\n\n# Step 2 \u2014 Extract key from email link (retrieved via MailHog)\nk=Urpoz9ntWfOBgpF72UWklTJUOjyLUhdzOLEvP6G5KVUgyRnc5ioMpwF6NOs0XNrE\n\n# Step 3 \u2014 Use Tenant A\u0027s key on Tenant B\nGET http://tenantb.fider.local/signin/verify?k=Urpoz9ntWfOBgpF72UWklTJUOjyLUhdzOLEvP6G5KVUgyRnc5ioMpwF6NOs0XNrE\n\n# Result \u2014 Successfully authenticated on Tenant B as admin-a@test.com\n```\n\nThe browser session showed the user logged in on Tenant B with the identity belonging to Tenant A.\n\n## Suggested Fix\n\nAdd the `tenant_id` filter to the query in `app/services/sqlstore/postgres/tenant.go:133`:\n\n```go\nfunc getVerificationByKey(ctx context.Context, q *query.GetVerificationByKey) error {\n    return using(ctx, func(trx *dbx.Trx, tenant *entity.Tenant, user *entity.User) error {\n        verification := dbEntities.EmailVerification{}\n        query := `SELECT id, email, name, key, code, created_at, verified_at,\n                         expires_at, kind, user_id, attempts\n                  FROM email_verifications\n                  WHERE tenant_id = $3 AND key = $1 AND kind = $2\n                  LIMIT 1`\n        err := trx.Get(\u0026verification, query, q.Key, q.Kind, tenant.ID)\n        if err != nil {\n            return errors.Wrap(err, \"failed to get email verification by its key\")\n        }\n        q.Result = verification.ToModel()\n        return nil\n    })\n}\n```\n\n## CVSS\n\n**Vector:** `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N` \u2014 **8.5 (High)**\n\n## Resources\n\n- Vulnerable file: `app/services/sqlstore/postgres/tenant.go:133`\n- Secure sibling patterns: `app/services/sqlstore/postgres/tenant.go:148`, `:182`\n- Entry point: `app/handlers/signin.go:319` (`VerifySignInKey`)\n- Dispatch chain: `app/handlers/common.go:127` (`validateKey` \u2192 `GetVerificationByKey`)\n\n- **Patched in:** v0.36.0 (commit `ce4f44bb`)",
  "id": "GHSA-vxjw-gv4f-vq58",
  "modified": "2026-12-03T17:24:13Z",
  "published": "2026-12-03T17:24:13Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/getfider/fider/security/advisories/GHSA-vxjw-gv4f-vq58"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-65840"
    },
    {
      "type": "WEB",
      "url": "https://github.com/getfider/fider/commit/ce4f44bb1055d7f6e4a948613c1cfcd5d53126c8"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/getfider/fider"
    },
    {
      "type": "WEB",
      "url": "https://github.com/getfider/fider/releases/tag/v0.36.0"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Fider: Multi-tenant verification-key bypass enables cross-tenant account takeover"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.