Privilege Escalation

Back to glossary

What Is Privilege Escalation?

Privilege escalation is a type of attack where an adversary gains higher access permissions than originally granted. It allows attackers to move from a low-privilege foothold to administrative or root-level control, enabling them to access sensitive data, modify system configurations, or persist undetected within an environment.

A privilege escalation attack is rarely the first step in a breach. It is typically chained with an initial access vector, such as phishing or exploiting a web vulnerability, to deepen control over the compromised system. For application security teams, understanding how identity escalation works is critical because it turns minor vulnerabilities into full system compromises.

Types of Privilege Escalation Attacks

Privilege escalation falls into two categories, each with distinct techniques and implications.

Vertical Privilege Escalation

Vertical escalation occurs when an attacker elevates from a lower-privilege account to a higher one, such as moving from a standard user to an administrator. This is the more dangerous form because it grants access to resources and operations that are normally restricted.

Common techniques include:

  • Kernel exploits: Exploiting vulnerabilities in the operating system kernel to execute code with root or SYSTEM privileges.
  • Misconfigured SUID/SGID binaries: On Linux, executables with SUID bits run with the file owner’s permissions. A misconfigured SUID binary owned by root gives any user root-level execution.
  • Token manipulation: On Windows, attackers steal or forge access tokens to impersonate privileged accounts without knowing their credentials.
  • Unpatched services running as root/SYSTEM: Services with known vulnerabilities that run under privileged accounts provide direct escalation paths when exploited.

Horizontal Privilege Escalation

Horizontal escalation occurs when an attacker accesses resources belonging to another user at the same privilege level. For example, one customer accessing another customer’s account data in a SaaS application. While it does not increase the attacker’s permission level, it exposes data and functionality that should be isolated.

Horizontal escalation frequently exploits broken access control mechanisms, particularly insecure direct object references (IDORs) where the application uses predictable identifiers without verifying that the requesting user owns the referenced resource.

Privilege Escalation in Linux and Windows Environments

Both major operating systems have well-documented escalation paths that attackers routinely exploit.

Linux Escalation Vectors

  • Kernel vulnerabilities: Unpatched kernel flaws (e.g., Dirty COW, Dirty Pipe) allow unprivileged users to write to read-only memory or escalate to root.
  • SUID/SGID misconfigurations: Binaries like find, vim, or custom scripts with SUID bits can be abused to spawn root shells.
  • Cron job abuse: Writable cron scripts or world-writable directories referenced by cron jobs allow code injection that executes as root.
  • Writable /etc/passwd: If an attacker can write to /etc/passwd, they can add a new user with root privileges or modify existing entries.
  • Sudo misconfigurations: Overly permissive sudoers rules let users run specific commands as root, which can be chained to gain full root access.

Windows Escalation Vectors

  • Unquoted service paths: Services with spaces in their file paths and missing quotes allow attackers to place a malicious executable earlier in the path resolution order.
  • DLL hijacking: Applications that load DLLs from writable directories can be tricked into loading attacker-controlled libraries.
  • AlwaysInstallElevated: A Group Policy setting that, if enabled, allows any user to install MSI packages with SYSTEM privileges.
  • Access token theft: Tools like Mimikatz extract tokens from memory, enabling attackers to impersonate domain administrators.

Enforcing mandatory access control policies (SELinux on Linux, Mandatory Integrity Control on Windows) adds a layer of defense that limits what even privileged processes can do, reducing the impact of successful permission escalation.

How Privilege Escalation Fits Into Advanced Attack Chains

Privilege escalation is a pivotal step in nearly every sophisticated attack. It bridges initial access (a compromised user account, an exploited web vulnerability) and the attacker’s ultimate objective (data exfiltration, ransomware deployment, persistent backdoor installation).

A typical attack chain involving privilege escalation typically looks like this:

  1. Initial access: Attacker exploits a web application vulnerability or phishes a low-privilege user.
  2. Local enumeration: Attacker surveys the system for misconfigurations, writable files, scheduled tasks, and running services.
  3. Privilege escalation: Attacker exploits a kernel vulnerability, misconfigured service, or stolen credential to gain administrative access.
  4. Lateral movement: With elevated privileges, the attacker moves to other systems, accessing domain controllers, databases, or cloud management consoles.
  5. Objective execution: The attacker exfiltrates data, deploys ransomware, or establishes persistent access.

Organizations that understand how to detect and prevent application security vulnerabilities early in the development process reduce the number of exploitable entry points that lead to escalation chains.

Understanding where privilege escalation fits in these chains helps security teams prioritize defenses. Hardening the escalation step (patching kernels, enforcing least privilege, monitoring for anomalous privilege changes) can break the chain even when initial access succeeds.

FAQs

How do attackers typically chain privilege escalation with other vulnerabilities?

Attackers use an initial vulnerability (web exploit, phishing) to gain low-privilege access, then exploit system misconfigurations or kernel flaws to escalate privileges before moving laterally across the network.

Why is privilege escalation especially dangerous in cloud and containerized environments?

Container escapes and misconfigured IAM roles can grant attackers access to the underlying host or cloud control plane, turning a single container compromise into full infrastructure access.

What signals may indicate an attempted privilege escalation at runtime?

Unusual process spawning under privileged accounts, unexpected changes to user groups or permissions, new SUID binaries, and abnormal sudo usage patterns are common indicators of escalation attempts.

How does identity and access management impact privilege escalation risk?

Strong IAM practices (least privilege, role-based access, regular permission audits) reduce the number of exploitable escalation paths. Weak IAM creates unnecessary privileges that attackers can target.

Can least-privilege policies fully eliminate privilege escalation threats?

Least privilege significantly reduces risk but cannot eliminate it entirely. Kernel vulnerabilities and zero-day exploits can bypass access controls regardless of how tightly permissions are configured.

Back to glossary
See Apiiro in action
Meet with our team of application security experts and learn how Apiiro is transforming the way modern applications and software supply chains are secured. Supporting the world’s brightest application security and development teams: