# Privilege Escalation > Gaining rights beyond those granted: **vertical** (user to admin, function-level), **horizontal** (user A to user B, object-level), or **cross-boundary** (org-admin to platform-admin, app to cluster or cloud). In web apps it is the *impact* of a broken access control, not a separate bug class. ## How it works Escalation needs a place where the server trusts something the caller influences more than the server's own record of the caller's rights. Common anchors: - **Role carried by the client**: `?role=1`, `admin=true` cookie, `roleid` in a profile update, or role claims in a token the server doesn't verify. - **Role check scoped too broadly**: "is admin *somewhere*" instead of "is admin *of this org/tenant/folder*". - **Hierarchy gaps**: the org admin may edit users but nothing stops them editing a platform admin; the target or parent of a move isn't checked. - **Type confusion**: permissions keyed on record type, with the type user-controlled. - **Framework enforcement quirks**: the authz hook fires, but the engine still resolves the field or mutation. - **Horizontal to vertical**: an IDOR on another user's profile, password or role becomes vertical once the victim is an admin (PortSwigger: `myaccount?id=` of an admin discloses or changes the admin's password). ## Techniques / payloads | Vector | Example | |---|---| | Parameter/cookie role | `GET /login/home.jsp?admin=true`; flip `Admin=false` cookie; add `"roleid":2` to a profile-update body (PortSwigger labs) | | Token claim tampering | decode the access token, set `alg` to `HS256`, change `nameid` to `430` and append `role: CeAdmin`, then resend (see [[JWT Algorithm Confusion]]) | | Mass assignment | extra fields on profile edit (`legal_name`, `dob`, government ID) accepted without resetting `verified`, called "identity drift", which then linked third-party insurance records (see [[Mass Assignment]]) | | Cross-org role update | `PUT /api/memberships/{id}` with `role=Admin`, using an admin token from org A on a membership in org B; the backend only checked "token is admin" | | Self-targeted IDOR | an Employee may edit a User's IP-allowlist ACL but not their own; swap the target ID to self to strip their own ACL | | Session switching | WSTG: manipulate group/profile/condition values or IP, and swap session identifiers between roles | | Stored XSS to admin | WordPress contributor plants XSS (Legacy Widget block, The Events Calendar CVE-2026-123464) that creates an admin when an admin views it | | Template sandbox | Shopware Twig/App Scripts with insufficient isolation bypass authorization checks, leading to admin takeover (< 6.6.10.32 / 6.7.16.1) | | Type change | Silverstripe GridField: user-controlled `ClassName` changes a record into an unrelated class, bypassing that class's permission checks (CVE-2026-91113) | | Re-parenting | TeamPass `update_folder` doesn't check target or parent folder IDs, so a user can move credential subtrees or convert folders to personal | GraphQL engine bugs that turn into privesc (owned by [[GraphQL Authorization Flaws]]): - **graphql-ruby `Execution::Next`** (GHSL-2026-152): when `authorized?` raises `GraphQL::UnauthorizedError`, the runner still calls `resolve`. Data is returned and mutations execute. - **@neo4j/graphql ≥ 5.2.0**: a type-level `@authentication` silently discards the stricter field-level rule on root custom-resolver fields, so any authenticated client can invoke restricted operations (fixed 7.6.0+/5.12.15+). ### Beyond the web tier App bugs frequently escalate into the platform underneath: - **Kubernetes RBAC**: `system:masters` bypasses RBAC *and* authz webhooks and can't be revoked by removing bindings. `escalate`, `impersonate`, `nodes/proxy`, CSR API access, list on Secrets (returns contents), create-Pod (implicitly every Secret, ConfigMap and PV in the namespace) and create-PersistentVolume (hostPath) are all escalation primitives. OperTraitor measures the gap between what operators document and what their RBAC grants (IBM Turbonomic CVE-2026-6389). - **Jupyter Enterprise Gateway 3.2.3**: `KERNEL_UID="0 "` (trailing space) beats the UID-0 denylist, giving root in the kernel pod. Combined with hostPath mounts and the gateway's broad service account, that becomes cluster admin. - **AWS IAM**: IAM Vulnerable deploys 250+ resources covering **31** IAM privesc paths (Gietzen's research; Pacu, Cloudsplaining). - **AD**: BadSuccessor. `CreateChild` on an OU lets you create a dMSA linked to a privileged account, and the KDC grants the predecessor's privileges (Windows Server 2025). - **Host**: Copy Fail (CVE-2026-31431), an AF_ALG + `splice()` page-cache corruption, gives root and container breakout. `docker` group membership is root by design. ## Notable cases - **Organization takeover, $1,200**: Manager in org B escalated to Admin via a cross-org membership update. Root cause: role endpoint not scoped to the org. - **flowintel < 4.1.0**: org admins could modify platform-admin accounts through the browser admin user editor. - **IDOR + ACL bypass ($100)**: Employee removed their own network ACL by targeting their own user ID. - **Insurance takeover via identity drift**: mass-assigned identity fields stayed "verified" and matched third-party records. ## Defenses - Derive role and tenant from **server-side session state**, never from request fields or unverified token claims. Pin JWT algorithms. - Scope every role check to the **resource's** org/tenant/folder (`isAdmin(user, resource.org)`), and enforce a role hierarchy (an actor can't modify principals at or above its own level). - Allowlist writable fields (DTOs) to kill mass assignment of `role`, `verified` or `ClassName`. - Treat type, parent and owner changes as privileged operations with their own checks. - Platform: no `system:masters` for humans, audit `escalate`/`impersonate`/`nodes/proxy` grants, `automountServiceAccountToken: false`, downscope operator service accounts. ## Related - [[Authorization Security]] - [[Broken Access Control]] - [[Function Level Authorization]] - [[Multi-Tenant Isolation]] - [[Insecure Direct Object Reference]] - [[Mass Assignment]] - [[JSON Web Tokens]] - [[GraphQL Authorization Flaws]] - [[Account Takeover]] - [[SSRF in Kubernetes and Containers]] - [[Leaked Cloud Credentials]] ## Sources - [[raw/portswigger.net/access-control-vulnerabilities-and-privilege-escalation-portswigger-2727|Access Control Vulnerabilities and Privilege Escalation - PortSwigger]] - [[raw/cyberiumx.com/broken-access-control-vertical-privilege-escalation-writeup-2726|Broken Access Control - Vertical Privilege Escalation Writeup]] - [[raw/owasp.org/testing-for-privilege-escalation-owasp-wstg-2732|Testing for Privilege Escalation - OWASP WSTG]] - [[raw/medium.com/privilege-escalation-by-jwt-token-manipulation-4307|Privilege Escalation by JWT Token Manipulation]] - [[raw/ehteshamulhaq198.medium.com/organization-takeover-via-privilege-escalation-idor-4310|Organization Takeover via Privilege Escalation (IDOR)]] - [[raw/medium.com/privilege-escalation-via-idor-and-acl-bypass-in-saas-4309|Privilege Escalation via IDOR and ACL Bypass in SaaS]] - [[raw/infosecwriteups.com/mass-assignment-and-the-identity-drift-from-profile-edit-to-insurance-10194|Mass Assignment and the Identity Drift: From Profile Edit to Insurance Takeover]] - [[raw/medium.com/from-contributor-to-administrator-stored-xss-in-the-events-calendar-14034|From Contributor to Administrator: Stored XSS in The Events Calendar]] - [[raw/github.com/shopware-insufficient-twig-template-isolation-permits-privilege-escala-15405|Shopware insufficient Twig template isolation permits privilege escalation]] - [[raw/github.com/flowintel-authorization-bypass-in-admin-user-editing-15555|flowintel authorization bypass in admin user editing]] - [[raw/github.com/silverstripe-user-controlled-classname-allows-unauthorized-record-type-14973|Silverstripe: user-controlled ClassName allows unauthorized record type change]] - [[raw/github.com/teampass-folder-re-parenting-authorization-bypass-15474|TeamPass folder re-parenting authorization bypass]] - [[raw/github.com/neo4j-graphql-privilege-escalation-via-dropped-field-level-authenticat-13197|@neo4j/graphql privilege escalation via dropped field-level @authentication]] - [[raw/securitylab.github.com/ghsl-2026-152-privilege-escalation-via-authorization-bypass-in-graphql-13196|GHSL-2026-152: privilege escalation via authorization bypass in graphql-ruby]] - [[raw/kubernetes.io/kubernetes-rbac-good-practices-3973|Kubernetes RBAC Good Practices]] - [[raw/unit42.paloaltonetworks.com/opertraitors-how-kubernetes-operators-betray-your-security-posture-12162|OperTraitors: How Kubernetes Operators Betray Your Security Posture]] - [[raw/elttam.com/jupyter-enterprise-gateway-from-notebook-to-kubernetes-cluster-admin-e-8984|Jupyter Enterprise Gateway - From Notebook to Kubernetes Cluster Admin - elttam]] - [[raw/github.com/iam-vulnerable-6510|IAM Vulnerable]] - [[raw/infosecwriteups.com/badsuccessor-exploiting-delegated-managed-service-accounts-in-windows-10229|BadSuccessor — Exploiting delegated Managed Service Accounts in Windows Server 2025]] - [[raw/microsoft.com/cve-2026-31431-copy-fail-vulnerability-enables-linux-root-privilege-es-7540|CVE-2026-31431: Copy Fail vulnerability enables Linux root privilege escalation across cloud environments]] - [[raw/infosecwriteups.com/why-being-in-the-docker-group-is-a-backdoor-to-your-whole-system-10034|Why Being in the Docker Group Is a Backdoor to Your Whole System]]