Repository navigation
Conversation
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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
🎯 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 theisCompanyMember(companyId)check.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 thecompanyIdand utilized the existingisCompanyMember(companyId)function to enforce proper tenant isolation, mimicking the secure setup already in place forcompany-logos.PR created automatically by Jules for task 15223472915691683508 started by @javaadde