Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

Escalating privilege

An attacker who takes over an ordinary account wants more than that account can do. This lesson starts from Riley's finance account at Cedar Inc. and follows the quieter routes toward administration: an account that grants itself more, groups and nesting that pass a role along, integrations that hold more than the people who manage them, and requests the server never checks. Each route has a limit that closes it.

Starting from an ordinary account

When someone takes over an ordinary account, they get whatever that account can do. Riley works in Cedar Inc.'s finance team. Riley's account can read and send Riley's mail, open the invoices the team works on and look colleagues up in the staff directory. It cannot create accounts, reset anyone else's sign-in methods or change Cedar's sign-in policy. The attacker who phished Riley's sign-in at 09:14 got the first list and not the second.

The second list is the bigger prize. An account that can reset other people's sign-in methods can take over any of them, and an account that can change policy can switch off the checks that would notice. Turning the access an account was given into access it was not given is privilege escalation. Reaching more powerful permissions, such as administration, is often called vertical escalation. Reaching other people's data at the same level, such as a colleague's invoices, is horizontal escalation.

Both start from what a signed-in account can see, and ordinary accounts can usually see a lot. A staff directory shows who belongs to which team and who the administrators are. Group listings show which groups exist and who owns them. None of this needs to be secret, but together it is a map. At Cedar, the attacker's most direct try for more was the call to the help desk that Rowan refused. The routes in this lesson are quieter, because they run through Cedar's own configuration, and each step can look like ordinary administration in the records.

Accounts that grant themselves more

The most direct route is an account that can change permissions and uses that ability on itself. Suppose a finance systems lead at Cedar may edit the roles the finance team uses, so that the team's access keeps up with its work. The lead also holds one of those roles, Finance reviewer. Adding a permission to Finance reviewer adds it to the lead, so the right to edit a role has quietly become the right to grant yourself anything the editor can add. It also reaches further than the lead: every other holder of Finance reviewer gains the same permission at the same moment.

The same pattern takes other forms. Someone who can assign roles may be able to assign one to their own account. An administrator whose role is scoped to one office may be able to widen an assignment from that office to the whole organization. Where access depends on attributes, as in Where attributes come from, a profile field such as department may be editable by the person it describes. If a rule allows payroll exports for anyone whose department is Payroll, a self-service profile page has become a permission screen.

Each of these works because the system answered a narrower question than the one that mattered. It asked whether this person may edit roles, or edit their profile, and not what this person will be able to do after the edit. The records show the difference to anyone who looks: a role edit or assignment where the account making the change is also an account that benefits, or an attribute change followed shortly by access the account has never used before.

Indirect routes

Escalation does not need a self-edit. More often the path runs through something the attacker controls that is connected to something more powerful. Groups are the most common link. When a role is assigned to a group, whoever controls the group's membership controls who holds the role. Group owners are often ordinary team members, chosen because they know who belongs on the team, not because anyone meant to give them administrative power.

Nesting lengthens the chain. A group can be a member of another group, and a role can include another role. Each link may be reasonable on its own, added years apart by different people, yet the combined result is something nobody decided. Cedar keeps its staff accounts in Active Directory, the Microsoft directory many companies use for workforce accounts, and the figure shows a configuration like this one there. A member of the finance team owns a small group, Finance app admins, created to administer one finance application. At some point that group was placed inside the broader IT operations group for convenience, and IT operations is a member of Account Operators, a group built into Active Directory whose members can reset most users' passwords.

The intended path ends at one application's settings. The nesting added for convenience is the weak link that leads to user administration.

Following the arrows shows the problem. The finance team member can add any account to Finance app admins, including one an attacker controls, and that account then holds user administration through the nesting. If the attacker had taken over the group owner's account instead of Riley's, one membership change would have been enough. Nothing on the path is a flaw in the software. It is the configuration read as a whole, and it only becomes visible when someone works out the effective permissions, everything an account ends up holding through every group and role it reaches, instead of looking at one assignment at a time.

Accounts that are not people are links too. A service account is an account that software uses to do its work, and an integration with administrative rights authenticates with a credential such as the client secret from Client credentials. Whoever can manage that credential can act as the integration, and the integration may hold far more than the person managing it. An application owner who adds a new secret to an integration that can manage users has, in effect, granted themselves user management. The same move lets an attacker keep access after the original account is cleaned up, as How attackers stay in explains.

Limits on who can grant what

Each of these routes closes with a rule about who can grant what, enforced by the service that makes the change. The first is a delegation limit: an account can grant only permissions it holds itself and is allowed to pass on. A help desk lead who may assign the help desk role cannot use that ability to hand out user administration, because it is not theirs to give. Administering roles safely worked through this limit, including how it applies to role edits as well as assignments.

The second separates defining a role from deciding who holds it. People who edit what a role permits should not be able to assign it to themselves, and nobody should add permissions to a role they currently hold without a second person approving. Editing a role changes the access of everyone who holds it, so the service checks the edit against every current holder, not only against the person making it. The finance systems lead's edit to Finance reviewer would have stopped at that check.

Groups need the same treatment. If a group carries a privileged role, adding a member is granting that role, so only someone who could grant the role directly should control the membership. Nesting a group, or including one role in another, deserves the same check, made against the effective result. The figure compares the finance team member's request under a service that asks only the narrow question with one that asks what the new member would hold.

Narrow check

