Fix guides

Anyone may be able to list and download your Firebase files.

Updated 2026-10-14 · Plain English, written for founders who built with Lovable, Bolt, Cursor or similar.

Firebase Storage holds the files your users upload: avatars, receipts, ID photos, exports. Your app's firebaseConfig names the bucket (storageBucket), and that is public by design. What decides who can touch the files is Storage security rules. If they say allow read, write; with no condition, or if true, anyone can list every file name, download every file, and upload or overwrite files, with no login.

Test mode for Storage works like Firestore: rules with if request.time < timestamp.date(...) that are open to everyone until the date, then refuse everyone after it. Rules that only check request.auth != null are a quieter version of the same problem: any signed-in account can read every other user's files.

Check from the outside

This is what a stranger does. Open your live app, open DevTools, and search the loaded JavaScript for storageBucket. The value looks like your-project.appspot.com or your-project.firebasestorage.app. Then ask for a listing, without logging in:

curl "https://firebasestorage.googleapis.com/v0/b/YOUR-BUCKET/o?maxResults=1"

A single file is downloaded from …/o/ plus its URL-encoded path plus ?alt=media. If a listing worked, try one of your own files that way to see whether reads are open too.

Only do this against your own project.

Check the rules file

Open storage.rules in your repo, or Storage > Rules in the Firebase console, which shows what is deployed. Look for:

Fix it

Give each user their own folder, and only let them into it. Upload files to users/<uid>/… from your app, then:

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {

    match /users/{uid}/{allPaths=**} {
      allow read, delete: if request.auth != null
                          && request.auth.uid == uid;
      allow create, update: if request.auth != null
                            && request.auth.uid == uid
                            && request.resource.size < 10 * 1024 * 1024
                            && request.resource.contentType.matches('image/.*');
    }

    // Files meant for everyone, written only by your server.
    match /public/{allPaths=**} {
      allow read;
      allow write: if false;
    }
  }
}

Deploy with firebase deploy --only storage, or paste into the Rules tab and publish.

Download URLs are a separate key

A link from getDownloadURL() includes a token= parameter. Anyone with that link can download the file, whatever your rules say. Fixing the rules does not stop links that were already handed out. If one was shared or stored somewhere public, revoke that file's access token in the Firebase console so the old link stops working.

What SecureIndie checks

After the fix

Check your app

SecureIndie looks for this mistake. The free quick check covers the basics from outside (exposed files, keys in your site's code, headers) in about a minute. Database rules, payment webhooks and AI endpoints need the full audit, which also reads your code and proves what a visitor can actually reach.

Questions

What does allow read, write; with no condition mean?

It allows the request unconditionally. Anyone, signed in or not, can list, download, upload, replace and delete files under that path.

I fixed the rules. Are old download links still working?

Yes. A URL from getDownloadURL carries a token and works regardless of rules. Revoke the token for a file in the Firebase console if that link should stop working.

Is it a problem if people can only list files, not read them?

Listing alone shows names, and file names often contain user ids, emails or invoice numbers. In practice allow read grants both listing and downloading, so they usually come together.

Related guides

Checks covered: FB-RULES-004, FB-STORAGE-007 · If you think data already leaked