[MEDIUM] Add tenant isolation to weekly digest endpoints (fixes #2927)#2928
[MEDIUM] Add tenant isolation to weekly digest endpoints (fixes #2927)#2928namann5 wants to merge 1 commit into
Conversation
Both /preview/{company_id} and /send-now endpoints accepted a company_id
from the client without verifying the authenticated user belonged to that
company. Any authenticated user could view digest statistics and trigger
emails for any tenant.
Added _verify_company_access helper that checks the user's profile in the
profiles table and rejects requests where the user's company_id does not
match the requested company_id (master_admin role exempted).
|
@namann5 is attempting to deploy a commit to the ritesh Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21e1ec74c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Fixes #2927 - IDOR vulnerability in weekly digest endpoints allowed any authenticated user to access cross-tenant data.
Changes