Learn / Attack archive / Lesson 28

Open buckets and default passwords

The breaches that needed no hacking at all — an app that left its users' ID photos public, a hiring bot with the password 123456, and the Philippine voter leak — and why "private by default" matters.

Last updated: 2026-09-23

What it is

Some of the biggest leaks involve no exploit, no malware and no phishing. Something was simply left open:

Search engines for exposed devices (Shodan, Censys) and bucket scanners find these within hours of them going live. Researchers find some. Criminals find the rest.

Why it is a rule

Why it keeps working

How to do it

1. Private by default, public on purpose

Storage rules start at "deny everything". Make individual files public only through a deliberate step, like a signed URL that expires.

js
// Firebase Storage rules: only the owner may read or write their own folder
rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /users/{uid}/{file=**} {
      allow read, write: if request.auth != null && request.auth.uid == uid;
    }
  }
}

2. Check ownership on every record

Never trust an ID from the URL or body on its own. Load the record with the current user's scope in the query:

sql
SELECT * FROM applicants WHERE id = $1 AND company_id = $2

If the row belongs to someone else, it is simply not found. Random, unguessable IDs help, but they are a second lock, not the first.

3. No default or shared passwords, ever

Change every default password during setup. Remove test accounts before launch. Put admin panels behind a second factor, even the ones you think nobody knows about.

4. Keep an inventory

List every bucket, database and admin panel, with an owner for each. Delete what has no owner. Cloud providers have tools that flag public buckets; turn them on.

5. Do not collect what you cannot protect

The Tea breach hurt because the app kept ID photos after verifying them. If you only need to check an ID once, check it and delete it.

How we do it here

Every query that reads client data carries the tenant taken from the server-side session, so changing an ID in a URL cannot reach another business's rows. There are no default or shared logins; each person has their own. Pages meant to be opened from a link without signing in, such as a receipt, use a long unguessable code, and only a hash of that code is stored.

Benefits

Disadvantages

Checklist

Sources

Read this lesson as Markdown