How it works
Projects organize resources, billing and policies. They do not confine identities. Three properties of Google Cloud IAM let access cross a project line, and each is a route for lateral movement:
Inherited bindings. An allow policy attached to a folder or the organization applies to every descendant project in the resource hierarchy, and to the service accounts in those projects. roles/iam.serviceAccountTokenCreator on a folder means "may mint tokens for every service account under this folder". Read the hierarchy from the protected resource upwards: the project that hosts a caller says nothing about what the caller can reach.
Service accounts with roles elsewhere. A service account lives in one project and can be a principal in the allow policy of any other resource. Two policy directions matter and answer different questions: the policy on the service account says who may use it, and the policies that name it say what it may do. A build or automation account in a tooling project that holds Editor on many workload projects is a bridge to all of them for anyone who can act as it.
Deputies. Some services do work for a requester with their own authority: schedulers, deployment systems, shared platforms, internal automation. If such a service does not bind each requester to the target the requester is allowed to touch, a caller in one project can make it act on another project's resources. This is the confused deputy problem. Broad IAM rights on the deputy's service account raise the impact of the flaw, and a background job produces the same service account identity in the audit log as a request made on someone's behalf.
The roles behind the first two routes are distinct. roles/iam.serviceAccountTokenCreator contains iam.serviceAccounts.getAccessToken (and the sign and delegation permissions) and gives short-lived credentials directly. roles/iam.serviceAccountUser contains iam.serviceAccounts.actAs and lets the member attach the account to a resource such as a VM or a Cloud Run service, which then runs as it; that path is covered in actAs privilege escalation.
Prerequisites
- A foothold identity in one project: a user, a service account key, or a token taken from a workload.
- At least one crossing edge:
- an impersonation role on a service account in another project, granted on the account, on its project, or inherited from a folder or the organization (directly or through a group);
- control of a service account that holds roles on other projects;
- the ability to send requests to a deputy service that selects its target from caller input.
- No condition, deny policy or organization policy that blocks the edge at the time of use.
The vulnerable configuration is usually an old convenience: a folder-level Token Creator binding for an operations group, a single automation account reused across environments, or a default service account that kept the Editor role.
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 what the foothold can reach outside its project
# Projects the current identity can see at all
gcloud projects list
# Every binding in the organization that names the foothold identity
gcloud asset search-all-iam-policies \
--scope='organizations/123456789012' \
--query='policy:svc-app@project-a.iam.gserviceaccount.com'
# Everything the identity can access, with group membership expanded
gcloud asset analyze-iam-policy --organization=123456789012 \
--identity='serviceAccount:svc-app@project-a.iam.gserviceaccount.com' \
--expand-groups
If the identity cannot call Cloud Asset Inventory, per-project commands still work wherever it has read access. See Google Cloud IAM enumeration.
2. Find service accounts it can impersonate, including inherited rights
# Where does this identity hold the token permission
gcloud asset analyze-iam-policy --organization=123456789012 \
--identity='user:alice@corp.example.com' \
--permissions='iam.serviceAccounts.getAccessToken'
# Who can act as one specific service account
gcloud asset analyze-iam-policy --organization=123456789012 \
--full-resource-name='//iam.googleapis.com/projects/project-b/serviceAccounts/svc-data@project-b.iam.gserviceaccount.com' \
--permissions='iam.serviceAccounts.actAs'
# Policies of a target project and of every ancestor above it
gcloud projects get-ancestors-iam-policy project-b --format=json
# Policy on the service account itself
gcloud iam service-accounts get-iam-policy svc-data@project-b.iam.gserviceaccount.com
A binding for a group counts if the foothold is a member, directly or through nesting; see Google group membership privilege escalation.
3. Impersonate a service account in the other project
# An access token for the target account
gcloud auth print-access-token \
--impersonate-service-account=svc-data@project-b.iam.gserviceaccount.com
# Or run any command as it
gcloud projects get-iam-policy project-b \
--impersonate-service-account=svc-data@project-b.iam.gserviceaccount.com
The caller needs no role on project-b itself. The token is issued by the IAM Credentials API on the strength of the impersonation binding, and the receiving service checks only the service account's own roles. The mechanics are in service account impersonation.
4. Chain through several projects
Each service account reached this way is a new foothold: repeat steps 1 and 2 as that account. A chain of accounts can also be used in one request. The delegates field of generateAccessToken names the intermediate accounts, each of which must hold the Token Creator role on the next:
curl -s -X POST \
"https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/svc-admin@project-c.iam.gserviceaccount.com:generateAccessToken" \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H 'Content-Type: application/json' \
-d '{
"delegates": ["projects/-/serviceAccounts/svc-data@project-b.iam.gserviceaccount.com"],
"scope": ["https://www.googleapis.com/auth/cloud-platform"]
}'
5. Use a service account's own cross-project roles
If the foothold already is a service account with roles elsewhere, no impersonation is needed. The token it already has works against the other projects:
gcloud projects get-iam-policy project-b
gcloud iam service-accounts list --project=project-b
6. Drive a deputy
Where a shared service accepts a target (a project id, a bucket, a repository, a customer id) from the request and acts with its own service account, submit a request that names a resource in another project. The test is simple: compare the target the requester is authorized for with the target the service selected. If the service does not make that comparison, its service account's cross-project roles are available to every caller. The exact request depends on the service.
Impact
The compromise stops being about one project. The attacker reads data and changes resources in each project the chain reaches, and each new service account widens the map again. Chains commonly end at an automation or security tooling account with roles on a folder or the organization, at which point the attacker can write allow policies for the whole estate. A service account whose client id is authorized for domain-wide delegation extends the path out of Google Cloud and into Google Workspace user data.
OPSEC and artifacts
- Using existing bindings. Moving along bindings that already exist needs no policy write, so the Admin Activity log shows nothing new. Token issuance is a Data Access event of
iamcredentials.googleapis.comin the project that owns the service account, and it exists only where Data Access logging for that API was enabled. - Evidence split across projects. The policy that allows the move, the issuance and the use are recorded in up to three projects with different owners. An operator who impersonates an account in a project with weak logging and uses it in another leaves pieces that few teams join together.
- The service account takes the blame. The receiving service records the service account in
authenticationInfo.principalEmail. The original caller appears inserviceAccountDelegationInfoonly where the service fills it in. - Blending with workloads. High-volume workloads mint many tokens for the same account, so a token requested during normal activity is hard to separate by time alone. The caller identity,
requestMetadata.callerIpandcallerSuppliedUserAgentin the issuance entry still differ from the workload's. - Deputy requests look like service activity. The audit trail shows the deputy's service account acting on the target. Only the deputy's own request records tie the action to a requester, and a scheduler produces the same identity with no requester at all.
- Probing leaves denials. Trying projects and accounts until something works produces permission-denied entries, which the permission probing rules look for. Planning from Cloud Asset Inventory output avoids most of them.
- Credentials outlive the fix. Removing a binding does not invalidate access tokens that were already issued; they work until they expire.
Detection
Use separate detections for changes to authority, for credential issuance and for use at the receiver, and correlate them at the organization level.
Issuance. The service account impersonation rules read GenerateAccessToken and the related sign methods:
protoPayload.serviceName="iamcredentials.googleapis.com"
protoPayload.methodName=~"(^|\\.)GenerateAccessToken$"
The audit entry uses the short method name GenerateAccessToken; the suffix match also covers exports that carry the qualified RPC name. Compare the caller with the service account named in protoPayload.request.name and in resource.labels: a caller whose own project differs from the service account's project is a cross-project impersonation. Baseline the pairs that are normal and alert on new ones, on human users impersonating workload accounts, and on requests with a delegates list.
Authority. Policy writes that create crossing edges:
log_id("cloudaudit.googleapis.com/activity")
(protoPayload.serviceName="cloudresourcemanager.googleapis.com" OR
protoPayload.serviceName="iam.googleapis.com")
protoPayload.methodName=~"(^|\\.)(?i:SetIamPolicy)$"
The impersonation rights granted rules match Token Creator, Service Account User and Workload Identity User bindings; a grant of these on a folder or organization is the highest priority. The privileged role granted rules catch a service account from one project receiving a privileged role in another. A project or folder move changes inherited impersonation rights with no policy write. See the SetIAMPolicy source for the service account case and the actAs source for attachment.
Use. In the receiving project, look for a service account acting from an address or client that its workload does not use, and for the first activity of a service account in a project where it has never acted. Read serviceAccountDelegationInfo where present to recover the original caller.
Coverage decides what can be concluded. Admin Activity entries are kept in the _Required bucket for 400 days. Most Data Access logs are off by default and the _Default bucket keeps 30 days unless changed, so an empty search for issuance may mean no logging and not no activity.
Mitigation
- Grant impersonation on individual service accounts. Remove Token Creator, Service Account User and Workload Identity User bindings from folders, the organization and projects, and bind them on the specific accounts a workload needs.
- Keep service accounts in the project of the resources they use, and give each application its own account. Avoid one automation account with roles across environments; an over-permissioned service account is what turns one project into many.
- Review inherited grants whenever a project moves between folders or organizations.
- Enforce
iam.disableCrossProjectServiceAccountUsageso that a project's service accounts cannot be attached to resources in other projects, and stop the automatic Editor grant to default service accounts withiam.automaticIamGrantsForDefaultServiceAccounts. - Do not let users change the allow policy of a service account that has more privileges than they do.
- Fix deputies in code. Bind each requester to its permitted targets inside the service before it selects an outbound resource, record that decision with an identifier that can be matched to the receiver's audit log, and use separate service identities for separate customers or trust zones.
- Enable Data Access audit logs for the IAM and IAM Credentials APIs organization-wide, and route them to a central bucket with enough retention to cover an investigation.
- Review lateral movement paths regularly. Google's lateral movement insights list service accounts in one project that can impersonate accounts in another; Policy Analyzer answers the same question on demand.
Detection rules for this attack
Log events to collect
FAQ
Is a Google Cloud project a security boundary?
Only for the resources and policies defined inside it. Identities are not confined to their project: a service account created in one project can be granted roles on any other resource, and a role granted on a folder or organization applies to every project below. The effective boundary is the set of bindings, not the project.
How does an inherited Token Creator role enable cross-project movement?
The Service Account Token Creator role granted on a folder or organization applies to every service account in the projects underneath. A member of that binding can mint access tokens for any of those service accounts, including ones in projects the member has no other access to, and then act with each account's own roles.
Where is cross-project impersonation logged?
In three different places. The policy write is in the Admin Activity log of the resource that was administered. The GenerateAccessToken event is a Data Access event in the project that owns the service account. The resource use is in the audit log of the receiving project, under the service account's identity. No single project holds the whole chain.
References
- Valid Accounts: Cloud Accounts, T1078.004 (MITRE ATT&CK)
- Use Alternate Authentication Material: Application Access Token, T1550.001 (MITRE ATT&CK)
- Resource hierarchy (Google Cloud Resource Manager)
- Roles for service account authentication (Google Cloud)
- Example logs for service accounts (Google Cloud)
- Restricting service account usage: organization policy constraints (Google Cloud)
- gcloud asset analyze-iam-policy (Google Cloud SDK reference)
- The confused deputy problem (AWS IAM User Guide, concept)
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.