Request
Add an account to Finance app admins
May edit the group
Yes
Group passes on
Not checked
Could grant that directly
Not checked
Decision
Allowed

The account gains user administration

Effective result check

Request
Add an account to Finance app admins
May edit the group
Yes
Group passes on
User administration, through IT operations
Could grant that directly
No
Decision
Refused

The nesting stays closed

If a group carries a privileged role, adding a member is granting that role.

The same request to add an account to Finance app admins, checked two ways. Only the check on the effective result sees that the group passes on user administration through IT operations.

For grants that reach administrative permissions, many organizations also require a second administrator's approval, which turns a quiet self-promotion into a request someone else has to read. Refused attempts belong in the records alongside the changes that succeed, with the account that asked, what it tried to grant and why it was refused. An ordinary account trying to give itself more is rarely an accident.

The exercise below shows role and group records from made-up configurations. In each one, find the path up.

Find the path up

Simulation. These role and group records come from made-up configurations, and choosing an answer sends nothing. Each one hides a path from limited access to more.

Account usr_2207 holds no administrative role. How could it reach user administration? 1 of 4
account usr_2207 (accounts payable clerk)
  member of:  ap-team
  owner of:   expense-tool-admins

group expense-tool-admins
  roles:      Expense tool administrator
  member of:  it-operations

group it-operations
  roles:      User administrator

Enable JavaScript to check an answer here, or open the explanation below.

Show the answer and why

By adding an account to expense-tool-admins, which sits inside it-operations. The nesting is the weak link. Membership in expense-tool-admins carries User administrator from it-operations, and usr_2207 controls that membership. Treating control of a group as granting its roles, and checking nesting against the effective result, would close the path.

Where is the path up for account usr_3150? 2 of 4
account usr_3150 (finance systems lead)
  roles:  Finance reviewer, Finance role editor

role Finance reviewer
  permissions:  invoices.read, payments.view
  holders:      usr_3150, usr_3188, usr_3201

role Finance role editor
  permissions:  edit finance roles, add any permission

Enable JavaScript to check an answer here, or open the explanation below.

Show the answer and why

By adding permissions to Finance reviewer, a role it holds itself. The right to edit a role you hold is the right to grant yourself more, and every other holder gains the same permissions. A delegation limit, and a second approver for edits to a role the editor holds, would stop it.

What path up does this configuration give account usr_4410? 3 of 4
application payroll-sync (service account)
  roles:        User administrator
  credentials:  1 client secret
  owners:       usr_4410

account usr_4410 (payroll analyst)
  roles:  Payroll viewer

Enable JavaScript to check an answer here, or open the explanation below.

Show the answer and why

Add a client secret of its own to payroll-sync and act as the application. Owning an application usually includes managing its credentials. With a secret of its own, usr_4410 can act with everything the application holds, so owners of privileged integrations need the same scrutiny as holders of the role.

A sales employee who signs in with a passkey wants to run payroll exports. What is the path? 4 of 4
policy payroll-export
  allow if:  department == "Payroll"
             and sign-in method is phishing-resistant

profile page (self-service)
  editable by the user:  display name, phone, department

Enable JavaScript to check an answer here, or open the explanation below.

Show the answer and why

Change their own department to Payroll on the self-service profile page. The policy trusts an attribute that the person it describes can edit. Attributes that grant access should come from an authoritative source, such as HR records, not from self-service fields.

Checking on every request

Some routes need no configuration mistake at all. Imagine that Cedar's administration console shows a Reset sign-in methods button only to help desk staff. Hiding the button keeps the screen tidy, but pressing it sends a request to the console's server, and anyone can send that request without the button. If the server accepts it from any signed-in account, anyone who sends it directly can reset methods. Deciding what someone can do made the same point: the service that performs an action checks the permission itself.

The request also names its target:

POST /admin/users/usr_1042/methods/reset HTTP/1.1
Host: admin.cedar.example
Cookie: session=EXAMPLE_SESSION

The path names the account whose methods are reset, usr_1042, and the cookie carries the caller's session. Changing usr_1042 to an administrator's identifier changes the target, not the person asking, so the server has to check that this caller may act on that particular account. A policy might let help desk staff reset methods for ordinary employees while requiring a stronger process for administrators, and the server enforces that distinction on the identifier it receives, whatever the screen offered. This is the object-level check from Checking access to each object, applied to administration.

The check also needs current information. If an application decides once at sign-in and keeps the answer in a session or a long-lived token, a role removed at 10:00 may keep working until that session ends, and a page opened before the removal may still send requests after it. Checking current assignments on each request, or keeping any cached decision short, means that removing access actually removes it. When the information needed to decide is missing, such as an unknown permission or a policy service that cannot be reached, the server refuses.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

A help desk lead at Cedar may assign roles so that new agents can start work. The service also lets the lead assign User administrator, a role the lead does not hold. What is missing? 1 of 4

Choose one answer.

Cedar shows the Reset sign-in methods button only to help desk staff, but the server accepts the reset request from any signed-in account. What does that show? 2 of 4

Choose one answer.

A Cedar team member owns Finance app admins, a group nested inside IT operations, which can reset most users' passwords. They add a colleague to Finance app admins. What did that change grant the colleague? 3 of 4

Choose one answer.

Cedar removes a role from an account at 10:00. At 10:20 a page the account opened at 09:50 sends a request that only the role allowed, and the server accepts it. What is the likely cause? 4 of 4

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity