Course contentsShow
← Security
Lesson 1757 of 3,05235. Cloud Security - IAMFree lesson

Service-Specific Escalation Vectors

Cloud service-specific privilege escalation paths through Lambda, EC2 instance profiles, and other compute services.

Service-Specific Escalation Vectors

What you'll learn: How attackers exploit individual cloud services like Lambda functions and EC2 instances to escalate their privileges beyond their initial IAM permissions.


The Core Idea

While generic IAM privilege escalation focuses on manipulating policies and roles directly, service-specific escalation exploits the unique capabilities of individual cloud services. Each service—Lambda, EC2, ECS, Glue, etc.—has its own way of executing code or assuming roles, and each presents unique pathways for an attacker to gain higher privileges.

Think of it like different doors in a building: instead of picking the lock on the main entrance (direct IAM manipulation), an attacker finds a service window left open—a Lambda function they can modify, or an EC2 instance profile they can leverage.


Common Service-Specific Vectors

Lambda Functions: If you have lambda:UpdateFunctionCode permission on a function with a privileged role, you can inject malicious code that executes with that function's elevated permissions. The Lambda's execution role becomes your privilege level.

EC2 Instance Profiles: With permissions like iam:PassRole + ec2:RunInstances, you can launch an EC2 instance with a highly privileged instance profile attached. You then SSH into that instance and extract temporary credentials from the metadata service—instant privilege escalation.

Other Services:

  • ECS/Fargate: Similar to EC2, but with container task roles
  • CodeBuild: Inject malicious build scripts that execute with the project's service role
  • Glue: Modify ETL jobs to execute arbitrary code with Glue's IAM role

Why This Matters

Defenders often focus on direct IAM permissions but overlook that services act as privilege amplifiers. An attacker with seemingly limited permissions can "borrow" a service's elevated role by controlling what that service executes.

Key Takeaway: Service-specific escalation turns compute and automation services into privilege laundering mechanisms—attackers execute code through services that have the permissions they lack directly.