CVE-2026-138408: High severity Forgejo Forgejo vulnerability

Published Nov 29, 2026
·
Updated

In Forgejo before 15.0.12 and 16.x and 17.x before 17.0.2, emailverified 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] REGISTEREMAILCONFIRM 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 emailverified claim from user.IsActive rather than the primary email address's activation state, an attacker can obtain signed ID tokens asserting emailverified: true for an arbitrary unverified email address, and potentially take over accounts on external relying parties that match users by verified email.

Affected Software

1 affected component
Forgejo Forgejo<15.0.12, >=16.0<17.0, >=17.0<17.0.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 15.0.12
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 17.0.2

Event History

Nov 29, 2026
CVE Published
via MITRE·05:55 PM
Data Sourced
via MITRE·05:55 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed?

Affected deployments are Forgejo versions before 15.0.12, and 16.x and 17.x versions before 17.0.2, where REGISTER_EMAIL_CONFIRM is enabled. The account-takeover risk applies when Forgejo is used as an OIDC provider by external services that identify users using a verified email address.

2

What access does an attacker need?

An attacker needs an authenticated Forgejo account. They can set an unverified secondary email address as their primary address through the backend email settings handler.

3

Why does hiding the “Make primary” control not prevent exploitation?

The web interface hides the control for unverified addresses, but the backend POST /user/settings/account/email handler and MakeEmailAddressPrimary did not verify that the address was activated. An authenticated user could therefore bypass the UI restriction by invoking the backend path.

4

Which external services are most at risk?

The relevant relying parties are those that accept Forgejo-issued OIDC ID tokens and match or provision accounts based on a verified email address. Forgejo could issue a signed token asserting email_verified: true for an unverified primary email address because the claim was based on user.IsActive rather than the address activation state.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203