GHSA-5c3f-6486-3g7g: Gogs's password-reset tokens use account-activation lifetime, ignoring RESET_PASSWORD_CODE_LIVES
Summary
Password-reset tokens are generated using conf.Auth.ActivateCodeLives (the account-activation lifetime), not conf.Auth.ResetPasswordCodeLives. The token lifetime is baked into the token itself at generation time and is re-extracted from the token at verification time, making RESET_PASSWORD_CODE_LIVES irrelevant to actual enforcement. When an administrator configures a shorter reset window (e.g., 10 minutes) for compliance or security reasons, reset tokens remain exploitable for the full activation lifetime instead, while the reset email falsely advertises the shorter expiry.
Severity
Medium (CVSS 3.1: 6.8)
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
- Attack Vector: Network — the reset endpoint is reachable over HTTP/S.
- Attack Complexity: High — successful exploitation requires (1) the instance to be configured with RESET_PASSWORD_CODE_LIVES < ACTIVATE_CODE_LIVES, AND (2) the attacker to have intercepted the victim's reset token (e.g., from a compromised or shared email inbox).
- Privileges Required: None — no Gogs account is required.
- User Interaction: Required — the victim must have triggered a password-reset request.
- Scope: Unchanged — the impact is confined to the victim's Gogs account.
- Confidentiality Impact: High — successful exploitation leads to account takeover, exposing all private repositories and data.
- Integrity Impact: High — the attacker can change the victim's password and gain full write access.
- Availability Impact: None.
Affected component
- internal/userx/userx.go — GenerateActivateCode() (line 39)
- internal/email/email.go — SendResetPasswordMail() (line 132)
- internal/route/user/auth.go — verifyUserActiveCode() (lines 426–439) and ResetPasswdPost() (line 621)
CWE
- CWE-324: Use of a Key Past Its Expiration Date
- CWE-613: Insufficient Session Expiration
Description
The reset token lifetime is hardcoded to ActivateCodeLives at generation
GenerateActivateCode (called for both account activation and password reset)
Details
Original advisory: https://github.com/advisories/GHSA-5c3f-6486-3g7g
Exploitation outlook
EPSS (FIRST.org) estimates each CVE’s probability of exploitation in the next 30 days — here is the CSIRTS.com read on those numbers.
- Low exploitation riskCVE-2026-528090.15% 30-day exploitation probability — currently an unlikely target, but scores change as exploit code circulates. Riskier than 5% of all scored CVEs.
Referenced CVEs
| CVE | CSIRTS overview | External |
|---|---|---|
| CVE-2026-52809 | coverage & exploitation status | NVD · CVE.org |
More from GitHub Security Advisories
- mediumGHSA-xm43-3m56-w3wf: Ghost: Paid gift memberships obtainable at minimal cost via the donations feature2026-08-04
- mediumGHSA-chgm-3698-jm42: Ghost: Member existence leak via magic link sign-in response2026-08-04
- highGHSA-xpp7-93x6-v29m: XSS in Ghost's ActivityPub client2026-08-04
- mediumGHSA-7mpp-r37j-x5wh: Ghost: Session Fixation in Ghost Admin2026-08-04
- mediumGHSA-cjc9-q5gf-327p: Ghost: Theme Upload Path Traversal2026-08-04