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.
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 secretA shared secret that a confidential client uses to prove itself to the authorization server, much like a password for an application. It belongs on a backend, never in code sent to browsers or phones. 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.
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.
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_SESSIONThe path names the account whose methods are reset, usr_1042, and the cookieA small value that a website asks the browser to store and send back with later matching requests. Cookies commonly carry a session identifier, so the site can recognize an ongoing sign-in without your password. carries the caller's sessionThe ongoing connection between later requests and an earlier sign-in, so you are not asked for your password on every click. It is often tracked with a cookie holding an unpredictable session identifier.. 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 tokenA piece of data issued by a trusted service that a client presents as a credential, for example to call an API or to report a sign-in. Some tokens carry readable claims; others are random strings that only the issuer can interpret., 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.
Try it in the Lab
- Try two indirect routes to more authorityLet a role editor try two indirect routes to more authority, adding himself to a group that hands out a role and saving a stale role edit, and see both refused.