Skip to main content
MediumContentOWASP A05:2021CWE-200

How to fix: AWS S3 Bucket Reference Exposed

An S3 object URL in the page source points at something that looks like it was never meant to be published: a backup, a database dump, a .env or .sql file, a credentials or private-key path. Ordinary asset hosting from S3 (images, downloads, a public config file) is not reported.

Why it matters

S3 buckets may be publicly accessible or misconfigured.

Exposed bucket names can be tested for misconfigured permissions. Only the sensitive-looking object paths are reported, and each keyword has to be a whole path segment or a real file extension rather than a substring, so /assets/config.json and private-beta-invite.png do not count.

How to fix it

  1. 1Use CloudFront or a CDN in front of S3 buckets.
  2. 2Ensure proper bucket policies.

Code examples

Block public access to S3 buckets

bash
# Enable Block Public Access on the bucket
aws s3api put-public-access-block \
  --bucket your-bucket-name \
  --public-access-block-configuration \
    BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true

# Remove any bucket policies that grant public read
aws s3api delete-bucket-policy --bucket your-bucket-name

References

Detected automatically by VulnRadar. The check id is s3-bucket-exposed, stable across every scan so you can filter or diff on it.

See every content check

Questions

How severe is AWS S3 Bucket Reference Exposed?
VulnRadar rates this medium severity in the content category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id s3-bucket-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does AWS S3 Bucket Reference Exposed map to?
It maps to CWE-200. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for aws s3 bucket reference exposed

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: AWS S3 Bucket Reference Exposed | VulnRadar