Open Storage Buckets: S3, Google Cloud Storage and Azure Blob Mistakes

A storage bucket that lists its files to anyone is a quiet, common leak. See how it happens on S3, Google Cloud Storage and Azure Blob, and how to lock each one down.

Dr. Security2 MIN READ

๐Ÿ’ก The short version: a public file is one thing. A public bucket that lists every file name is another, and that's the one that leaks. Check each bucket your site loads from, and turn off public listing and public access unless you have a good reason.

Cloud storage buckets are the attic of the internet: you put things in, forget about them and one day someone finds the door unlocked. ๐Ÿ—ƒ๏ธ The good news is that checking takes minutes.

๐Ÿ“‚ Public file vs listable bucket

๐Ÿ“„ A public file

  • What a stranger can do: open a file if they know its exact address.
  • Often intended? Yes, for images and downloads.
  • Risk: low, if the file is meant to be public.

๐Ÿ“‚ A listable bucket

  • What a stranger can do: ask the bucket for its list of files, then open them.
  • Often intended? Rarely.
  • Risk: every file name is exposed, including ones you forgot.

๐Ÿ˜ฌ How buckets end up open

  • A bucket made public "just to get the images working" and never changed back.
  • User uploads and backups stored in the same place as public assets.
  • An AI assistant sets a permissive policy to make an access error go away.

๐Ÿ”ง Fixing each provider

Amazon S3

  • Turn on Block Public Access for the bucket (and for the account).
  • Review the bucket policy for a principal of "*" with s3:ListBucket.
  • Serve genuinely public files through a CDN rather than an open bucket.

Google Cloud Storage

  • Enable public access prevention and use uniform bucket-level access.
  • Remove allUsers and allAuthenticatedUsers from the bucket's permissions unless you mean it.

Azure Blob Storage

  • Disable anonymous access on the storage account, or set the container's access level to private.
  • Prefer short-lived shared access signatures for anything you share.

๐Ÿ•ต๏ธ See what a stranger sees

Look in your site's code for the bucket address (for example name.s3.amazonaws.com, storage.googleapis.com/name or name.blob.core.windows.net). Request the bucket root without any credentials. If you get back an XML list of files, the bucket is listable.

On a paid plan, once you've verified you own the site, Dr. Security does this for the buckets your homepage and its first scripts load from: one anonymous request per bucket for a single listing entry, no credentials, nothing written. It reports the bucket name, never an object name.

Building on Supabase? Its storage has its own rules, covered in our RLS guide.

๐Ÿš€ Find out what your site points at. Scan it free and see where to look first.

  • open s3 bucket
  • public storage bucket
  • google cloud storage public
  • azure blob public access
  • cloud storage security

FIND OUT WHAT YOU'RE EXPOSING.