Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-101023 Overview
Gitea's OAuth2 token endpoint contains a validation flaw in its handling of the refresh_token grant type. The endpoint verified the signature and grant of a submitted token but did not verify that the token was actually a refresh token. An unexpired access token issued for the same OAuth2 application and grant could be exchanged for a new access token and refresh token. A holder of such an access token could use this behavior to extend access beyond the original token's lifetime. The issue is addressed in Gitea release v28.1.0.
Critical Impact
An attacker holding a valid, unexpired OAuth2 access token can submit it to the token endpoint as a refresh_token grant and receive a fresh access token and refresh token, enabling indefinite session persistence.
Affected Products
- Gitea (self-hosted Git service) prior to v28.1.0
- Gitea OAuth2 token endpoint (/login/oauth/access_token)
- Any OAuth2 client application integrated with vulnerable Gitea instances
Discovery Timeline
- 2026-10-06 - CVE-2026-101023 published to NVD
- 2026-10-07 - Last updated in NVD database
- Gitea v28.1.0 - Fix released via Gitea Release v28.1.0 and GitHub Security Advisory GHSA-469m-x4mw-38r3
Technical Details for CVE-2026-101023
Vulnerability Analysis
The vulnerability is an authentication logic flaw in Gitea's OAuth2 token endpoint. When a client submits a token with the refresh_token grant type, the server validates the token signature and confirms that the token belongs to a known OAuth2 application and grant. The server does not verify the token type claim, meaning an access token is accepted in a position where only a refresh token should be valid. This classifies as a broken access control and improper input validation issue affecting OAuth2 token lifecycle enforcement.
Root Cause
The root cause lies in incomplete token type enforcement at the refresh_token grant handler. OAuth2 tokens in Gitea are JSON Web Tokens (JWTs) that carry a type claim distinguishing access tokens from refresh tokens. The handler decoded and signature-verified the submitted token but omitted the check comparing the token's type claim against the expected refresh token type. Both token classes share the same signing key and grant association, so validation succeeds on structurally valid access tokens.
Attack Vector
An attacker needs an unexpired OAuth2 access token for a target Gitea application. The attacker POSTs to the token endpoint with grant_type=refresh_token and the stolen access token placed in the refresh_token parameter. The server returns a new access token and a new refresh token. This chain can be repeated to maintain access long after the original token should have expired, bypassing session timeout controls. Refer to Gitea Pull Request #39501 and Pull Request #39507 for the corrective code changes.
No verified public exploit code is available. See the linked security advisory for additional technical context.
Detect Identity Attacks the Moment Authentication Fails
Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.
Stop Identity AttacksDetection Methods for CVE-2026-101023
Indicators of Compromise
- Repeated successful POST requests to /login/oauth/access_token with grant_type=refresh_token originating from the same client or IP, especially after an access token should have expired.
- OAuth2 session durations extending substantially beyond the configured access token lifetime for a given application.
- New refresh tokens issued for a user without a corresponding user-initiated authentication event in the Gitea audit log.
Detection Strategies
- Enable verbose OAuth2 logging on Gitea and alert on refresh_token grants where the submitted token's type claim does not match refresh_token.
- Correlate token issuance events against prior interactive logins to flag refresh chains that extend sessions beyond expected policy limits.
- Baseline normal token refresh cadence per application and alert on anomalous refresh frequency or geographic shifts.
Monitoring Recommendations
- Forward Gitea access and audit logs to a centralized SIEM for correlation across authentication, repository access, and admin events.
- Monitor outbound Git clone and API traffic from accounts associated with long-lived OAuth2 sessions for signs of code or secret exfiltration.
- Track OAuth2 application grants and revoke any grants no longer in active use to reduce the attackable surface.
How to Mitigate CVE-2026-101023
Immediate Actions Required
- Upgrade Gitea to v28.1.0 or later, which contains the fix enforcing token type validation on the refresh_token grant path.
- Revoke all existing OAuth2 access and refresh tokens after upgrade to invalidate any tokens that may have been laundered through the vulnerable flow.
- Audit OAuth2 application grants and remove third-party integrations that are no longer required.
Patch Information
The fix ships in Gitea v28.1.0. See the Gitea 28.1.0 release announcement and the Gitea Release v28.1.0 notes. Code changes are implemented in Pull Request #39501 and Pull Request #39507. Full advisory details are in GHSA-469m-x4mw-38r3.
Workarounds
- Restrict network access to the Gitea OAuth2 token endpoint to trusted client networks until the patch can be applied.
- Reduce the configured access token lifetime so that compromised tokens have a narrower window of exploitation.
- Rotate OAuth2 application client secrets and force re-authentication for all users as a compensating control.
# Configuration example: shorten OAuth2 token lifetimes in app.ini
[oauth2]
REFRESH_TOKEN_EXPIRATION_TIME = 24 ; hours (default 730)
[oauth2_client]
ACCESS_TOKEN_EXPIRATION_TIME = 300 ; seconds
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

