Amazon S3 Bucket Publicly Accessible

An Amazon S3 bucket's policy or access control lists let anyone on the internet, or any AWS account, list or read its objects.

SeverityHigh
CVSS 3.17.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N Open in the calculator
CVSS 4.08.7 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-552: Files or Directories Accessible to External Parties
OWASP Top 10A01:2025 Broken Access Control
MITRE ATT&CKT1530 Data from Cloud Storage, T1619 Cloud Storage Object Discovery
CategoryBroken Access Control

Description

One or more Amazon S3 buckets grant access to the public. A bucket policy statement with "Principal": "*" and no restricting condition, or an access control list (ACL) grant to the predefined AllUsers or AuthenticatedUsers groups, allows requests that are not made by an identity in the bucket owner's account. The AuthenticatedUsers group is often misunderstood: it means anyone signed in to any AWS account, not users of the owner's account. Where S3 Block Public Access is enabled on the bucket or the account, such grants are blocked or ignored, so a public bucket also has those settings switched off.

Anyone who finds the bucket can download its contents, and bucket names are often predictable from the organisation's name, domains or application code and are routinely discovered by automated scanning, so a public bucket should be assumed to have been found. Exposure may be limited to reading known objects (s3:GetObject), may include listing the bucket's contents (s3:ListBucket), or may extend to writing, overwriting or deleting objects, or to reading and changing the bucket's ACL. The effect depends on what the bucket holds: backups, database exports, logs, documents and personal data lead to a data breach, and configuration files or credentials can give access to other systems. Where write access is also granted, an attacker can alter or replace objects, such as scripts or files served to a website's visitors, or delete data.

The issue is confirmed by requesting the bucket and its objects without credentials, for example with the AWS CLI's --no-sign-request option, or with credentials from an unrelated AWS account. IAM Access Analyzer for S3, the AWS Config managed rules s3-bucket-public-read-prohibited and s3-bucket-public-write-prohibited, Security Hub, Prowler and ScoutSuite all report such buckets. Since April 2023 new buckets have Block Public Access enabled and ACLs disabled by default, but buckets created earlier, and buckets whose settings were later changed, are still commonly found with public grants.

Remediation

Remove public access from every bucket that is not intended to serve public content:

  • Remove bucket policy statements that grant access to "Principal": "*" without a restricting condition, and grant access instead to named IAM principals or, for other accounts, to specific account or role ARNs.
  • Disable ACLs by setting S3 Object Ownership to Bucket owner enforced, after moving any access that still depends on ACLs into the bucket policy and resetting the bucket ACL to the default private ACL. Once ACLs are disabled, AllUsers and AuthenticatedUsers grants no longer have any effect.
  • Enable all four S3 Block Public Access settings on the bucket, and at account level so that every bucket is covered.
  • Where content must be public, such as website assets, keep only that content in a dedicated bucket and serve it through Amazon CloudFront with origin access control rather than from a public bucket.
  • Where files must be shared with specific people, use presigned URLs with a short expiry instead of public grants.

Treat any data that was publicly readable as disclosed: review S3 server access logs or CloudTrail data events, where enabled, for unauthenticated requests, rotate any credentials found in the bucket, and assess whether breach notification is required. Confirm the fix by repeating unauthenticated requests to the bucket and its objects, which should be refused, and by checking that IAM Access Analyzer reports no remaining public or unintended cross-account access.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More AWS Findings

Every AWS finding