Skip to content

Team invite privilege escalation - #14947

Merged
abnegate merged 2 commits into
mainfrom
fix/team-invite-privilege-escalation
Oct 27, 2026
Merged

abnegate merged 2 commits into
mainfrom
fix/team-invite-privilege-escalation

Conversation

@fogelito

Copy link
Copy Markdown
Contributor

What does this PR do?

(Provide a description of what this PR does and why it's needed.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)

Related PRs and Issues

  • (Related PR or issue)

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@luxor-code-review

luxor-code-review Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review complete. No issues found — approved ✅.


This small PR reorders the authorization logic in the team memberships create endpoint, failing closed on missing owner privileges before invitee lookup, membership creation, mails, or events run. The matching e2e client base is updated to exercise the new behavior. No verified issues were found.

Reviewed commit: d605cac

@ghost

ghost commented Oct 26, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

No actionable defects found in the authorization change or its regression coverage.

Moves the team-invitation authorization check ahead of invitee lookup and account creation. Adds E2E coverage verifying a non-owner member is denied and that the rejected invitation leaves the email available for account registration.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 2
File Change
src/Appwrite/Platform/Modules/Teams/Http/Memberships/Create.php Enforces the existing owner, API-key, and privileged-user invitation policy before invitee processing.
tests/e2e/Services/Teams/TeamsBaseClient.php Adds coverage for denied invitations by a non-owner and confirms no account is created.

Reviewed d605cac · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@github-actions

Copy link
Copy Markdown

Security rules

No new WARNING or ERROR findings from security rules.

6 existing findings tracked in .semgrep/baseline.json
  • php.appwrite.guest-write-without-abuse-limit (3)
  • php.appwrite.secret-compare-timing (1)
  • php.appwrite.weak-secret-env-default (2)

Posted by Checks / Rules. Re-runs update this comment in place. Rule details and baseline: .semgrep/README.md.

@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix/team-invite-privilege-escalation (after).

Metric Before After Change
🚀 Requests/sec 209.19 213.44 ⚪ +2%
⏱️ Latency P50 80.36 ms 80.3 ms ⚪ -0.1%
⏱️ Latency P95 193.71 ms 193.01 ms ⚪ -0.4%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 80.3 193.01 13,623 213.44 -0.7
Account 151.91 302.02 717 11.95 +25.3
TablesDB 76.47 142.25 7,409 119.27 -0.38
Storage 77.23 182.6 3,585 58.76 -20.57
Functions 112.54 234.97 1,912 31.91 +1.48

Top API waits (after)

API request Max wait (ms)
account.prefs.update 456.76
account.name.update 454.72
tablesdb.rows.create 451.41
functions.variables.update 450.29
functions.create 432.69

@abnegate
abnegate merged commit 41fb218 into main Oct 27, 2026
37 checks passed
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.

2 participants