Vaultwarden's SSO Had the Right Default and Never Read It
Vaultwarden shipped a setting to stop unverified SSO emails binding to existing accounts, documented the takeover risk in its config template, then wrote a code path that never read it. CVE-2026-47164 was found twice, five weeks apart. Here is the whole SSO config surface, checked against v1.37.5
Four weeks ago I ended the Vaultwarden piece by saying SSO deserved its own Saturday, because Vaultwarden's OIDC support had absorbed a disproportionate share of 2026's advisories and three paragraphs would've been dishonest about it. This is that Saturday.
Here is the line I want to start with. It's from Vaultwarden's own .env.template, verbatim, at tag 1.37.5:
## Allow unknown email verification status. Allowing this with `SSO_SIGNUPS_MATCH_EMAIL=true` open potential account takeover.
# SSO_ALLOW_UNKNOWN_EMAIL_VERIFICATION=false
Somebody understood this bug. They understood it well enough to write the words "potential account takeover" into the shipped config file, name the exact setting it interacts with, and pick the safe default. The control existed, the default was correct, and the documentation was accurate.
And then one of the two code paths that needed to check it didn't.
That is CVE-2026-47164, and it's the cleanest example I have of a failure mode that none of the usual advice catches — because every piece of advice you'd give was already followed.
The Bug
GHSA-6x5c-84vm-5j56, CVE-2026-47164, High, CVSS 7.7. Affects Vaultwarden 1.35.8 and earlier with SSO enabled. Fixed in 1.36.0. Published 19 May 2026.
The title the project gave it is precise enough to be the explanation: "SSO Email Auto-Link Can Bind an Existing Local Account to an Attacker-Controlled IdP Identity."
When somebody logs in through your identity provider, Vaultwarden has to decide which local account they are. There are two branches. Either no local account matches and it creates one, or a local account matches the email the IdP asserted and it links the two.
The new-user branch checked the IdP's email_verified claim. The existing-user branch didn't. It took the asserted email as sufficient on its own, because SSO_SIGNUPS_MATCH_EMAIL defaults to true and an email match is the whole criterion.
So: register an identity at the IdP claiming your victim's email address, verified or not. Sign in to Vaultwarden. The existing-user branch matches on email, never asks whether the IdP actually confirmed that address belongs to you, and binds your IdP identity to their account — persistently. The advisory's impact list runs to account takeover, access to encrypted vault material, device and emergency-access actions, and possible organisation-level privilege escalation.
The only thing standing in the way is Vaultwarden 2FA on the victim's account. If they have it, the flow stops at the second factor. If they don't, you have their vault session.
And SSO_ALLOW_UNKNOWN_EMAIL_VERIFICATION=false — the setting whose own comment warns about exactly this — didn't help, because the branch that mattered never read it.
What the Fix Looks Like
I pulled the repository at 1.37.5 and read it, because "they added the check" is the kind of sentence that deserves verification rather than repetition. From src/api/identity.rs, the existing-user branch now carries the same match as the new-user one:
Some((user, None)) => match user_infos.email_verified {
None if !CONFIG.sso_allow_unknown_email_verification() => {
error!(
"Login failure ({}), existing non SSO user ({}) with same email ({}) and email verification status is unknown",
user_infos.identifier, user.uuid, user.email
);
err_silent!(
"Email verification status is unknown",
ErrorEvent {
event: EventType::UserFailedLogIn
}
)
}
Some(false) => {
error!(
"Login failure ({}), existing non SSO user ({}) with same email ({}) and email is not verified",
user_infos.identifier, user.uuid, user.email
);
err_silent!(
"Email is not verified by the SSO provider",
ErrorEvent {
event: EventType::UserFailedLogIn
}
)
}
_ => Some((user, None)),
},
Three cases. Verification status unknown and the operator hasn't opted into allowing that: refuse. Provider says explicitly not verified: refuse. Anything else: proceed.
There's a detail in there I liked enough to point out. This branch uses err_silent!. The new-user branch, a few dozen lines further down, uses err! and returns this:
Your provider does not send email verification status.
You will need to change the server configuration (check `SSO_ALLOW_UNKNOWN_EMAIL_VERIFICATION`) to log in.
A new user gets told what's wrong and which setting fixes it. Someone probing an existing account gets a silent failure that reveals nothing about whether that account exists. Same condition, two different disclosure postures, chosen deliberately. Both paths also emit EventType::UserFailedLogIn, so if you turned on org event logging — which week one spent a section arguing you should, because it is off by default — the attempts land in your audit log either way.
If you're enjoying what you've read so far, we recommend The SSO Tax: Why Self-Hosted Projects Are Gating Login Behind a Paywall as your next read.
The Score Depends on Your IdP, Which CVSS Cannot Know
The published vector is CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L for 7.7. I ran it:
impact = 5.4505
exploitability = 2.2212
base = roundup(7.6716) = 7.7
Correct as published. But look at AC:H — Attack Complexity High. That's doing a lot of work, and what it encodes is the precondition the advisory spells out: the attacker needs an IdP that will let them register an identity asserting someone else's email address. The advisory calls that "realistic for self-service or weakly governed IdPs."
So what happens to the number if your IdP is one of those?
AC:H (as published) -> 7.7
AC:L (self-service IdP, attacker can just register) -> 9.4
A 1.7-point swing, and the thing that decides it is not a property of Vaultwarden at all. It's a property of how your identity provider handles email ownership. If you run Authentik or Keycloak with admin-only account creation and verified email enforcement, 7.7 is generous to the attacker. If you pointed SSO_AUTHORITY at a public provider with open self-service signup, the real number for your deployment is 9.4, and the vector is telling you something about somebody else's setup.
This is the structural limit of a single severity number for a feature whose security depends on a system the vendor does not control. Vaultwarden can refuse unverified emails. It can't verify that your IdP is telling the truth. The advisory says so plainly: the fix "depends on the IdP truthfully reporting email_verified." You have moved your authentication trust root outside the box, which is the entire point of SSO and also the entire risk of it.
Two People Found It, Five Weeks Apart
The advisory credits two reporters: ch1nhpd on 22 March 2026, and Atomics-hub on 29 April. Thirty-eight days apart. Published 19 May, fifty-eight days after the first report.
Independent duplicate discovery is a signal, and it's worth reading correctly. It doesn't mean the bug was being exploited. What it means is that the bug was findable — that two unconnected people looking at Vaultwarden's SSO flow both arrived at the same branch and noticed the same missing check within five weeks of each other.
A bug that one brilliant person finds after six months of fuzzing is a different risk from a bug that two people find by reading the code. This was the second kind. The asymmetry of code review is that defenders have to check every branch and an attacker only has to find the one nobody checked, and a missing conditional in an authentication flow is exactly the sort of thing that's obvious the moment you look in the right place.
If you ran SSO on 1.35.8 or earlier for any length of time, I wouldn't assume nothing happened. Check your logs for SSO bindings you cannot account for, and check whether any account has an SSO association it shouldn't.
The Whole SSO Config Surface, With the Traps Marked
Everything here is from .env.template at 1.37.5, verbatim, and the defaults are the real defaults.
# SSO_ENABLED=false
# SSO_ONLY=false
# SSO_SIGNUPS_ALLOWED=true
# SSO_SIGNUPS_MATCH_EMAIL=true
# SSO_ALLOW_UNKNOWN_EMAIL_VERIFICATION=false
# SSO_PKCE=true
# SSO_AUDIENCE_TRUSTED='^$'
# SSO_CLIENT_CACHE_EXPIRATION=0
# SSO_DEBUG_TOKENS=false
| Setting | Default | What to know |
|---|---|---|
SSO_ENABLED |
false |
Off unless you turned it on. None of this applies otherwise |
SSO_SIGNUPS_ALLOWED |
true |
A second registration door. SIGNUPS_ALLOWED=false doesn't close it |
SSO_SIGNUPS_MATCH_EMAIL |
true |
The precondition for CVE-2026-47164. Set false if your IdP can't strongly prove email ownership |
SSO_ALLOW_UNKNOWN_EMAIL_VERIFICATION |
false |
Correct. Leave it. Turning it on re-enables the bug class by consent |
SSO_PKCE |
true |
Correct, and a good sign about the implementation. Leave it |
SSO_AUDIENCE_TRUSTED |
'^$' |
Only your client_id is trusted. Widening this is widening who can mint tokens you accept |
SSO_DEBUG_TOKENS |
false |
Logs every token. Diagnostic only, never on a running instance |
SSO_ONLY |
false |
true stops master-password login entirely. Think about lockout first |
Three of those deserve more than a table row.
SSO_SIGNUPS_ALLOWED=true is the one I flagged in week one and it bears repeating here, because it's the single most likely thing to surprise you. You set SIGNUPS_ALLOWED=false, you believe registration is closed, and SSO signup is a separate flag that defaults to open. The template's own comment is "You probably want to disable it when using a public provider." The code also runs the domain whitelist against the SSO path — CONFIG.is_sso_signup_allowed(&user_infos.email) — so if you added SIGNUPS_DOMAINS_WHITELIST thinking it narrowed things, re-read week one's section on why that whitelist is an override rather than a filter.
SSO_DEBUG_TOKENS=false is a footgun with a short fuse. It requires LOG_LEVEL=debug to do anything, which makes it a two-step mistake rather than a one-step one, but the combination writes identity tokens into your log file. Logs get rotated into backups, shipped to aggregators, and pasted into forum threads when somebody asks for help. If you turn it on to debug a provider handshake, turn it off in the same session.
SSO_MASTER_PASSWORD_POLICY has a caveat in the template that's easy to skim past:
## Optional Master password policy (minComplexity=[0-4]), `enforceOnLogin` is not supported at the moment.
The example value in the template includes "enforceOnLogin":false, and the comment tells you that key is not supported regardless. So you can configure a master password policy and it won't be enforced at login. If your reason for enabling SSO was centralising password strength requirements, that specific mechanism isn't doing what the JSON suggests.
If you're enjoying what you've read so far, we recommend How Authentication Actually Works as your next read.
The Rest of the 2026 SSO Record
CVE-2026-47164 wasn't alone, and its sibling is worth reading because it is the same mistake in a different place.
CVE-2026-47159 (GHSA-hxqh-ff5p-wfr3), Moderate, affects versions before 1.35.8 and is patched in 1.36.0. Its title is a mouthful and every word of it is load-bearing: "Authentication Flow Information Disclosure in SSO Discovery Allows Organization Enumeration and Pre-Validation Token Exposure."
Two steps. The SSO verification endpoint "accepts any supplied email address" and hands back organisation metadata — names, and the organizationIdentifier values. Then the pre-validation request accepts an organizationIdentifier harvested from step one and returns a JWT. In the reporter's words, that happens "before any proof that they control the email identity involved in the first step."
So an unauthenticated caller submitting arbitrary email addresses learns which ones are recognised, which organisations exist, and who belongs to which — a mapping of your tenant structure and a list of valid employees, which is phishing target selection handed over on request. And then a token, for the price of an identifier it just learned.
The reporter's own summary is the better version of my thesis: this "suggests the SSO flow may trust attacker-reachable metadata too early," and "even if full account takeover is not immediately achieved, this behavior creates a dangerous primitive in the authentication chain."
That is the pattern across both. 47164 trusted an email the IdP asserted without checking whether the IdP had verified it. 47159 trusted an email the caller asserted and answered questions about it. Neither is a missing feature. Both are a flow acting on input before establishing the right to supply it.
Both were patched in 1.36.0, which the tag dates to early May — and both advisories published on 19 May, sixteen days after the release that fixed them. Same fix-first pattern as every other project in this series. Alongside them the 1.36.0 release carried SSO login CSRF and the SSO existing-user binding work. SSO_SIGNUPS_ALLOWED itself did not arrive until 1.37.3 in September, four months later, which tells you the configuration surface was still being worked out long after the feature shipped.
The honest summary: Vaultwarden's SSO support is younger and less battle-tested than the rest of the server, and its advisory rate reflects that. That isn't a reason to avoid it — a feature that gets audited and patched is in better shape than one nobody has looked at — but it's a reason to run current versions and not to treat SSO as the hardening upgrade it sounds like.
Also worth sitting with: the project's own wiki says Vaultwarden is "targeted towards individuals, families, and smaller organizations," and that development of features mainly useful to larger organisations "is not a priority," giving single sign-on and directory syncing as its examples. It adds, in fairness, that "high-quality PRs that implement such features would be welcome" — which is roughly how the SSO support got here in the first place, and which also explains the shape of its advisory record. A contributed feature in a project that does not prioritise that feature gets less maintainer attention per line than the core does, and the bug above is the kind that maintainer attention catches.
Enabling SSO therefore moves you onto the least-prioritised part of a project that is explicit about not prioritising it. That is a trade, not a disqualification, and it is one worth making knowingly.
What This Doesn't Cover
I verified the fix, the config surface, and the err_silent! versus err! distinction by reading src/api/identity.rs and .env.template at tag 1.37.5 in the actual repository, and I computed the CVSS vector and both counterfactuals myself. I did not reproduce the vulnerability. I didn't stand up a vulnerable Vaultwarden with a hostile IdP and attempt the binding, so I'm relying on the advisory's account of the pre-1.36.0 behaviour rather than my own observation of it.
I've characterised the other 2026 SSO advisories from release notes and advisory titles, not from reading their fixes. Treat the "rest of the record" section as a shape, not an inventory.
Out of scope: configuring any specific identity provider — Authentik, Keycloak, Entra, Google — which is realistically the bulk of the work and entirely provider-specific; LDAP and directory sync; Duo; and the master-password-derived encryption question, which is the deep one. SSO changes who can get a session. It doesn't change the fact that your vault key comes from your master password, and the relationship between those two things deserves its own piece rather than a paragraph.
The Actual Point
Five weeks of this series and the pattern has stopped being a coincidence.
Nextcloud's Collabora bug was escapeshellarg() — the correct function, correctly called, defending one shell when there were two. Immich's redirect bug was fixed, then found to be incompletely fixed, then found again on an endpoint nobody had checked. Jellyfin's permission defaults were right for a household and wrong for a household plus six friends. And Vaultwarden shipped a setting that prevents SSO account takeover, documented it accurately, defaulted it safely, and then didn't consult it on one of the two branches that needed it.
None of those are stories about missing controls. Every one of them is a story about a control that existed and wasn't reached. The security work had been done. It just wasn't done at every branch that needed it, and the branch that got missed is the one that matters, because that's what "missed" means.
Which has an uncomfortable implication for how we talk about hardening. Most hardening advice is a list of things to turn on, and all five of these services would've passed a checklist audit — the settings were there, the defaults were mostly right, the documentation said the correct things. What none of that catches is whether the setting is honoured everywhere it should be, and you can't determine that from the outside. You can only read the code, or trust that someone did.
So the practical version, which is less satisfying than a config snippet: run current versions, because the thing you're actually buying with an upgrade is other people's code review. Turn on the audit logging before you need it. And when a project tells you in its own config file that a combination of settings risks account takeover, believe the warning and also understand that the warning is a statement of intent rather than a guarantee of behaviour.
The template said "potential account takeover." It was right. It just wasn't load-bearing.
$ tail -f /forums
Discussion
Comments live on the community forums — sign in there to reply.