Skip to main content
EPSS 0.3%top 80%

Kimi cli: Authlib has 1-click Account Takeover vulnerability (CVE-2025-68158)

0
Medium
Published: 08/13/2026 (08/13/2026, 17:01:40 UTC)
Source: GCVE Database
Product: kimi-cli

Description

# Security Advisory: Cache-Backed State Storage CSRF in Authlib The Security Labs team at Snyk has reported a security issue affecting Authlib, identified during a recent research project. The Snyk Security Labs team has identified a vulnerability that can result in a one-click account takeover in applications that utilize the Authlib library. ## Description Cache-backed state/request-token storage is not tied to the initiating user session, making CSRF possible for any attacker that possesses a valid state value (easily obtainable via an attacker-initiated authentication flow). When a cache is supplied to the OAuth client registry, `FrameworkIntegration.set_state_data` writes the entire state blob under `_state_{app}_{state}`, and `get_state_data` disregards the caller's session entirely. [1][2] ```py def _get_cache_data(self, key): value = self.cache.get(key) if not value: return None try: return json.loads(value) except (TypeError, ValueError): return None [snip] def get_state_data(self, session, state): key = f"_state_{self.name}_{state}" if self.cache: value = self._get_cache_data(key) else: value = session.get(key) if value: return value.get("data") return None ``` *authlib/integrations/base_client/framework_integration.py:12-41* Retrieval in `authorize_access_token` therefore succeeds for whichever browser presents that opaque value, and the token exchange proceeds with the attacker's authorization code. [3] ```py def authorize_access_token(self, **kwargs): """Fetch access token in one step. :return: A token dict. """ params = request.args.to_dict(flat=True) state = params.get("oauth_token") if not state: raise OAuthError(description='Missing "oauth_token" parameter') data = self.framework.get_state_data(session, state) if not data: raise OAuthError(description='Missing "request_token" in temporary data') params["request_token"] = data["request_token"] params.update(kwargs) self.framework.clear_state_data(session, state) token = self.fetch_access_token(**params) self.token = token return token ``` *authlib/integrations/flask_client/apps.py:57-76* This opens up an avenue for Login CSRF in applications that use cache-backed storage. Depending on the dependent application's implementation (e.g., whether it links accounts in the event of a login CSRF), this could lead to account takeover. ## Proof of Concept Consider a hypothetical application — AwesomeAuthlibApp. Assume that AwesomeAuthlibApp contains internal logic such that, when an already authenticated user performs a `callback` request, the application links the newly provided SSO identity to the existing user account associated with that request. Under these conditions, an attacker can achieve account takeover within the application by performing the following actions: 1. The attacker initiates an SSO OAuth flow but halts the process immediately before the callback request is made to AwesomeAuthlibApp. 2. The attacker then induces a logged-in user (via phishing, a drive-by attack, or similar means) to perform a GET request containing the attacker's state value and authorization code to the AwesomeAuthlibApp callback endpoint. Because Authlib does not verify whether the state token is bound to the session performing the callback, the callback is processed, the authorization code is sent to the provider, and the account linking proceeds. Once the GET request is executed, the attacker's SSO account becomes permanently linked to the victim's AwesomeAuthlibApp account. ## Suggested Fix Per the OAuth RFC [4], the state parameter should be tied to the user's session to prevent exactly such scenarios. One straightforward method of mitigating this issue is to continue storing the state in the session even when caching is enabled. An alternative approach would be to hash the session ID (or another per-user secret derived from the session) into the cache key. This ensures the state remains stored in the cache while still being bound to the session of the user that initiated the OAuth flow. ## Resources - [1] [flask_client/apps.py#L35](https://github.com/authlib/authlib/blob/260d04edee23d8470057ea659c16fb8a2c7b0dc2/authlib/integrations/flask_client/apps.py#L35) - [2] [base_client/framework_integration.py#L33](https://github.com/authlib/authlib/blob/260d04edee23d8470057ea659c16fb8a2c7b0dc2/authlib/integrations/base_client/framework_integration.py#L33) - [3] [flask_client/apps.py#L57](https://github.com/authlib/authlib/blob/260d04edee23d8470057ea659c16fb8a2c7b0dc2/authlib/integrations/flask_client/apps.py#L57) - [4] [RFC 6749 §10.12](https://www.rfc-editor.org/rfc/rfc6749#section-10.12)

CVSS v3.1

Score 5.7medium

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N

Affected software

Homebrewmore threats →ghsa
kimi-cli
pkg:brew/kimi-cli
Affected versions
>=0.40 <0.63

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/13/2026, 20:25:29 UTC

Technical Analysis

CVE-2025-68158 is a security flaw in Authlib's cache-backed state and request-token storage, which is not securely linked to the user's session. This improper session management allows remote attackers to exploit Cross-Site Request Forgery (CSRF) by obtaining a valid state token, potentially leading to unauthorized actions performed with the victim's privileges. The vulnerability affects Red Hat Satellite 6.18 and other Red Hat products using Authlib, such as Red Hat Ansible Automation Platform, Hosted OpenShift Clusters, and Red Hat Quay. The flaw is rated moderate severity by Red Hat and is linked to CWE-352. No official patch or mitigation currently meets Red Hat's standards for deployment and stability. The satellite/foreman-mcp-server-rhel9 container image is available as a Technology Preview but does not include a fix for this issue.

Potential Impact

The vulnerability allows an attacker to perform CSRF attacks by tricking a user into making unintended requests that the server treats as legitimate. This can lead to unauthorized actions executed with the victim's privileges, potentially exposing or modifying sensitive data, or causing denial of service. The impact depends on the victim's privileges; if the victim is an administrator, the attacker could gain extensive control over the affected application. However, Red Hat rates the severity as moderate for its products. There are no known exploits in the wild at this time.

Mitigation Recommendations

Currently, no official fix or mitigation meeting Red Hat's criteria for ease of use, applicability, and stability is available for this vulnerability. Users should monitor Red Hat advisories for updates. Red Hat recommends consulting the Red Hat Satellite documentation for MCP integration and contacting Red Hat Product Security for further guidance. Customers with a Technical Account Manager (TAM) can review this CVE directly with their TAM. Until a fix is released, cautious use of affected components and minimizing exposure to untrusted web interactions is advised.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Csaf Category
csaf_security_advisory
Csaf Version
2.0
Publisher
Red Hat Product Security
Advisory Id
RHSA-2026:28405
Cve Count
1

Threat ID: 6a3c0d10eed863c81e23ca34

Added to database: 06/24/2026, 17:00:00 UTC

Last enriched: 08/13/2026, 20:25:29 UTC

Last updated: 09/22/2026, 14:11:08 UTC

Views: 138

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses