Ory Kratos is an identity, user management and authentication system for cloud services. Prior to version 26.2.0, the ListCourierMessages Admin API in Ory Kratos 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, Kratos falls back to a 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. As a first line of defense, immediately configure a custom value for `secrets.pagination` by generating a cryptographically secure random secret. Next, upgrade Kratos** to a fixed version, 26.2.0 or later, as soon as possible.
Ory Kratos has a SQL injection via forged pagination tokens
Problem type
Affected products
ory
< 26.2.0 - AFFECTED
References
GitHub Security Advisories
GHSA-hgx2-28f8-6g2r
Ory Kratos has a SQL injection via forged pagination tokens
https://github.com/advisories/GHSA-hgx2-28f8-6g2rDescription
The ListCourierMessages Admin API in Ory Kratos 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, Kratos falls back to a 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.
Preconditions
This issue can be exploited when the following conditions are met:
- ListCourierMessages API is directly or indirectly accessible to the attacker
- The attacker can pass a raw pagination token to the affected API
- The configuration value
secrets.paginationis not set or known to the attacker
Impact
An attacker can execute arbitrary SQL queries through forged pagination tokens.
Mitigation
As a first line of defense, immediately configure a custom value for secrets.pagination by generating a cryptographically secure random secret, for example:
openssl rand -base64 32
Next, upgrade Kratos to a fixed version as soon as possible.
JSON source
https://cveawg.mitre.org/api/cve/CVE-2026-33503Click to expand
{
"dataType": "CVE_RECORD",
"dataVersion": "5.2",
"cveMetadata": {
"cveId": "CVE-2026-33503",
"assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"assignerShortName": "GitHub_M",
"dateUpdated": "2026-03-26T18:23:32.163Z",
"dateReserved": "2026-03-20T16:59:08.888Z",
"datePublished": "2026-03-26T17:32:16.304Z",
"state": "PUBLISHED"
},
"containers": {
"cna": {
"providerMetadata": {
"orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"shortName": "GitHub_M",
"dateUpdated": "2026-03-26T17:32:16.304Z"
},
"title": "Ory Kratos has a SQL injection via forged pagination tokens",
"descriptions": [
{
"lang": "en",
"value": "Ory Kratos is an identity, user management and authentication system for cloud services. Prior to version 26.2.0, the ListCourierMessages Admin API in Ory Kratos 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, Kratos falls back to a 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. As a first line of defense, immediately configure a custom value for `secrets.pagination` by generating a cryptographically secure random secret. Next, upgrade Kratos** to a fixed version, 26.2.0 or later, as soon as possible."
}
],
"affected": [
{
"vendor": "ory",
"product": "kratos",
"versions": [
{
"version": "< 26.2.0",
"status": "affected"
}
]
}
],
"problemTypes": [
{
"descriptions": [
{
"lang": "en",
"description": "CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')",
"cweId": "CWE-89",
"type": "CWE"
}
]
}
],
"references": [
{
"url": "https://github.com/ory/kratos/security/advisories/GHSA-hgx2-28f8-6g2r",
"name": "https://github.com/ory/kratos/security/advisories/GHSA-hgx2-28f8-6g2r",
"tags": [
"x_refsource_CONFIRM"
]
}
],
"metrics": [
{
"cvssV3_1": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"attackVector": "NETWORK",
"attackComplexity": "LOW",
"privilegesRequired": "HIGH",
"userInteraction": "NONE",
"scope": "UNCHANGED",
"confidentialityImpact": "HIGH",
"integrityImpact": "HIGH",
"availabilityImpact": "HIGH",
"baseScore": 7.2,
"baseSeverity": "HIGH"
}
}
]
},
"adp": [
{
"providerMetadata": {
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP",
"dateUpdated": "2026-03-26T18:23:32.163Z"
},
"title": "CISA ADP Vulnrichment",
"metrics": [
{}
]
}
]
}
}