CVE-2026-138408
In Forgejo before 15.0.12 and 16.x and 17.x before 17.0.2, email_verified can be spoofed, sometimes leading to account…
Mitigation
- Upgrade Forgejo to 17.0.2 or later.
Who should check
- Anyone running Forgejo >= 9.0.0, < 15.0.12; >= 16.0.0, < 17.0.2
Vulnerability facts
- Affected
- Forgejo >= 9.0.0, < 15.0.12; >= 16.0.0, < 17.0.2
- Fixed in
- Forgejo 15.0.12, Forgejo 17.0.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, login needed
- CVSS
- 7.7 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: Low
- User interaction: None
- Scope: Changed (impact reaches other components)
- Confidentiality impact: None
- Integrity impact: High
- Availability impact: None
- EPSS
- 0.59% chance of exploitation in 30 days (percentile 49, 2026-12-01)
- CWE
- CWE-602
- Modified
Description
In Forgejo before 15.0.12 and 16.x and 17.x before 17.0.2, email_verified can be spoofed, sometimes leading to account takeover in external services that rely on Forgejo for authentication. It allows an authenticated user to set an unverified secondary email address as their primary email address when [service] REGISTER_EMAIL_CONFIRM is enabled. Although the web UI hides the "Make primary" button for unverified addresses, the backend POST /user/settings/account/email handler (EmailPost in routers/web/user/setting/account.go) and MakeEmailAddressPrimary in services/user/email.go did not check whether the email address was activated. Because Forgejo's OpenID Connect (OIDC) provider derives the email_verified claim from user.IsActive rather than the primary email address's activation state, an attacker can obtain signed ID tokens asserting email_verified: true for an arbitrary unverified email address, and potentially take over accounts on external relying parties that match users by verified email.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Forgejo | >= 9.0.0, < 15.0.12; >= 16.0.0, < 17.0.2 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-138408. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-138408.md Affected: Forgejo >= 9.0.0, < 15.0.12; >= 16.0.0, < 17.0.2 Fixed in: Forgejo 15.0.12, Forgejo 17.0.2 Steps: 1. Search this machine and project for Forgejo: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
Technologies
References
Patches
- https://codeberg.org/forgejo/forgejo/pulls/15298
- https://codeberg.org/forgejo/forgejo/pulls/15299
- https://codeberg.org/forgejo/forgejo/commit/0c4609133e9ec7da5cb061668f533ba42894c824
- https://codeberg.org/forgejo/forgejo/commit/04834f11abbdc164075aaf2bafaab375c555e832
- https://codeberg.org/forgejo/forgejo/commit/b3460f95c5aade136198ed5ca63a625d2134549c
FAQ
Is CVE-2026-138408 being exploited?
There is no confirmed exploitation: CVE-2026-138408 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.59% chance of exploitation in the next 30 days (as of 2026-12-01).
How serious is CVE-2026-138408?
High: CVSS 7.7 (v3.1, scored by CNA). Remote, login needed.
Which versions are affected by CVE-2026-138408?
Forgejo >= 9.0.0, < 15.0.12; >= 16.0.0, < 17.0.2.
Is there a fix for CVE-2026-138408?
Yes. Fixed in Forgejo 15.0.12, Forgejo 17.0.2. Upgrade Forgejo to 17.0.2 or later.
How do I check if I'm affected by CVE-2026-138408?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.