CLOUD CONCEPT

Confused Deputy Problem

The confused deputy problem occurs when a privileged intermediary is tricked into using its authority on behalf of a caller who is not entitled to the requested access.

Cloud Concepts Hub →

What is Confused Deputy Problem

A service or application can authenticate a request correctly yet misuse its own permissions because it fails to verify whose authority the request should exercise. Cloud defenses bind delegated access to the intended customer, source resource, and operation rather than trusting the intermediary’s identity alone.

The confused deputy problem involves three parties: a caller, a privileged intermediary called the deputy, and a protected resource. The deputy legitimately has access to the resource, but the caller induces it to perform an action the caller should not be allowed to cause. The underlying failure is a missing connection between the caller’s authority and the deputy’s use of its own authority. This is an authorization problem, not necessarily credential theft or failed authentication.

Consider a monitoring provider that assumes IAM roles in many customers’ AWS accounts. A customer creates a role that trusts the provider’s AWS principal. If the provider accepts an arbitrary role ARN from its users without correctly binding that role to the requesting customer, an attacker might submit another customer’s role ARN. The provider could then assume the victim’s role using its legitimate identity. Knowing the ARN does not itself grant access; the vulnerability is the provider’s ability to exercise trusted access for the wrong customer.

For this third-party cross-account pattern, require a provider-generated external ID in the role trust policy using the sts:ExternalId condition key. The provider assigns a distinct external ID to each customer and supplies the appropriate value when calling AssumeRole. Its application must maintain the customer-to-external-ID association rather than allowing customers to impersonate another customer’s association. An external ID is not a password and need not be secret. It supplements, rather than replaces, a narrowly specified trusted principal and least-privilege role permissions.

A related pattern occurs when an AWS service accesses a resource on a customer’s behalf. Trusting only a service principal may allow requests associated with unintended accounts or resources. Where the integration supports them, use aws:SourceArn and aws:SourceAccount conditions to constrain the originating resource and its owning account. For example, an S3 bucket policy granting CloudTrail permission to deliver logs can restrict aws:SourceArn to the intended trail ARN. The source ARN identifies the originating resource, not the destination bucket. Condition-key availability and supported policy locations vary by integration, so do not assume every service request supplies every source key.

Role trust policies and permission policies solve different parts of the problem. The trust policy controls who can obtain a role session and under what conditions; the role’s permission policies constrain what that session can do. Resource policies constrain access at the destination. Broad permissions amplify the consequences of a confused deputy, but least privilege alone does not establish that a request belongs to the correct tenant. Similarly, IAM paths organize identities and can support explicit ARN-based policy scoping, but a path is not an independent security boundary.

Application-level authorization must preserve the same binding. A multitenant API can use Amazon Verified Permissions to evaluate whether an authenticated user may perform an action on a particular tenant’s resource. The application must derive trusted identity and tenant context, enforce the decision before exercising its backend role, and avoid trusting caller-supplied ownership claims. For external workloads using IAM Roles Anywhere, restrict role trust to intended trust anchors and appropriate certificate attributes. Possessing a valid certificate does not automatically establish authorization for every workload or tenant.

The main trade-off is precision versus operational flexibility. Exact source-resource restrictions provide strong isolation but require updates when resources are replaced; account-wide restrictions are easier to maintain but permit a wider set of sources. Missing condition keys can also break legitimate integrations. Test both valid and adversarial requests, including another tenant’s role ARN, an incorrect external ID, and an unexpected source resource. Authentication controls such as MFA, short-lived credentials, and certificate validation remain valuable, but none independently prevents a deputy from misusing legitimately acquired authority.

Key aspects of Confused Deputy Problem

Preventing a confused deputy requires binding privileged actions to the intended caller and source context, then enforcing narrowly scoped access at each delegation boundary.

Authority bound to the requesting party

A deputy must verify that the caller is entitled to cause the requested action, not merely that the deputy can perform it. Preserve authenticated user, workload, and tenant context across delegation boundaries.

Customer-specific delegation context

Third-party role assumption can require a customer-specific external ID alongside a restricted trusted principal. The provider must control the mapping between its customers and the external IDs it sends.

Source-constrained service access

Where supported, restrict service-principal access using the originating resource ARN and account. Confirm which condition keys the integration actually supplies before deploying the policy.

Separate trust from permissions

Control both who can assume a role and what the resulting session can access. Destination resource policies add another enforcement point but do not replace correct delegation checks.

Trusted application authorization context

Evaluate application actions against authenticated identities and verified resource ownership. A policy decision cannot protect tenant isolation if the application supplies attacker-controlled identity or ownership context.

Adversarial validation

Test requests that are authenticated but belong to the wrong customer, account, or source resource. Verify that those requests fail while legitimate delegation continues to work.

Cloud services for Confused Deputy Problem

IAM defines the trust and permission boundaries, while STS issues role credentials after the applicable checks succeed. S3 resource policies constrain destination access, including CloudTrail delivery from an intended trail. IAM Roles Anywhere extends role-based access to certificate-authenticated external workloads, whose trust must still be scoped appropriately. Verified Permissions addresses the application layer by evaluating whether a user or workload may perform a particular action on a resource. CloudTrail supplies audit evidence for investigation. Together, these services support layered controls, but the central requirement remains correct binding between the initiating party and every privileged action performed on its behalf.

Amazon Simple Storage Service image Amazon S3

S3 bucket policies can constrain service access using supported source conditions. For CloudTrail log delivery, restricting aws:SourceArn to the intended trail helps prevent an otherwise trusted service from writing on behalf of an unintended source.

Open Amazon S3 →
Amazon Verified Permissions

Verified Permissions evaluates application authorization policies over principals, actions, and resources. Applications can use those decisions to prevent a privileged backend from acting across tenant boundaries, provided they supply trustworthy context and enforce the result.

Open Amazon Verified Permissions →
AWS CloudTrail image AWS CloudTrail

CloudTrail is a practical example of a service whose log-delivery access should be scoped to the intended source trail. Its audit records also support investigation of role assumption and subsequent activity, although logging itself does not prevent misuse.

Open AWS CloudTrail →