Skip to content

🔒 Fix permissive Firebase Storage rules for inventory - #8

Open
javaadde wants to merge 1 commit into
mainfrom
fix/security-storage-inventory-rules-15223472915691683508
Open

javaadde wants to merge 1 commit into
mainfrom
fix/security-storage-inventory-rules-15223472915691683508

Conversation

@javaadde

Copy link
Copy Markdown
Owner

🎯 What:
The /inventory/ path in Firebase Storage was overly permissive, allowing any signed-in user (isSignedIn()) to read and write all inventory files regardless of which company they belonged to. This fix updates the rule to match on /inventory/{companyId}/{allPaths=**} and requires the user to be a member of that company via the isCompanyMember(companyId) check.

⚠️ Risk:
Without this fix, any authenticated user could potentially list, read, or overwrite inventory items (like images or documents) for any company in the system, leading to a severe data leak and possible unauthorized data modification (tenant isolation failure).

🛡️ Solution:
Changed the storage match path for /inventory/ to capture the companyId and utilized the existing isCompanyMember(companyId) function to enforce proper tenant isolation, mimicking the secure setup already in place for company-logos.


PR created automatically by Jules for task 15223472915691683508 started by @javaadde

Updates `storage.rules` to require `isCompanyMember(companyId)` for the `/inventory/` path, addressing an overly permissive rule that allowed any signed-in user to read and write to all inventories.

Co-authored-by: javaadde <179390358+javaadde@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@javaadde javaadde self-assigned this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant