{"id":"GHSA-6hq4-74jm-4hj4","aliases":["DHI-d52a-imhe-2rjy-dwbu"],"status":"published","description":"### Summary\n\nZITADEL’s **User Service v2 API** allowed a user to retrieve a password-reset code for their own account in plaintext without holding the `user.write` permission. Because an access token issued to any application through a normal OIDC sign-in can carry the ZITADEL API audience, an application operator who obtains such a token — after a victim signs in to their application — could read the victim’s reset code directly from the API response and use it to set a new password for the victim’s account.\n\nThe flaw was in the password-reset endpoint’s authorization check: the “return the code in the response” mode was treated as self-service and skipped the `user.write` requirement, unlike the equivalent email- and phone-code endpoints, which already restrict in-band code return to privileged callers.\n\n### Impact\n\nAn attacker who operates an application registered in the same ZITADEL instance as the victim, and who obtains a victim access token bearing the ZITADEL API audience (`urn:zitadel:iam:org:project:id:zitadel:aud`) through a normal sign-in, can:\n\n- **Retrieve the victim’s password-reset code** in plaintext from `POST /v2/users/{userId}/password_reset` when calling it with `{\"returnCode\":{}}`, without `user.write`.\n- **Set a new password for the victim** via `POST /v2/users/{userId}/password` using that code, with no knowledge of the current password and no access to the victim’s email.\n- **Establish persistent account access** — the replacement password remains valid after the short-lived access token expires, including on accounts that previously had no local password.\n\nThis affects applications that authenticate users through ZITADEL where the issued access token carries the ZITADEL API audience.\n\nThe issue does **not** grant any capability against other users: requests for a different user’s reset code, requests without the ZITADEL API audience, and unauthenticated requests are all rejected. It is strictly a self-scoped escalation — an operator who already receives a victim’s token turns it into a durable credential. Note that a token bearing the ZITADEL API audience can already register a passkey on the same account through self-service, which provides comparable persistence; this advisory concerns an additional, lower-friction path to it rather than an entirely new foothold.\n\n**Scope note:** The flaw is in the **User Service v2 API** password-reset endpoint and applies instance-wide, including across organizations within the same instance (the victim and the attacker’s application may belong to different organizations). It does not cross instance boundaries. No sibling advisory is associated.\n\n### Affected Versions\n\nSystems running one of the following versions are affected:\n\n* **4.x:** `4.0.0` through `4.20.7`\n\n### Patches\n\nThe vulnerability has been addressed in the latest releases.\n\nReturning a password-reset code in the API response now requires the `user.write` permission, also when users request the code for their own account; self-service resets that deliver the code by email are unchanged.\n\n* **4.x**: Upgrade to $\\ge$ [4.20.8](https://github.com/zitadel/zitadel/releases/tag/v4.20.8)\n\n### Workarounds\n\nThe recommended solution is to upgrade to a patched version.\n\nThere is no configuration that fully closes this gap on unpatched versions.\n\n### Questions\n\nIf you have any questions or comments about this advisory, please email us at security@zitadel.com\n\n### Credits\n\nThanks to Lucas Dodgson from InfoGuard Labs ([@lucasdodgson](https://github.com/lucasdodgson)) for finding and reporting the vulnerability.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"published":"2026-12-02T14:27:24Z","modified":"2026-12-02T14:30:20Z","affected":[{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"zitadel-4-dev","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-r0"}]}],"versions":["4.20.3-r0","4.20.4-r0","4.20.5-r0","4.20.6-r0","4.20.7-r0","4.20.8-r0","4.21.0-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.24","package":"zitadel-4-dev","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-r0"}]}],"versions":["4.20.3-r0","4.20.4-r0","4.20.5-r0","4.20.6-r0","4.20.7-r0","4.20.8-r0","4.21.0-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"zitadel-4-fips-dev","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-r0"}]}],"versions":["4.20.3-r0","4.20.4-r0","4.20.5-r0","4.20.6-r0","4.20.7-r0","4.20.8-r0","4.21.0-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.24","package":"zitadel-4-fips-dev","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-r0"}]}],"versions":["4.20.3-r0","4.20.4-r0","4.20.5-r0","4.20.6-r0","4.20.7-r0","4.20.8-r0","4.21.0-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"zitadel-4-fips-license","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-r0"}]}],"versions":["4.20.3-r0","4.20.4-r0","4.20.5-r0","4.20.6-r0","4.20.7-r0","4.20.8-r0","4.21.0-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.24","package":"zitadel-4-fips-license","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-r0"}]}],"versions":["4.20.3-r0","4.20.4-r0","4.20.5-r0","4.20.6-r0","4.20.7-r0","4.20.8-r0","4.21.0-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"zitadel-4-fips","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-r0"}]}],"versions":["4.20.3-r0","4.20.4-r0","4.20.5-r0","4.20.6-r0","4.20.7-r0","4.20.8-r0","4.21.0-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.24","package":"zitadel-4-fips","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-r0"}]}],"versions":["4.20.3-r0","4.20.4-r0","4.20.5-r0","4.20.6-r0","4.20.7-r0","4.20.8-r0","4.21.0-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"zitadel-4-license","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-r0"}]}],"versions":["4.20.3-r0","4.20.4-r0","4.20.5-r0","4.20.6-r0","4.20.7-r0","4.20.8-r0","4.21.0-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.24","package":"zitadel-4-license","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-r0"}]}],"versions":["4.20.3-r0","4.20.4-r0","4.20.5-r0","4.20.6-r0","4.20.7-r0","4.20.8-r0","4.21.0-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.23","package":"zitadel-4","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-r0"}]}],"versions":["4.20.3-r0","4.20.4-r0","4.20.5-r0","4.20.6-r0","4.20.7-r0","4.20.8-r0","4.21.0-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Alpine:3.24","package":"zitadel-4","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-r0"}]}],"versions":["4.20.3-r0","4.20.4-r0","4.20.5-r0","4.20.6-r0","4.20.7-r0","4.20.8-r0","4.21.0-r0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"zitadel-4-dev","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-0"}]}],"versions":["4.20.3-0","4.20.4-0","4.20.5-0","4.20.6-0","4.20.7-0","4.20.8-0","4.21.0-0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"zitadel-4-fips-dev","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-0"}]}],"versions":["4.20.3-0","4.20.4-0","4.20.5-0","4.20.6-0","4.20.7-0","4.20.8-0","4.21.0-0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"zitadel-4-fips-license","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-0"}]}],"versions":["4.20.3-0","4.20.4-0","4.20.5-0","4.20.6-0","4.20.7-0","4.20.8-0","4.21.0-0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"zitadel-4-fips","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-0"}]}],"versions":["4.20.3-0","4.20.4-0","4.20.5-0","4.20.6-0","4.20.7-0","4.20.8-0","4.21.0-0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"zitadel-4-license","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-0"}]}],"versions":["4.20.3-0","4.20.4-0","4.20.5-0","4.20.6-0","4.20.7-0","4.20.8-0","4.21.0-0"]},{"source":"osv","ecosystem":"Docker Hardened Images:Debian:13","package":"zitadel-4","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.20.3-0"}]}],"versions":["4.20.3-0","4.20.4-0","4.20.5-0","4.20.6-0","4.20.7-0","4.20.8-0","4.21.0-0"]}],"references":[{"url":"https://scout.docker.com/v/DHI-d52a-imhe-2rjy-dwbu","tags":["advisory"]},{"url":"https://github.com/zitadel/zitadel/security/advisories/GHSA-6hq4-74jm-4hj4","tags":["advisory"]}],"sources":{"osv":[{"id":"DHI-d52a-imhe-2rjy-dwbu","upstream":["GHSA-6hq4-74jm-4hj4"],"title":"### Summary","description":"### Summary\n\nZITADEL’s **User Service v2 API** allowed a user to retrieve a password-reset code for their own account in plaintext without holding the `user.write` permission. Because an access token issued to any application through a normal OIDC sign-in can carry the ZITADEL API audience, an application operator who obtains such a token — after a victim signs in to their application — could read the victim’s reset code directly from the API response and use it to set a new password for the victim’s account.\n\nThe flaw was in the password-reset endpoint’s authorization check: the “return the code in the response” mode was treated as self-service and skipped the `user.write` requirement, unlike the equivalent email- and phone-code endpoints, which already restrict in-band code return to privileged callers.\n\n### Impact\n\nAn attacker who operates an application registered in the same ZITADEL instance as the victim, and who obtains a victim access token bearing the ZITADEL API audience (`urn:zitadel:iam:org:project:id:zitadel:aud`) through a normal sign-in, can:\n\n- **Retrieve the victim’s password-reset code** in plaintext from `POST /v2/users/{userId}/password_reset` when calling it with `{\"returnCode\":{}}`, without `user.write`.\n- **Set a new password for the victim** via `POST /v2/users/{userId}/password` using that code, with no knowledge of the current password and no access to the victim’s email.\n- **Establish persistent account access** — the replacement password remains valid after the short-lived access token expires, including on accounts that previously had no local password.\n\nThis affects applications that authenticate users through ZITADEL where the issued access token carries the ZITADEL API audience.\n\nThe issue does **not** grant any capability against other users: requests for a different user’s reset code, requests without the ZITADEL API audience, and unauthenticated requests are all rejected. It is strictly a self-scoped escalation — an operator who already receives a victim’s token turns it into a durable credential. Note that a token bearing the ZITADEL API audience can already register a passkey on the same account through self-service, which provides comparable persistence; this advisory concerns an additional, lower-friction path to it rather than an entirely new foothold.\n\n**Scope note:** The flaw is in the **User Service v2 API** password-reset endpoint and applies instance-wide, including across organizations within the same instance (the victim and the attacker’s application may belong to different organizations). It does not cross instance boundaries. No sibling advisory is associated.\n\n### Affected Versions\n\nSystems running one of the following versions are affected:\n\n* **4.x:** `4.0.0` through `4.20.7`\n\n### Patches\n\nThe vulnerability has been addressed in the latest releases.\n\nReturning a password-reset code in the API response now requires the `user.write` permission, also when users request the code for their own account; self-service resets that deliver the code by email are unchanged.\n\n* **4.x**: Upgrade to $\\ge$ [4.20.8](https://github.com/zitadel/zitadel/releases/tag/v4.20.8)\n\n### Workarounds\n\nThe recommended solution is to upgrade to a patched version.\n\nThere is no configuration that fully closes this gap on unpatched versions.\n\n### Questions\n\nIf you have any questions or comments about this advisory, please email us at security@zitadel.com\n\n### Credits\n\nThanks to Lucas Dodgson from InfoGuard Labs ([@lucasdodgson](https://github.com/lucasdodgson)) for finding and reporting the vulnerability.\n","status":"published","published":"2026-12-02T14:27:24Z","modified":"2026-12-02T14:30:20.72683049Z","updated_at":"2026-12-02T14:44:02.567125Z"}]}}
