Privilege escalation is the act of gaining permissions beyond those an account or process was granted. In vertical privilege escalation, an attacker moves from a low-privileged account to an administrator, root or cluster-wide role; in horizontal privilege escalation, they access resources of another user with the same level of rights. It usually follows initial access and exploits vulnerabilities, misconfigurations or overly broad permissions. MITRE ATT&CK lists it as its own tactic, Privilege Escalation (TA0004).
What is privilege escalation?
Privilege escalation is the step in an attack where limited access becomes powerful access. Attackers rarely start with administrator rights. They get in through a phished account, a vulnerable web application or a leaked API key, and then look for a way to increase what that foothold can do: becoming root on a server, an administrator in the domain, the owner of a cloud account or a cluster administrator in Kubernetes.
In MITRE ATT&CK, Privilege Escalation is a tactic of its own (TA0004). Techniques include Exploitation for Privilege Escalation (T1068), Abuse Elevation Control Mechanism (T1548), which covers sudo and setuid abuse, and the use of Valid Accounts (T1078) with higher rights. The best structural defense is least privilege: the fewer rights each identity has, the less there is to escalate to and the fewer paths exist.
Vertical and horizontal escalation
| Type | What changes | Example |
|---|---|---|
| Vertical | The level of rights | A web server process becomes root; a developer role grants itself administrator access in the cloud. |
| Horizontal | The scope, at the same level | User A changes an ID in the URL and reads user B's invoices, a broken object level authorization flaw. |
Horizontal escalation in web applications is part of Broken Access Control, the first category of the OWASP Top 10 2021, and appears as broken object level authorization in the OWASP API Security Top 10.
Typical paths by environment
Linux hosts
- Overly permissive
sudorules, for example allowing an editor or interpreter that can spawn a shell. - Setuid binaries that can be abused, or writable scripts executed by root through cron or systemd.
- Kernel and system vulnerabilities, such as Dirty COW (CVE-2016-5195) or the polkit flaw PwnKit (CVE-2021-4034). Each such flaw is tracked as a CVE.
- Credentials in readable files, shell history or environment variables.
# signs worth reviewing on a Linux host
sudo -l # what may the current user run as root?
find / -perm -4000 -type f 2>/dev/null # setuid binaries
ls -l /etc/cron.d /etc/systemd/system # jobs and units run as root
Windows and Active Directory
- Services running as SYSTEM with writable binaries or unquoted paths.
- Token impersonation and bypasses of user account control.
- Misconfigured group memberships and delegation that lead to domain administrator rights.
Cloud IAM
- Permissions that let an identity change its own permissions, for example creating a new policy version, attaching a managed policy or adding itself to a group.
- Passing a more privileged role to a new compute resource (on AWS,
iam:PassRolecombined with the right to start instances or functions). - Creating access keys for other, more privileged users.
Kubernetes
- A pod running as privileged, with
hostPathmounts,hostPIDor the container runtime socket, which can lead to the node. - Service accounts that may create pods or read secrets in other namespaces, or bindings to
cluster-admin. - RBAC roles with wildcards or the
escalate,bindorimpersonateverbs.
# risky pod settings
securityContext:
privileged: true # avoid
allowPrivilegeEscalation: true # set to false
runAsUser: 0 # prefer a non-root user
Preventing privilege escalation
- Least privilege everywhere: minimal sudo rules, scoped cloud roles and namespace-scoped Kubernetes roles; remove rights that are not used.
- Patch quickly: local privilege escalation flaws in kernels, sudo and system services are valuable to attackers once they have a foothold.
- Harden workloads: run containers as non-root, set
allowPrivilegeEscalation: false, drop Linux capabilities and enforce Pod Security Standards. - Protect self-modifying permissions: treat rights to change IAM policies, roles and bindings as administrator rights and restrict them accordingly.
- Enforce authorization on the server: check object ownership on every request to prevent horizontal escalation; never rely on IDs being hard to guess.
- Use just-in-time access for administrative tasks instead of standing administrator accounts.
- Review configuration as code: scan Terraform and manifests for broad permissions before deployment and detect configuration drift afterwards.
Common mistakes
- Granting wildcard permissions during development and never narrowing them.
- Running applications as root because it is the container default.
- Treating the right to edit roles or policies as harmless.
- Disabling or not collecting audit logs, so escalation leaves no trace.
Detecting privilege escalation
- Hosts: unusual
sudouse and failures in auth logs, new setuid files, new users in privileged groups, processes running as root that were started by a web server or other service account, and deleted or truncated logs. - Cloud: IAM changes in audit logs, such as new policy versions, attached administrator policies, new access keys and role assumptions that are unusual for the identity.
- Kubernetes: audit log entries for new role bindings, privileged pods, exec into pods and access to secrets.
- Applications: access to objects of other tenants or users, and administrative API calls from non-administrative accounts.
Each of these can become an indicator of compromise. Correlating them with the preceding initial access and the following actions turns isolated events into a timeline.
Privilege escalation in the attack chain
A typical sequence looks like this: an attacker exploits a vulnerable web application and gets a shell as the unprivileged service user; they search the host for credentials, sudo rules and setuid binaries; they escalate to root; they read cloud credentials from the instance or a configuration file; and finally they use those credentials to escalate again in the cloud account. Each step has its own detection opportunity, and each one would have been harder with tighter permissions. This is why defenders think in paths rather than single findings: a medium-severity misconfiguration can be the missing link between initial access and full control.
The observability perspective
Privilege escalation is usually a short moment between two longer phases, initial access and the actual objective. Host, process and audit logs from the same systems that operations already monitors make that moment visible, and telemetry about services and deployments helps separate a legitimate change from an attacker's step. A new root process right after a suspicious request on the same host tells a different story than a planned deployment with the same effect.
How Obseria helps
Obseria detects and makes signs of privilege escalation visible; it does not block actions. Workload threat detection recognizes suspicious behavior on hosts from host logs, such as new processes, tampered systems or deleted audit logs, detection only. Threat Observability applies detection rules mapped to ATT&CK techniques to logs, hosts and clouds, and the Cloud SIEM collects security events and manages findings. Cloud security posture management finds misconfigurations such as overly broad access rights, and IaC security checks Kubernetes manifests and Terraform before deployment. Inside Obseria, roles and permissions control who can see and change what, and the audit trail records changes. See also the Kubernetes security monitoring guide.