AWS Bedrock AgentCore Privilege Escalation via IAM Role Assumption
Attackers with iam:PassRole and Bedrock resource creation permissions can escalate privileges by creating AgentCore resources with attached high-privilege IAM roles.
AWS Bedrock AgentCore services, including code interpreters, agent runtimes, browser sessions, and harnesses, execute user-defined workloads within isolated MicroVM environments. A privilege escalation vector exists where an attacker possessing both iam:PassRole and bedrock-agentcore:Create* permissions can create these resources and explicitly attach a privileged IAM execution role. Once the resource is initialized, any code or session initiated within that environment assumes the identity of the attached role. This allows attackers to bypass their original permission boundaries, effectively inheriting the permissions of roles that trust bedrock-agentcore.amazonaws.com. Because standard CloudTrail management events do not capture the subsequent data-plane operations (e.g., code execution or session invocation), this activity often remains invisible to organizations that have not enabled specific data-plane logging.
Impact
Successful exploitation allows an attacker to escalate privileges to match the scope of an assigned IAM role. This can result in unauthorized access to sensitive data, modification of cloud infrastructure, or further lateral movement within an AWS environment. The technique affects organizations utilizing AWS Bedrock for AI/ML workloads where IAM roles are insufficiently scoped or where identity-based access controls are not strictly enforced on the provisioning of AgentCore resources.
Recommendation
- Enable data-plane logging for Bedrock AgentCore to ensure that post-creation session invocations are captured in logs.
- Implement strict IAM policies for
iam:PassRole, ensuring that callers are restricted usingiam:PassedToServiceconditions specifically limiting the roles that can be passed to Bedrock. - Audit all
CreateCodeInterpreter,CreateAgentRuntime,CreateBrowser, andCreateHarnessevents in CloudTrail to identify provisioning by non-standard users or roles. - Revoke
iam:PassRolepermissions from non-privileged identities and rotate credentials for any roles that may have been compromised through unauthorized resource association.
Immediate actions
Enable CloudTrail data-plane logging for Bedrock AgentCore services.
Threat Hunt
Audit existing Bedrock resources for attached IAM roles that exceed the principle of least privilege.
Data: AWS CloudTrail history
Mitigations
Restrict iam:PassRole permissions using IAM conditions limiting allowed target services and roles.
Privilege Escalation via PassRole
Detection coverage 1
Detect AWS Bedrock AgentCore Resource Creation with IAM Role
mediumDetects the creation of Bedrock AgentCore resources with an IAM role attached, which may indicate an attempt to escalate privileges via resource identity assumption.
Detection queries are available on the platform. Get full rules →