Abusing federation and account linking
Every identity providerA service that authenticates users and tells other applications about the sign-in, so those applications never handle the users' passwords. In OpenID Connect it is called an OpenID Provider. a service trusts is another way in, and the service believes whatever it says about who signed in. This lesson looks at how that trust is abused: a provider asserting someone else's email, an account linked on the wrong attribute, and an administrator adding a provider of their own, and then at how to match accounts safely and watch trust configuration.
Trusting the wrong sign-in
The expense service at expenses.example, which Cedar and many other organizations use, lets people create an account with an email address and a passkeyA credential that your phone, computer or password manager creates for one website and keeps for you, unlocked with a fingerprint, face or PIN. Nothing you could type is sent, and it works only for the site it was made for, which helps it resist phishing.. It also lets them sign in with accounts they already have elsewhere: a large consumer identity provider at id.example.test that freelancers and small businesses use, a smaller social site at social.example.test, and, for organizations like Cedar, their own identity provider. Each provider the service accepts is a door into it. Whatever a trusted provider asserts about who signed in, the service believes, as Trust across systems explained. The service can check that a message is genuine and meant for it. It cannot check whether the provider told the truth.
That makes the service only as strict as the least careful provider it trusts. Some providers let anyone create an account and type any name or email address into their profile. Some host sign-in for many organizations, so anyone can create a new organization there and become its administrator. A business partner's identity provider may be run with less care than the service's own sign-in. An attacker who controls a trusted provider, by running one, creating a tenant at one, or taking one over, can make it assert whatever they like about who signed in. At a provider that hosts many organizations, only the issuerThe party that creates and signs a token, assertion, or certificate, named in a token's iss claim. A recipient must check that the issuer is exactly the one it expected and trusts. shows which tenant is speaking, which is why Forged tokens and stolen signing keys treated accepting another tenant's issuer as a validation flaw.
A provider speaks with authority about its own users: the accounts it created and the subject identifiers it assigned. Trouble starts when a service lets a provider's statement decide which of its own accounts someone may enter.
Matching on the wrong attribute
The simplest form of that mistake is linking on email. A sign-in arrives from a provider with the email address of an existing expense account, and the service treats the person as that account's owner. Here is how an attacker uses that. They sign up at a provider the service trusts, set their profile email to Riley's address, [email protected], and sign in to the expense service through that provider. The provider asserts the address because the attacker typed it. The service finds Riley's account with the same address, links the new sign-in to it, and opens Riley's expense claims and the bank details they are paid to.
Email fails as a key in several ways. Some providers never verify the addresses people enter. Some verify an address once and then let the person change it without checking again. Addresses are reassigned when someone leaves a company or abandons a mailbox, and a lapsed domain can be registered by someone new, along with every address under it. Usernames, phone numbers, and display names share the weakness: they describe an account at a moment in time, and they can change hands.
The stable key is the pair of issuer and subject: the provider's identifier, and the identifier it assigned to this person and never reassigns. Trust across systems explained why both are needed. The service stores that pair on the account when a link is created and, on later sign-ins, looks the pair up and ignores the email. Creating a new link to an existing account requires the person to prove control of that account first, by signing in with its own methods, as the same lesson points out. Linking accounts covered the cases where even a verified email claim is not enough, and walked through a safe linking flow step by step.
The attack also leaves evidence. Riley's account gains a linked identity from an issuer it never used before, followed by sign-ins through that issuer from an unfamiliar network. A notice to the owner's existing verified address whenever a new way to sign in is linked gives them a chance to react, and the link itself belongs in the account's history.
Each sign-in below arrives at the expense service. Decide what it should do.
Link or refuse?
Simulation. These sign-ins are made up, and answering sends nothing. Each one arrives at the expense service; decide what it should do.
Adding a door through configuration
An attacker with administrative access to an organization's identity configuration does not need to trick a provider. They can add one. Workforce identity systems let administrators trust another identity provider, accept sign-ins for a domain from an outside source, or add a signing certificateA signed statement that a public key belongs to a name, such as a website's hostname, for stated purposes and a limited period. A certificate authority signs it, so software that trusts the authority can connect the key to the name. to an existing federationAn arrangement that lets systems accept identity information from another trusted system, so an application can rely on a sign-in performed by a separate identity provider. trust. Each is a legitimate feature for mergers, partners, and migrations. In the wrong hands, each creates a door that signs in as any user the attacker chooses, with no password or second factor from the real person. MITRE ATT&CK catalogues this as T1484.002, Domain or Tenant Policy Modification: Trust Modification. Adding a signing certificate to an existing trust is the administrative route to the same result as stealing the provider's own key, the Golden SAMLThe Security Assertion Markup Language, a federation standard widely used for workplace single sign-on, in which the identity provider sends the application a signed assertion about the user. attack in Forged tokens and stolen signing keys.
Claim mappings offer a quieter route. A mapping decides which attribute from a provider identifies the account, or which group grants which role. Changing it so that a value the attacker controls decides who signs in, or so that a group they belong to maps to an administrator role, turns an ordinary sign-in into a privileged one without adding anything to the list of providers.
These doors survive the usual clean-up. Resetting passwords, revoking sessions, and removing an attacker's authenticatorSomething a person controls and uses to prove control of an account, such as a memorized password, an app that generates one-time codes, or a security key. It counts only after it has been registered to that account. do nothing to a trusted provider the attacker runs, which is why it is a favored way to keep access; How attackers stay in returns to it. In Cedar's incident, the attacker's call to the help desk for an administrator's MFASigning in with more than one type of factor, such as a password plus a code from an enrolled authenticator app. Two passwords are still one factor type, however many screens they appear on. reset was refused. Had it succeeded, they would have held exactly the access that changes like these require.
Watching trust configuration
Trust configuration decides who can sign in as whom, so changing it needs the protection given to the most privileged roles. Only a few administrators should be able to add a provider, a signing certificate, or a claim mapping. Each change should require a fresh, phishing-resistantA property of an authentication method that binds sign-in to the real service, so evidence entered on a look-alike site cannot be passed on and used. Passkeys have it; passwords and one-time codes do not. sign-in, and adding a provider can reasonably need a second administrator's approval. Protecting privileged access goes further into these controls.
Every change should be recorded with who made it, from where, and the values before and after. A new provider can sign in as any user it is mapped to, and it keeps working after every password in the organization has been reset, so a security team wants to hear about one within minutes, not at the next quarterly review. Because these changes are rare, an alert on each new provider, domain, certificate, or mapping change is seldom noise.
Regular review closes the loop. Compare the trusted providers and certificates with the partnerships the organization actually has, confirm that each certificate matches what the partner publishes, and look closely at sign-ins through rarely used providers, especially into administrator accounts. Recording identity activity and Reviewing identity security posture take up how to keep those records and make the checks routine.
Check your understanding
Try these questions before moving on. If an answer isn't right, use the feedback and try again.
Try it in the Lab
- Widen a federation trust, see who it lets in, and close itSee a Lab Mail account with nothing to connect to stopped at Lab Photos, widen the provider's trust so it creates accounts, watch an outsider come in, find the change in Audit and close it.
Try a Capture the Flag challenge
Apply this lesson against an isolated, intentionally vulnerable application. Capture a flag, explain the mistake, then repair and retest it.