To fix an S3 Access Denied (403 Forbidden) error, first read the full error message: for requests within the same AWS account or organization, S3 now says which policy type denied you (identity-based, bucket policy, SCP, RCP, permissions boundary, VPC endpoint) and, for explicit denies, the ARN of that policy. If the message is the bare "Access Denied", work through the layers in order: who is calling, identity policy, bucket policy, Block Public Access, Object Ownership and ACLs, KMS keys, Organizations policies, VPC endpoint policy, and request details such as presigned URL expiry, clock skew and Requester Pays. The decision tree below runs those checks with the AWS CLI and CloudTrail.
Everything here is based on the AWS S3 403 troubleshooting guide and IAM documentation as of December 2026, plus error responses I reproduced against a public S3 bucket while writing this.
Step 0: S3 access denied messages now tell you a lot
Since AWS added enhanced access denied messages, most same-account and same-organization 403s look like this:
An error occurred (AccessDenied) when calling the GetObject operation:
User: arn:aws:iam::123456789012:user/MaryMajor is not authorized to perform:
s3:GetObject on resource: "arn:aws:s3:::amzn-s3-demo-bucket1/object-name"
with an explicit deny in a service control policy, with policy ARN:
arn:aws:organizations::123456789012:policy/o-exampleorgid/service_control_policy/p-examplepolicyid
Learn to read the last clause, because it routes you to the right branch immediately:
| Message ends with | Meaning | Go to |
|---|---|---|
because no identity-based policy allows the s3:X action |
Implicit deny: your IAM user/role policy is missing an Allow | Branch 2 |
with an explicit deny in an identity-based policy (+ ARN) |
A Deny in your own IAM policy | Branch 2 |
... in a resource-based policy |
Bucket policy (or access point policy) | Branch 3 |
... in a service control policy (+ ARN) |
SCP in AWS Organizations | Branch 7 |
... in a resource control policy (+ ARN) |
RCP in AWS Organizations | Branch 7 |
because no permissions boundary allows |
Permissions boundary on the role/user | Branch 2 |
... in a session policy |
Policy passed when the session was created | Branch 2 |
... VPC endpoint policy |
Gateway or interface endpoint policy | Branch 8 |
because public ACLs are prevented by the BlockPublicAcls setting |
Block Public Access | Branch 4 |
this bucket has blocked upload requests that specify Server Side Encryption with Customer provided keys |
SSE-C blocked on bucket | Branch 5 |
Four limits on those messages, all from the AWS docs:
- Cross-organization requests get the generic "Access Denied". If the bucket is in another company's account, you are troubleshooting blind and need their help.
- Directory buckets (S3 Express One Zone) always return the generic message.
- VPC endpoint denials may not include the enhanced context even within one organization, although AWS also documents VPC endpoint variants of the message. Do not rule out the endpoint because the message does not mention it.
- Only one reason is reported. If two policy types both deny, you see one. Fix it, retry, and expect possibly a second, different message.
The same context appears in CloudTrail's errorMessage field, which is how you diagnose 403s that only your application saw.
The S3 access denied decision tree
Work top to bottom; each branch either finds the cause or sends you to the next. Set a few variables first:
BUCKET=amzn-s3-demo-bucket
KEY=reports/2026-11.csv
ACCOUNT=$(aws sts get-caller-identity --query Account --output text)
Branch 1: are you who you think you are?
A surprising share of 403s are the wrong credentials: a stale AWS_PROFILE, environment variables overriding the instance role, or a container picking up the node role instead of its pod role.
aws sts get-caller-identity
env | grep -E '^AWS_(PROFILE|ACCESS_KEY_ID|SESSION_TOKEN|ROLE_ARN|WEB_IDENTITY)'
Compare the Arn to the principal you granted access to. If you see assumed-role/SomethingElse, stop here and fix the credential chain. If the request is unsigned (a browser hitting a plain object URL), there is no principal at all; S3 treats it as anonymous, and only a public bucket policy or ACL can allow it.
Also confirm the object exists. S3's GetObject reference is explicit: if the key does not exist and you lack s3:ListBucket on the bucket, S3 returns 403 Access Denied, not 404. A typo in the key looks exactly like a permissions problem.
aws s3api list-objects-v2 --bucket "$BUCKET" --prefix "$KEY" --max-items 1
Branch 2: identity-based policy, boundary and session policy
The IAM policy simulator evaluates identity-based policies and SCPs for a principal without making the call:
aws iam simulate-principal-policy \
--policy-source-arn arn:aws:iam::$ACCOUNT:role/app-role \
--action-names s3:GetObject s3:ListBucket \
--resource-arns "arn:aws:s3:::$BUCKET/$KEY" "arn:aws:s3:::$BUCKET" \
--query 'EvaluationResults[].{action:EvalActionName,resource:EvalResourceName,decision:EvalDecision,matched:MatchedStatements[].SourcePolicyId}'
EvalDecision is allowed, explicitDeny or implicitDeny, and MatchedStatements names the policy. Three facts from the CLI reference decide how far you can trust it:
- It includes SCPs, but it does not know about RCPs, VPC endpoint policies, Block Public Access or KMS key policies.
--resource-policy(to include a bucket policy) is supported for IAM users only. For roles, the simulator cannot evaluate the bucket policy at all.- If a policy has conditions (
aws:SourceVpce,aws:SecureTransport,s3:prefix), supply them with--context-entries, or the simulator evaluates them as missing and may report a deny that does not happen in real life, or vice versa.
The most common identity-policy mistakes I see:
| Mistake | Symptom | Fix |
|---|---|---|
s3:ListBucket granted on arn:aws:s3:::bucket/* |
ListObjectsV2 denied |
ListBucket applies to the bucket ARN, without /* |
s3:GetObject granted on arn:aws:s3:::bucket |
GetObject denied |
Object actions need arn:aws:s3:::bucket/* |
s3:prefix condition on GetObject |
Every get denied | s3:prefix only exists on list requests |
| Permissions boundary without S3 | Implicit deny though the role policy allows | The boundary must also allow the action |
Session policy passed at AssumeRole |
Same as above | The effective permission is the intersection |
For a copy (CopyObject or aws s3 cp s3://a s3://b), you need s3:GetObject on the source and s3:PutObject on the destination. The 403 does not always say which side failed.
Branch 3: bucket policy explicit deny
Get the bucket policy and pretty-print it (the JSON formatter helps when it arrives as one escaped string):
aws s3api get-bucket-policy --bucket "$BUCKET" --query Policy --output text | jq .
aws s3api get-bucket-policy-status --bucket "$BUCKET"
Within one account, an IAM Allow is enough if there is no bucket policy Deny. So look for "Effect": "Deny" statements and read their conditions, because guardrails written as denies are the usual culprit:
aws:SecureTransport=false: blocks any plain HTTP request, including old SDK endpoints configured withhttp://.aws:SourceVpceoraws:SourceIp: blocks requests from anywhere but one endpoint or CIDR. Note that a request through a VPC endpoint carriesaws:SourceVpceand no publicaws:SourceIp, so an IP allowlist breaks when you add an endpoint.s3:x-amz-server-side-encryptionwithStringNotEquals: blocks uploads that do not send the required encryption header.aws:PrincipalOrgIDwithStringNotEquals: blocks any caller outside your organization, including AWS services that do not act as your principal.
If someone wrote a Deny that locks everyone out, including you, the account root user can still delete the bucket policy. For AWS Organizations member accounts without root credentials, the docs describe using a privileged root session from the management account to delete it.
Branch 4: Block Public Access
Block Public Access (BPA) applies at the account, bucket and access point level, and the most restrictive wins. All four settings have been on by default for new buckets since April 2023.
aws s3api get-public-access-block --bucket "$BUCKET"
aws s3control get-public-access-block --account-id "$ACCOUNT"
BPA causes 403s in three situations: anonymous reads of objects you intended to be public (RestrictPublicBuckets or IgnorePublicAcls), uploads that include a public ACL such as --acl public-read (BlockPublicAcls), and PutBucketPolicy with a policy S3 considers public (BlockPublicPolicy). If your goal is a public website, do not turn BPA off; put CloudFront in front with Origin Access Control and keep the bucket private.
Branch 5: Object Ownership, ACLs and SSE-C
aws s3api get-bucket-ownership-controls --bucket "$BUCKET"
If the result is BucketOwnerEnforced (the default for new buckets), ACLs are disabled and cannot be the cause. If it is ObjectWriter or BucketOwnerPreferred, objects uploaded by another account can still be owned by that account, and the bucket policy does not control access to objects the bucket owner does not own. This is the classic "cross-account upload, now I can't read my own bucket" problem.
aws s3api get-object-acl --bucket "$BUCKET" --key "$KEY" --query 'Owner'
If the owner is not your account, either have the uploader grant you access through the object ACL, re-copy the object as the bucket owner, or switch the bucket to BucketOwnerEnforced (which makes the bucket owner own every object going forward and existing ones too). Also check default encryption, because S3 can now block SSE-C writes per bucket, and a PutObject that sends SSE-C headers to such a bucket returns 403:
aws s3api get-bucket-encryption --bucket "$BUCKET"
Branch 6: SSE-KMS key policy
If the object is encrypted with a customer managed KMS key, S3 permissions are not enough. Downloads and multipart uploads need kms:Decrypt; uploads need kms:GenerateDataKey. Find the key:
aws s3api head-object --bucket "$BUCKET" --key "$KEY" \
--query '{sse:ServerSideEncryption,key:SSEKMSKeyId,bucketKey:BucketKeyEnabled}'
aws kms get-key-policy --key-id <key-arn> --policy-name default --output text | jq .
The pattern that catches people: ListObjectsV2 works, but GetObject fails. Listing never touches object data, so the S3 policy can be fine while KMS is not, and the 403 on the download is the key policy talking. Two rules from the AWS docs settle most KMS cases:
- With the AWS managed key
aws/s3, the requester must be in the same account as the key. You cannot shareaws/s3-encrypted objects cross-account; re-encrypt with a customer managed key. - With a customer managed key used cross-account, both sides must allow it: the key policy in the owner's account must allow the caller, and the caller's IAM policy must allow
kms:Decrypton that key ARN.
Branch 7: SCPs and RCPs
If you are in AWS Organizations and the message names a service control policy or resource control policy, it includes the policy ARN. Without the message, list what applies:
aws organizations list-policies-for-target --target-id "$ACCOUNT" --filter SERVICE_CONTROL_POLICY
aws organizations list-policies-for-target --target-id "$ACCOUNT" --filter RESOURCE_CONTROL_POLICY
aws organizations describe-policy --policy-id p-examplepolicyid --query Policy.Content --output text | jq .
These calls need Organizations read access, usually from the management or delegated administrator account. Policies attached to parent OUs and the root also apply, so check those targets too. The difference matters: an SCP limits what your principals can do anywhere; an RCP limits what anyone can do to your resources. A 403 on your bucket from a partner's role, with nothing wrong in the bucket policy, is often an RCP data perimeter doing its job. RCP and SCP denials usually come from region locks, aws:PrincipalOrgID perimeters or required-encryption rules.
Branch 8: VPC endpoint policy
Requests from private subnets often reach S3 through a gateway endpoint. Its policy is a third gate that the simulator never sees.
aws ec2 describe-vpc-endpoints \
--filters Name=service-name,Values=com.amazonaws.us-east-1.s3 \
--query 'VpcEndpoints[].{id:VpcEndpointId,vpc:VpcId,policy:PolicyDocument}'
A common failure: the platform team scoped the endpoint policy to a list of company buckets, and your new bucket, or a public dataset bucket, or an AWS-owned bucket such as the one that serves Amazon Linux package repositories, is not on it. The request works from your laptop and fails from inside the VPC. That location dependence is itself the diagnostic.
Branch 9: request-level causes
If policies all look right, look at the request itself. I reproduced each of these against a public bucket while writing this guide.
Presigned URL expired. An expired URL returns 403 with a specific body:
<Error><Code>AccessDenied</Code><Message>Request has expired</Message>
<X-Amz-Expires>1</X-Amz-Expires><Expires>2026-12-02T02:59:26Z</Expires>
<ServerTime>2026-12-02T02:59:28Z</ServerTime>...</Error>
Per the presigned URL docs, SigV4 URLs can last at most 7 days, and a URL signed with temporary credentials dies when those credentials expire, whatever --expires-in says. A URL signed by a Lambda function or an ECS task role often stops working within hours, because the role session ends. The URL's permissions are also exactly those of the signer at request time, so a URL signed by a role that later lost s3:GetObject fails too.
Clock skew. A SigV4 request whose timestamp is more than 15 minutes off S3's clock fails with 403:
<Error><Code>RequestTimeTooSkewed</Code><Message>The difference between the request
time and the current time is too large.</Message>
<MaxAllowedSkewMilliseconds>900000</MaxAllowedSkewMilliseconds>...</Error>
This shows up on containers and VMs with broken NTP, and on laptops resumed from sleep. Fix time sync, not permissions.
Bad or deleted access key. InvalidAccessKeyId ("The AWS Access Key Id you provided does not exist in our records") is also returned with HTTP 403. Rotated keys still sitting in a CI secret are the usual cause.
Requester Pays. If the bucket has Requester Pays enabled, requests from other accounts must declare that they will pay, or they get 403:
aws s3api get-bucket-request-payment --bucket "$BUCKET"
aws s3 cp "s3://$BUCKET/$KEY" . --request-payer requester
In SDKs, set the x-amz-request-payer: requester header (boto3: RequestPayer='requester'). An Athena workgroup that reads such buckets needs its own Requester Pays setting turned on.
Object Lock. A versioned DELETE on an object under a compliance-mode retention or legal hold returns 403, even for the root user. Governance mode can be bypassed only with s3:BypassGovernanceRetention and the bypass header.
Branch 10: cross-account access
Cross-account access needs both sides to say yes: the caller's identity policy must allow the action on the bucket ARN, and the bucket policy must allow the caller's principal. Then layer on Object Ownership (Branch 5) and KMS (Branch 6), which are the two cross-account-specific traps. And because enhanced messages are not returned across organizations, the caller sees only "Access Denied"; the bucket owner's CloudTrail is where the useful detail lives.
A minimal working bucket-policy statement for a role in another account:
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "PartnerRead",
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::444455556666:role/partner-reader" },
"Action": ["s3:GetObject"],
"Resource": "arn:aws:s3:::amzn-s3-demo-bucket/shared/*"
}, {
"Sid": "PartnerList",
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::444455556666:role/partner-reader" },
"Action": ["s3:ListBucket"],
"Resource": "arn:aws:s3:::amzn-s3-demo-bucket",
"Condition": { "StringLike": { "s3:prefix": ["shared/*"] } }
}]
}
If you deploy roles to partners through CI, our walkthrough on GitHub Actions OIDC for AWS covers the trust-policy side.
Finding S3 403s in CloudTrail
Object-level calls (GetObject, PutObject) are CloudTrail data events. They do not appear in Event history and are only recorded if a trail or event data store logs S3 data events. Bucket-level calls (PutBucketPolicy, GetBucketPolicy) are management events and do show up in Event history.
With data events flowing to CloudWatch Logs, this Logs Insights query lists recent S3 denials with the reason text:
fields eventTime, userIdentity.arn, eventName, requestParameters.bucketName, requestParameters.key, errorMessage
| filter eventSource = "s3.amazonaws.com" and errorCode = "AccessDenied"
| sort eventTime desc
| limit 50
The errorMessage field carries the same enhanced context as the API error. For the bucket owner in a cross-org case, this is the only place to see which statement denied the caller. When the 403 came from a presigned URL, the event has additionalEventData.AuthenticationMethod = QueryString and requestParameters.X-Amz-Expires, which identifies the request as presigned and shows the lifetime the signer chose.
A quick reference checklist
| Check | Command | Rules out |
|---|---|---|
| Caller identity | aws sts get-caller-identity |
Wrong credentials |
| Object exists | aws s3api list-objects-v2 --prefix |
403-instead-of-404 |
| Identity policy | aws iam simulate-principal-policy |
Missing Allow, boundaries, SCPs |
| Bucket policy | aws s3api get-bucket-policy |
Explicit denies |
| BPA | aws s3api get-public-access-block |
Public access blocked |
| Ownership | aws s3api get-bucket-ownership-controls |
Cross-account object owner |
| KMS | aws s3api head-object then aws kms get-key-policy |
Missing kms:Decrypt |
| Orgs | aws organizations list-policies-for-target |
SCP and RCP denies |
| Endpoint | aws ec2 describe-vpc-endpoints |
Endpoint policy scope |
| Request | Error body: Request has expired, RequestTimeTooSkewed |
Expiry, clock |
Testing all of this against real AWS is slow; for repeatable policy tests, an emulator helps, and our AWS emulator tutorial covers that setup (emulators do not reproduce every IAM nuance, so confirm in a sandbox account). If you are building on S3 Vectors, the same bucket-policy rules apply, as shown in our S3 Vectors tutorial.
Frequently Asked Questions
Why does S3 return 403 instead of 404 for a missing object?
Because you lack s3:ListBucket on the bucket. S3 only tells callers whether a key exists if they are allowed to list the bucket; otherwise a missing key returns 403 Access Denied, so it does not leak which keys exist. Grant s3:ListBucket on the bucket ARN and the same request returns 404.
Why do I get S3 access denied even though my IAM policy allows s3:GetObject?
Something else is denying or not allowing: a bucket policy Deny, an SCP or RCP, a permissions boundary, a VPC endpoint policy, a KMS key policy, or object ownership by another account. Read the full error message; within one organization it names the policy type. If the object uses SSE-KMS, check kms:Decrypt first.
Why did my presigned URL stop working before it expired?
A presigned URL is only valid while the credentials that signed it are valid. URLs signed with role credentials from Lambda, ECS, EC2 instance profiles or AssumeRole die when that session ends, often within an hour. Sign with a role session long enough for your use case and keep the expiry under the session lifetime.
How do I fix S3 403 Access Denied for a cross-account bucket?
Allow the action in both places: the caller's IAM policy and the bucket owner's bucket policy. Then check that the bucket uses BucketOwnerEnforced object ownership, that objects are not encrypted with the aws/s3 managed key, and that any customer managed KMS key policy allows the caller. Cross-organization callers only see generic messages, so ask the owner to check CloudTrail.
Does the IAM policy simulator check S3 bucket policies?
Only when simulating an IAM user and passing the bucket policy with --resource-policy. For roles, it evaluates identity-based policies and SCPs but not the bucket policy. It never evaluates RCPs, VPC endpoint policies, Block Public Access or KMS key policies, so a simulator "allowed" result does not prove the real request will succeed.
Conclusion
Most S3 access denied errors are solved by reading the whole error message: within one organization it names the policy type and, for explicit denies, the exact policy ARN. When it does not, walk the layers in a fixed order: identity, IAM policy, bucket policy, Block Public Access, ownership, KMS, Organizations, VPC endpoint, and then the request itself. Keep S3 data events in CloudTrail so the errorMessage is there when you need it, and treat "works from my laptop, fails in the VPC" or "worked for an hour, then stopped" as clues pointing straight at the endpoint policy or credential expiry.