{"vuln_id":"CVE-2026-47158","aliases":["GHSA-pfp2-jhgq-6hg5"],"description":"CSRF in SSO Authorization Flow","published_at":"2026-05-19T21:27:43Z","modified_at":"2026-05-19T21:27:43Z","first_seen_at":"2026-11-22T13:40:16.280974Z","severity":"high","severity_source":"ghsa","cvss_score":8.3,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:H","cwe":["CWE-352"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00252,"epss_percentile":0.16874,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-47158"},"matched_alias":null,"items":[{"id":12052,"source":{"id":"gh-vaultwarden","name":"Vaultwarden releases + advisories (GitHub dani-garcia/vaultwarden)"},"title":"GHSA-pfp2-jhgq-6hg5 / CVE-2026-47158: CSRF in SSO Authorization Flow","summary":"CSRF in SSO Authorization Flow\n\n## Summary\r\n\r\nA cross-site request forgery / session fixation vulnerability in Vaultwarden's SSO authorization flow allowed an unauthenticated attacker to hijack any SSO user's login and obtain a fully authenticated session, leading to account takeover.\r\n\r\nThe OAuth `state` parameter accepted by the authorize endpoint was not bound to the initiating browser session. Combined with a PKCE flow under attacker-controlled parameters and a cleanup gap on failed token exchange, an attacker could pre-create an authorization context, induce a victim to complete IdP authentication against it, and then redeem the resulting tokens themselves.\r\n\r\n## Affected versions\r\n\r\nAll Vaultwarden versions with SSO support up to and including 1.35.8. Versions 1.36.0 and up are not vulnerable.\r\n\r\n## Root cause\r\n\r\nThree design decisions combined to produce the vulnerability:\r\n\r\n1. **No session binding at `/connect/authorize`.** The endpoint accepted arbitrary client-supplied `state` and `code_challenge` values without authentication, cookies, or any other browser-session anchor.\r\n2. **`SsoAuth` keyed by the client-supplied `state`.** The server-side record holding the OIDC flow context was primary-keyed on a value the caller controls, allowing an attacker to fixate a row and have a subsequent IdP callback bearing that `state` populate it.\r\n3. **No cleanup of `SsoAuth` on failed token exchange.** When `exchange_code` propagated an IdP error (e.g. from a mismatched PKCE verifier), the row was left intact, preserving the victim's authorization code for later redemption.\r\n\r\n## Attack chain\r\n\r\n1. The attacker generates a PKCE `code_challenge`/`code_verifier` pair and a `state` value, then calls `/connect/authorize` with these. An `SsoAuth` row is stored keyed by the attacker's `state`, and the IdP authorization URL is returned.\r\n2. The attacker sends the IdP URL to the victim. The victim authenticates with the IdP — if an IdP session is already active, no interaction beyond the click is required.\r\n3. The IdP redirects the victim's browser to `/connect/oidc-signin` with their real authorization code. The server stores this code in the attacker-fixated `SsoAuth` row without verifying that the callback originated from the same browser that initiated the flow.\r\n4. The victim's browser is redirected to `sso-connector.html`, where the Bitwarden client automatically attempts token exchange. Because the client does not hold the attacker's verifier, the exchange fails at the IdP. The `SsoAuth` row is not deleted.\r\n5. The attacker calls `/connect/token` with the fixated `state` (which doubles as `code` in this implementation) and their own `code_verifier`. The exchange succeeds, the IdP returns the victim's identity, and access and refresh tokens for the victim's account are issued to the attacker.\r\n\r\n## Impact\r\n\r\n- Full account takeover of any SSO user without two-factor authentication.\r\n- Access to the victim's encrypted vault material (`PrivateKey`, `Key`, ciphers), enabling offline b\n\nAffected packages: :vaultwarden\nPatched: vaultwarden 1.36.0","url":"https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-pfp2-jhgq-6hg5","published_at":"2026-05-19T21:27:43Z","updated_at":"2026-05-19T21:27:43Z","fetched_at":"2026-11-22T13:40:16.224728Z","severity":"high","cvss_score":8.3,"epss":0.00252,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"dani-garcia","product":"vaultwarden","vuln_id":"CVE-2026-47158","vuln_ids":["CVE-2026-47158","GHSA-PFP2-JHGQ-6HG5"],"tags":["repo-advisory","","CWE-352","security","repo:dani-garcia/vaultwarden"],"cluster_id":11366,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12052","html":"https://vulnwatch.ve1ve2.com/item/12052"}},{"id":12711,"source":{"id":"gh-vaultwarden","name":"Vaultwarden releases + advisories (GitHub dani-garcia/vaultwarden)"},"title":"[SECURITY RELEASE] dani-garcia/vaultwarden 1.36.0","summary":"Fixes advisories: GHSA-pfp2-jhgq-6hg5, GHSA-hxqh-ff5p-wfr3, GHSA-6x5c-84vm-5j56, GHSA-72vh-x5jq-m82g\n\nSecurity keywords: security, csrf, GHSA-PFP2-JHGQ-6HG5, GHSA-W6H6-8R66-HCV7, GHSA-HXQH-FF5P-WFR3, GHSA-J4J8-GPVJ-7FQR, GHSA-6X5C-84VM-5J56, ssrf, GHSA-72VH-X5JQ-M82G\n\n## Security Fixes\r\nThis release contains security fixes for the following advisories. We strongly advice to update as soon as possible.\r\n- SSO Login CSRF\r\n  [GHSA-pfp2-jhgq-6hg5](https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-pfp2-jhgq-6hg5)\r\n  [GHSA-w6h6-8r66-hcv7](https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-w6h6-8r66-hcv7)\r\n- User/Organization Enumeration\r\n  [GHSA-hxqh-ff5p-wfr3](https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-hxqh-ff5p-wfr3)\r\n- SSO existing-user binding\r\n  [GHSA-j4j8-gpvj-7fqr](https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-j4j8-gpvj-7fqr)\r\n  [GHSA-6x5c-84vm-5j56](https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-6x5c-84vm-5j56)\r\n- SSRF via Icon Endpoint\r\n  [GHSA-72vh-x5jq-m82g](https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-72vh-x5jq-m82g)\r\n- Some crate's updated and other minor security enhancements\r\n\r\nThese are private for now, pending CVE assignment.\r\n\r\n\r\n## Notes\r\n- Archiving of items is available\r\n  https://bitwarden.com/blog/keep-your-vault-tidy-with-item-archiving/\r\n  https://bitwarden.com/nl-nl/help/managing-items/#archive\r\n- Web Vault updated to v2026.4.1\r\n\r\n\r\n## What's Changed\r\n* SSO fallback to UserInfo preferred_username by @Timshel in https://github.com/dani-garcia/vaultwarden/pull/7128\r\n* Dummy identifier need to pass for a guid by @Timshel in https://github.com/dani-garcia/vaultwarden/pull/7154\r\n* add new /identity/accounts/prelogin/password by @stefan0xC in https://github.com/dani-garcia/vaultwarden/pull/7156\r\n* Add DuckDuckGo browser device type by @dfunkt in https://github.com/dani-garcia/vaultwarden/pull/7147\r\n* Apply `duration_suboptimal_units` lint findings by @dfunkt in https://github.com/dani-garcia/vaultwarden/pull/7144\r\n* Apply `ref_option` lint findings by @dfunkt in https://github.com/dani-garcia/vaultwarden/pull/7143\r\n* Fix hardcoded sso identifier by @Timshel in https://github.com/dani-garcia/vaultwarden/pull/7157\r\n* Update crates and fix a nightly lint by @BlackDex in https://github.com/dani-garcia/vaultwarden/pull/7161\r\n* Fix Host/IP resolving by @BlackDex in https://github.com/dani-garcia/vaultwarden/pull/7162\r\n* Several SSO Fixes by @BlackDex in https://github.com/dani-garcia/vaultwarden/pull/7163\r\n* Add support for archiving items by @matt-aaron in https://github.com/dani-garcia/vaultwarden/pull/6916\r\n* Fix favicon fetching to check all icon links instead of just the first one by @Shocker in https://github.com/dani-garcia/vaultwarden/pull/6880\r\n* Fix merge conflict by @dani-garcia in https://github.com/dani-garcia/vaultwarden/pull/7164\r\n* Replace organization_uuid unwrap with proper error handling by @xjohnyknox in https://github.com/dani-garcia/vaultwarden/pull/6936\r\n* fix: return Err instead of panic on unknown cipher atype in to_json() by @mango766 in https://github.com/dani-garcia/vaultwarden/pull/7068\r\n* Allow SQLite to be linked against dynamically by @ISSOtm in https://github.com/dani-garcia/vaultwarden/pull/7057\r\n* Update crates and web-vault by @BlackDex in https://github.com/dani-garcia/vaultwarden/pull/7171\r\n* Update hickory by @BlackDex in https://github.com/dani-garcia/vaultwarden/pull/7175\r\n\r\n## New Contributors\r\n* @matt-aaron made their first contribution in https://github.com/dani-garcia/vaultwarden/pull/6916\r\n* @Shocker made their first contribution in https://github.com/dani-garcia/vaultwarden/pull/6880\r\n* @xjohnyknox made their first contribution in https://github.com/dani-garcia/vaultwarden/pull/6936\r\n* @mango766 made their first contribution in https://github.com/dani-garcia/vaultwarden/pull/7068\r\n* @ISSOtm made their first contribution in https://github.com/dani-garcia/vaultwarden/pull/7057\r\n\r\n\r\n**Full Changelog**: https://github.com/dani-garcia/vaultwarden/compare/1.35.8...1.36.0\r\n\r\nYou can discuss this release here https://github.com/dani-garcia/vaultwarden/discussions/7177","url":"https://github.com/dani-garcia/vaultwarden/releases/tag/1.36.0","published_at":"2026-05-03T12:54:52Z","updated_at":null,"fetched_at":"2026-11-22T14:05:38.135282Z","severity":"high","cvss_score":8.3,"epss":0.00468,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"dani-garcia","product":"vaultwarden","vuln_id":"CVE-2026-47158","vuln_ids":["CVE-2026-47158","CVE-2026-47159","CVE-2026-47160","CVE-2026-47164","GHSA-6X5C-84VM-5J56","GHSA-72VH-X5JQ-M82G","GHSA-HXQH-FF5P-WFR3","GHSA-J4J8-GPVJ-7FQR","GHSA-PFP2-JHGQ-6HG5","GHSA-W6H6-8R66-HCV7"],"tags":["release","repo:dani-garcia/vaultwarden","security","stack","vaultwarden"],"cluster_id":11366,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12711","html":"https://vulnwatch.ve1ve2.com/item/12711"}}]}