Skip to content
cloudgrip

$ man privilege-escalation

//Attacks and vulnerabilities

What is privilege escalation?

Privilege escalation is when a user or attacker gains access beyond what they were granted. Horizontal escalation reaches another user's data at the same level. Vertical escalation gains the powers of a higher role, such as administrator.

  • Attacks and vulnerabilities
  • 3 min read
  • updated Nov 11, 2026

How it works

Privilege escalation happens when a system decides who you are but fails to check what you are allowed to do. The login step worked. The missing piece is a check, on one specific request, that this account may perform this action on this object.

There are two directions.

What it looks like

A team workspace product has three roles: viewer, editor and admin. Only admins see the "Remove member" button. A viewer skips the interface and sends the request directly.

output
DELETE /api/workspaces/ws_204/members/u_881 HTTP/1.1
Host: api.acme.test
Authorization: Bearer <token of a user with the viewer role>

HTTP/1.1 204 No Content

The member is removed. The interface hid the button, but the server never checked the caller's role. Hiding a control in the browser is not access control, because anyone can send the request by hand.

Other common shapes:

  • A request that carries its own role, such as "role": "admin" in a profile update, which the server accepts.
  • An admin page that is protected, while the API it calls is not.
  • An old API version that predates the permission checks added to the new one.

How to test for it

You need at least two accounts for each role, in two separate customer accounts, and a list of what each role should be able to do. Without that list you cannot tell a bug from a feature.

  1. Sign in as the most privileged role and record every request the application makes while you use each feature.
  2. Replay each privileged request with a lower role's session. Any request that still succeeds is a vertical finding.
  3. Replay requests that name an object, such as an order or a file, with another user's session at the same level. Success is a horizontal finding.
  4. Repeat across customer accounts, since crossing that boundary is usually the most serious result.
  5. Try the same actions through every route: web, mobile API, older API versions, bulk and export functions.

Automated scanners are weak here, because a successful unauthorized request looks like any other successful request. This is the main reason for authenticated penetration testing.

How to fix it

Check authorization on the server, for every request, in one shared place.

output
// Before: any signed-in user reaches the handler
router.delete("/workspaces/:ws/members/:id", requireLogin, removeMember);

// After: the server checks the caller's role in this workspace
router.delete("/workspaces/:ws/members/:id", requireLogin, requireRole("admin"), removeMember);

Beyond the single fix:

  • Deny by default. A new endpoint should refuse everyone until a rule allows access.
  • Take identity and role from the session, never from fields in the request.
  • Check the object as well as the function. An admin of one workspace is not an admin of another.
  • Keep the rules in one place, such as shared middleware or a policy layer, so no handler has to remember them.
  • Write tests that assert refusal. For each sensitive endpoint, a test should confirm that a lower role receives a 403 response.

Operating system and cloud escalation

The same idea exists below the application. On a server, an attacker who lands as a low-privileged user looks for a way to become root or administrator: a misconfigured sudo rule, a program that runs with elevated rights, a stored password, or an unpatched kernel flaw.

In a cloud account, the path runs through identity permissions. A role that is allowed to attach policies, create access keys for other users or pass a stronger role to a new resource can often grant itself far more than intended. Stolen credentials from an instance metadata service are a common starting point. The defense is the same in every layer: grant the least access that works, and review what each identity can really do. Broken access control covers the wider category.

See what an attacker would find.

Give us a URL and two test logins. If there’s something to find, your first exploited findings land within 24 hours.

You talk to the people who build Hydra and Cerberus. No sales script.

or write to founders@cloudgrip.ai