Forgejo's OIDC email_verified claim trusted the wrong state
CVE-2026-138408 is an identity-provider flaw with effects that leave the Forgejo server. Forgejo before 15.0.12 and 16.x and 17.x before 17.0.2 allowed an authenticated user to make an unverified secondary email address primary when registration confirmation was enabled. The web interface hid the action, but the backend email handler and the service that makes an address primary did not verify that the address had been activated.
The more serious consequence appears in OIDC. Forgejo's provider derived the email_verified claim from whether the user account was active, not from whether the primary email address had been verified. An attacker could therefore obtain a signed ID token that claimed email_verified: true for an address they did not control. A relying party that merges or links accounts by verified email could grant the attacker access to another person's account. The CVE record rates the issue 7.7 High with changed scope and high integrity impact.
The vulnerability is a trust-chain mismatch. Forgejo was authoritative for both OIDC authentication and email verification. It allowed an action that changed the email identity but continued to answer the verification question from a broader account flag. Relying parties cannot easily distinguish that inconsistent state from a legitimate assertion.
Administrators should update to 15.0.12 or 17.0.2. Afterward, audit users whose primary email changed while the corresponding address was unverified. Check OIDC client logs for sign-ins or account links tied to recent email changes, especially at services that use verified email as a merge key. Review Forgejo audit events for backend email changes that bypassed the hidden web control.
Relying parties should not assume every identity provider computes email verification the same way. Record which issuer and claim are trusted, how email matches are handled, and whether account linking requires another factor. For high-value services, prefer an explicit administrator-reviewed link or a subject identifier that remains stable across email changes. This incident is provider-specific, but the recommendation addresses the general failure mode.
If administrators cannot patch immediately, disable primary-email changes for accounts with unverified secondary addresses and review OIDC applications that link by email. Tightening the web UI alone is insufficient because the advisory describes a backend path. Rotate sessions for any account with confirmed suspicious identity changes and notify relying parties that may have issued access based on the forged claim.
Recovery is not complete when the Forgejo package version changes. The organization also needs to reconcile federated identities and external account links that were created during the vulnerable window.

