Cloud concept · Updated

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.

In short

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.

Cloud Concepts Hub →

6 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.

01
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.

02
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.

03
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.

04
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.

05
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.

06
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 S3Amazon 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.

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.

AWS CloudTrailAWS 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.

Confused Deputy Problem exam questions

Real practice exam questions on Confused Deputy Problem, with the correct answer and its explanation. Answer them with every option in the exam simulator.

DVA-C02

A SaaS provider runs a multi-tenant cost-analysis application. Each customer's AWS account contains an IAM role that trusts only the provider's application role and requires a distinct, provider-generated sts:ExternalId value. The application calls AWS STS AssumeRole using a role ARN and external ID supplied in each tenant's API request.

During a security test, a tenant submits another customer's role ARN and external ID, copied from that customer's onboarding documentation. The application successfully assumes the other customer's role. No AWS credentials have been stolen.

Which application change will prevent this unauthorized access while retaining the shared application role and unattended cross-account access?

Show answerCORRECT ANSWER

Look up the approved role ARN and assigned external ID from a server-side mapping keyed by the authenticated tenant, and do not allow the request to override those values.

The provider must bind each authenticated tenant to its own delegation context. Selecting both values from a trusted tenant mapping prevents a tenant from inducing the shared application role to assume another customer's role, even when that customer's ARN and external ID are known.

SAP-C03

A financial services company uses a multitenant SaaS provider to inventory resources in its AWS accounts. Each customer creates an inventory role that trusts the same IAM worker role in the provider's AWS account. The inventory roles grant only the read permissions required by the service. The provider uses AWS STS AssumeRole to obtain temporary credentials.

During a penetration test, a tester signs in to the provider as a different customer and submits the financial services company's inventory role ARN as a scan target. The provider successfully assumes that role and returns the company's inventory to the tester. No AWS credentials were stolen, and the provider's worker role was not compromised.

The provider can change its application and onboarding process. It must retain the shared worker role and unattended scanning. Customer role ARNs must not be treated as secrets.

Which solution will prevent this attack while preserving legitimate scans?

Show answerCORRECT ANSWER

Assign each customer a distinct provider-generated external ID and store it against the authenticated customer in the provider's backend. Require that value through sts:ExternalId in the customer's inventory role trust policy, alongside the existing worker-role principal. Have the backend supply only the authenticated customer's stored value when assuming a role.

This binds the provider's delegated access to the intended customer. A request made by another customer carries that other customer's external ID and fails the victim role's trust-policy condition. The backend must control the customer-to-ID association; an external ID is not a secret and must not simply be accepted from the scan request.

SAA-C03

A company delivers logs from an AWS CloudTrail trail named SecurityAudit to an Amazon S3 bucket. The bucket policy allows the cloudtrail.amazonaws.com service principal to perform s3:PutObject under the audit/ prefix, provided the objects use the bucket-owner-full-control ACL. The policy does not restrict which trail initiates delivery.

A security review finds that another customer could configure CloudTrail to deliver unwanted logs to this bucket by specifying its name. The company must allow delivery only from SecurityAudit, including rejecting delivery from other trails in the company's own account. The existing destination prefix and ACL requirement must remain unchanged.

Which change should a solutions architect make to the bucket policy's existing Allow statement?

Show answerCORRECT ANSWER

Add a StringEquals condition requiring aws:SourceArn to equal the full ARN of the SecurityAudit trail.

CloudTrail supplies the originating trail ARN in aws:SourceArn when delivering logs. Requiring the exact SecurityAudit trail ARN binds the service's permission to that trail, preventing other customers' trails and other trails in the company's account from using this permission.

Practice Confused Deputy Problem in a full exam

Questions on Confused Deputy Problem in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Confused Deputy Problem

3 min read

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.

Learn Confused Deputy Problem in lessons

3 short lessons on Confused Deputy Problem in 3 certification courses.

Open the lessons