Skip to content

[WEB-8291] fix: gate project invitation list/retrieve/destroy to project admins - #9444

Merged
dheeru0198 merged 43 commits into
previewfrom
web-8291/project-invite-list-admin-scope
Oct 26, 2026
Merged

dheeru0198 merged 43 commits into
previewfrom
web-8291/project-invite-list-admin-scope

Conversation

@mguptahub

@mguptahub mguptahub commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes the confirmed-vulnerable half of WEB-8291 (HIGH, CWE-862) — the project-invitation-list authorization bypass.

ProjectInvitationsViewset declared no permission_classes (inheriting IsAuthenticated) and only decorated create with @allow_permission([ROLE.ADMIN]). The default list / retrieve / destroy actions were therefore ungated, and get_queryset was scoped only by URL slug + project_id — not by the caller's membership. The serializer (ProjectMemberInviteSerializer, fields="__all__") returns email and token.

Impact (before fix): any authenticated user could GET /api/workspaces/<slug>/projects/<project_id>/invitations/ (and /<pk>/) for a project they don't belong to and read every pending invite's raw token + invitee email (re-exposing what #9305 stripped from the public path), and could DELETE arbitrary project invitations.

The other vector in the advisory — unauthenticated force-accept — is already remediated: ProjectJoinEndpoint.post enforces token + auth + email-match (#9308) and the public GET uses the token-stripped serializer (#9305).

Fix

Gate list / retrieve / destroy with @allow_permission([ROLE.ADMIN]), matching create (project admin, or a workspace-admin who is a project member — the decorator's existing semantics). This mirrors the workspace sibling WorkspaceInvitationsViewset, which was already admin-gated (WorkSpaceAdminPermission).

Chose the method decorator over a class-level ProjectAdminPermission deliberately: a class-level permission would have tightened create (blocking the workspace-admin-project-member fallback that @allow_permission allows), a behavior change. The decorator keeps all four actions consistent.

Also removes a pre-existing unused User import in the same file.

Tests

New contract suite plane/tests/contract/app/test_project_invite_list_scope_app.py (fail-before verified — the 4 negative tests return 200/204 without the fix):

  • A workspace user who is a member of a different project is rejected with 403 on list / retrieve / delete, and the invitation is left intact.
  • An active project member without the admin role is rejected with 403 on list / retrieve / delete, and the invitation is left intact.
  • Positive control: an active project admin can still list invitations and sees the pending invite.

Verification

  • ruff check: clean
  • manage.py check (test settings): no issues
  • pytest (new suite + related invite/join suites): 17/17 green; fail-before verified

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Restricted project invitation listing, viewing, and deletion to project administrators.
    • Non-project members and project members without administrator access cannot view or delete invitations.
    • Unauthorized deletion attempts leave invitations unchanged.
    • Project administrators can list pending invitations.
  • Tests

    • Added coverage for authorized and unauthorized invitation listing, viewing, and deletion.

@mguptahub
mguptahub requested a review from dheeru0198 as a code owner July 20, 2026 06:21
Copilot AI lite review requested due to automatic review settings July 20, 2026 06:21
@makeplane

makeplane Bot commented Jul 20, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5b15918e-233e-47c1-b6b3-48180024fa99
📥 Commits

Reviewing files that changed from the base of the PR and between 7027f1c and d409b05.

📒 Files selected for processing: 1
  • apps/api/plane/app/views/project/invite.py
🚧 Files skipped from review as they are similar to previous changes: 1
  • apps/api/plane/app/views/project/invite.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

📝 Walkthrough

Project invitation list, retrieve, and delete actions now require project-admin permissions. Contract tests cover denied access, invitation preservation after denied deletes, and successful listing by an active project administrator.

Changes: Project invitation authorization

Layer / File(s) Summary
Admin-only invitation actions
apps/api/plane/app/views/project/invite.py, apps/api/plane/tests/contract/app/test_project_invite_list_scope_app.py
The invitation viewset adds admin-only list, retrieve, and destroy actions. Contract tests verify 403 responses for unauthorized members, preserve invitations after denied deletes, and verify that an active project administrator can list invitations. Two comments are shortened without changing executable behavior.

Priority: ⬆️ High

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to d409b

Invitation access is restricted to project administrators, with no outstanding issue identified that should delay merging.

Security Architecture Review

Security architecture risk: 🔵 Low · up to b6f96

The changed endpoints now require project-admin access before invitations can be read or deleted. No security regression was identified, although coverage does not establish that every invitation access path has been validated.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed control limits who can read or delete invitations for a specified workspace and project; it does not grant a caller new authority over another project or data store.

Security Findings and Attack Paths

  • inferred — An authenticated caller without qualifying project membership previously reached invitation reads and deletion through these routes. The new wrappers return 403 before those handlers execute; the added tests check denial and that a denied deletion leaves the invitation present.

Trust Boundaries and Controls

  • observed — The existing workspace-admin fallback still requires active membership in the specified project. A detail request for an invitation outside the URL's workspace or project cannot select it through the scoped queryset.

Resilience and Maintainability Implications

  • inferred — Membership is checked before the inherited delete operation, without visible atomic coupling to a concurrent membership revocation. This residual timing window does not worsen the prior behavior, which required no project-membership check for deletion.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 29.41% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the authorization fix and specifies the affected project invitation actions.
Description check Passed The description explains the vulnerability, impact, fix, compatibility rationale, tests, verification results, and WEB-8291 reference. It does not use the template headings or select a Type of Change …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the vulnerability, impact, fix, compatibility rationale, tests, verification results, and WEB-8291 reference. It does not use the template headings or select a Type of Change checkbox, but the required information is otherwise substantially complete.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
- [ ] Create stacked PR - [ ] Commit on current branch
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens app API authorization around two previously vulnerable endpoints: project invitation list/retrieve/delete (GHSA-r68c-48rr-m67f / WEB-8291) and draft-to-issue conversion ownership scoping (GHSA-vfqm-7rh7-84hq / WEB-8289).

Changes:

  • Restricts ProjectInvitationsViewset list / retrieve / destroy actions to project admins via @allow_permission([ROLE.ADMIN]).
  • Scopes WorkspaceDraftIssueViewSet.create_draft_to_issue draft lookup to created_by=request.user and returns 404 when the draft isn’t owned by the caller.
  • Adds contract test coverage for both authorization/ownership scenarios.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
apps/api/plane/app/views/project/invite.py Gates invitations list/retrieve/destroy to project admins to prevent cross-project invite/token disclosure and deletion.
apps/api/plane/app/views/workspace/draft.py Prevents non-owners from converting (and thereby consuming/migrating assets from) another user’s draft.
apps/api/plane/tests/contract/app/test_project_invite_list_scope_app.py Contract regression tests ensuring non-members get 403 and project admins can still list invites.
apps/api/plane/tests/contract/app/test_draft_to_issue_owner_scope_app.py Contract regression tests ensuring only the draft owner can convert; non-owners receive 404 and cannot steal assets.

…ect admins (GHSA-r68c-48rr-m67f)

ProjectInvitationsViewset declared no permission_classes (inheriting
IsAuthenticated) and only decorated create with @allow_permission([ADMIN]).
The default list/retrieve/destroy actions were ungated and get_queryset
was scoped only by URL slug + project_id, so any authenticated user could
read another project's pending invitations — including invitee email and
the raw token (re-exposing what #9305 stripped from the public path) — and
delete them.

Gate list/retrieve/destroy with @allow_permission([ROLE.ADMIN]), matching
create (project admin, or a workspace-admin who is a project member). The
workspace sibling WorkspaceInvitationsViewset was already admin-gated.
Also drop a pre-existing unused User import in the same file.

Adds contract regression tests (fail-before verified): a non-member of the
project is rejected with 403 on list/retrieve/destroy (invite left intact),
with a positive control confirming a project admin can still list.

Co-authored-by: Plane AI <noreply@plane.so>
@mguptahub
mguptahub force-pushed the web-8291/project-invite-list-admin-scope branch from 82a315e to e78665f Compare July 20, 2026 06:30
@mguptahub

Copy link
Copy Markdown
Contributor Author

Good catch @copilot — that was a branching mistake, not intended scope. web-8291 was accidentally cut from the web-8289 branch instead of preview, so it carried the WEB-8289 draft-to-issue commits (which have their own PR, #9443).

Fixed by rebasing web-8291 onto preview (git rebase --onto origin/preview), dropping the two WEB-8289 commits. This PR now contains only the WEB-8291 project-invitation authorization fix:

  • apps/api/plane/app/views/project/invite.py
  • apps/api/plane/tests/contract/app/test_project_invite_list_scope_app.py

The draft-to-issue change stays tracked/reviewed independently in #9443. 4/4 invite contract tests still green; PR is mergeable.

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown

Good catch @copilot — that was a branching mistake, not intended scope. web-8291 was accidentally cut from the web-8289 branch instead of preview, so it carried the WEB-8289 draft-to-issue com...

Confirmed — the branch now contains only the WEB-8291 project-invitation changes (apps/api/plane/app/views/project/invite.py + contract tests). The WEB-8289 draft-to-issue commits are gone.

@mguptahub mguptahub changed the title [WEB-8291] fix: gate project invitation list/retrieve/destroy to project admins (GHSA-r68c-48rr-m67f) [WEB-8291] fix: gate project invitation list/retrieve/destroy to project admins Aug 7, 2026
Explanations kept unchanged; only the IDs are removed.

Co-authored-by: Plane AI <noreply@plane.so>
@github-actions

github-actions Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

React Doctor skipped this pull request — it changed no React files.

Reviewed by React Doctor for commit d409b05.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (3)

apps/api/plane/app/views/project/invite.py:65

  • retrieve() should forward *args, **kwargs to DRF’s parent implementation. This avoids subtle issues if DRF/mixins start relying on passed kwargs (even though self.kwargs is set).
    @allow_permission([ROLE.ADMIN])
    def retrieve(self, request, slug, project_id, pk):
        return super().retrieve(request)

apps/api/plane/app/views/project/invite.py:69

  • destroy() should forward *args, **kwargs to DRF’s parent implementation for consistency with DRF’s expected calling convention and to reduce risk of future breakage.
    @allow_permission([ROLE.ADMIN])
    def destroy(self, request, slug, project_id, pk):
        return super().destroy(request)

apps/api/plane/app/views/project/invite.py:62

  • The overridden action doesn’t forward *args, **kwargs to DRF’s list(). It works today because self.kwargs is already set, but forwarding preserves DRF’s expected calling convention (e.g., format suffixes / future mixins) and matches patterns used elsewhere in the codebase.

This issue also appears in the following locations of the same file:

  • line 63
  • line 67
    @allow_permission([ROLE.ADMIN])
    def list(self, request, slug, project_id):
        return super().list(request)

mguptahub and others added 7 commits October 12, 2026 16:26
* [INFRA-1114] fix(security): keep magic-code regeneration cap after verify exhaustion

Burn the code instead of deleting the Redis record when the verify
attempts run out, so the per-email regeneration count still applies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1114] fix(security): track issued magic codes in an atomic counter

Cap codes issued per email with a dedicated `magic_<email>:issued`
counter, incremented atomically in initiate() (INCR + first-time
EXPIRE). The window is a fixed 600s from the first code and is not
extended by later requests; the limit stays at 4 codes per window.

The cap no longer depends on the token record, so verify exhaustion
goes back to deleting the token and its verify counter. A successful
sign-in clears the issued counter. current_attempt is dropped from
the stored value.

Tests reset the issued counter wherever magic-link state is cleared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1114] fix(security): address review

Count each magic-code verify attempt atomically before comparing the code,
so no more than MAX_VERIFY_ATTEMPTS comparisons are made per token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1114] fix(security): address review feedback

- Keep current_attempt: 0 in the magic-code token record so pods on the
  previous release can still read it during a rolling deploy.
- Assert that later code requests do not extend the TTL of the issued-code
  counter, so the issue window stays fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…10041)

* [INFRA-1132] fix(security): cap invitation role updates at the requester's role

WorkspaceInvitationsViewset.partial_update was served by the generic mixin, which
skipped the role cap create() enforces. It now accepts only {"role"} and rejects a
role above the requester's own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1132] test: address review

Reword the invitation update test docstring and one test name as a neutral
statement of the role cap rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…space (#10042)

* [INFRA-1138] fix(security): require workspace admin to PUT/PATCH the workspace

WorkSpaceBasePermission allowed the Member role for PUT/PATCH, so PUT reached the
undecorated update() action. It now requires Admin, matching partial_update; the
unused duplicate in plane.utils.permissions gets the same change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1138] fix: address review

Make deleted_at read-only in WorkSpaceSerializer so an update cannot set it,
and reword the test module docstring as a neutral statement of the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…0044)

* [INFRA-1159] fix(security): serve assets inline only for the stored safe image type

S3Storage.generate_presigned_url now honours inline only when the stored object's
Content-Type is an allow-listed image and pins it via ResponseContentType; anything
else downloads. Callers pass storage_metadata instead of client-editable attributes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1159] fix: address review

Decide inline disposition from the asset's claimed type instead of storage_metadata;
S3Storage pins that allow-listed image type as the response Content-Type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1159] fix(security): address review feedback

- Pass the asset name as the filename from the static and Spaces asset
  endpoints, so a download keeps its name and extension.
- Add disposition tests for the Spaces EntityAssetEndpoint and the v1
  GenericAssetEndpoint (png inline, svg attachment), and assert the
  filename on the static endpoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1159] fix(security): address review feedback

- S3Storage uses the asset name as the download filename only when it
  is a non-empty string (otherwise a random name), and treats a
  non-string type as missing (attachment), so non-string attributes
  no longer fail the presigned URL
- Test: static asset with a numeric name or type still redirects

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…0043)

* [INFRA-1157] fix(security): bound password input scored by zxcvbn

Add is_password_strong() helper that scores only the first 128 characters,
and route every zxcvbn caller (sign-up, password set/change/reset, instance
admin sign-up, reset_password command) through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1157] fix: address review

Score the first and the last ZXCVBN_MAX_LENGTH characters and accept the password
if either window is strong; add a unit test that only the password helper imports zxcvbn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…points (#10045)

* [INFRA-1115] fix(security): enforce guest page visibility in ProjectPagePermission

Apply the guest_view_all_features rule centrally so page description and
version endpoints follow it, not just PageViewSet.retrieve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1115] test: address review

Reword the guest page access test module docstring as a neutral statement of
the guest_view_all_features rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1115] fix(security): address review feedback

- Cover page retrieve in the guest own-page and guest_view_all_features
  positive cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
dheeru0198 and others added 11 commits October 18, 2026 16:11
…tes (#10064)

* [INFRA-1116] fix(security): restrict user-scoped FKs on users/me updates

Notification preference user/workspace/project fields are now read-only.
User avatar_asset/cover_image_asset accept only the user's own asset of the
matching entity type, and replacing an avatar/cover deletes only the user's own asset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1116] fix(security): address review

Use matching entity types for the foreign-asset test so it checks ownership alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1116] fix(security): address review feedback

- Clear the avatar link in delete_old_avatar when the linked asset is not the user's own, leaving the asset untouched
- Add a test for the login avatar sync with storage mocked

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…elds (#10063)

* [INFRA-1208] fix(security): limit public comment writes to content fields

Public board comment create and edit now pass only comment_html and
comment_json to the serializer; actor, access, issue and parent stay
server-controlled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1208] fix(security): address review

Limit app comment updates to content and access fields, including the activity payloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1208] fix(security): address review feedback

- Comment update activity: record a change only when comment_html is in
  the payload and differs.
- Space comment PATCH: capture current_instance before saving.
- App comment create: apply the same writable-field allowlist as
  partial_update (hoisted to COMMENT_WRITABLE_FIELDS) and pass the
  filtered data to model_activity.
- Tests for all three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Sriram Veeraghanta <veeraghanta.sriram@gmail.com>
…0065)

* [INFRA-1174] fix(security): scope project stats and grouping keys

Project stats follow the project list visibility rules, the advance analytics overview
counts members only of the caller's projects in the workspace, and workspace-level issue
grouping builds project/state/cycle/module/label keys from the caller's projects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1174] fix(security): address review feedback

- issue_group_values raises ValueError when called with neither project_id nor user
- Add a unit test for it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1174] fix(security): address review feedback

- Public board grouping (space issue_group_values) takes project, state, label,
  cycle and module keys only from the board's project.
- Test: public issues endpoint grouped by project/state/cycle returns only keys
  from the board's project.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…n see (#10066)

* [INFRA-1163] fix(security): scope favorites to entities the caller can see

Favorite creation now requires the entity to be in the URL workspace/project and
visible to the caller; entity_data resolves under the same rule (get_favorite_entities).
Covers INFRA-1163, INFRA-1170, INFRA-1172, INFRA-1185, INFRA-1186.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1163] fix(security): address review

Resolve workspace view favorites via workspace membership and report the favorite's project for multi-project pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1163] fix(security): address review feedback

- Favorite PATCH only accepts name, sequence and parent, so the favorited entity can't be changed after creation
- Add a test that PATCHing entity_type/entity_identifier leaves the row unchanged while sequence still updates

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…10067)

* [INFRA-1166] fix(security): apply guest_view_all_features in search

Search issue, page, view and intake queries now apply the guest rule per
result project, inside the caller's membership join, matching the list views.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1166] fix(security): address review

Keep private pages owner-only in global search, matching the page list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1166] fix(security): address review

Keep private project views owner-only in global search, as the view list does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…10068)

* [INFRA-1149] fix(security): apply entity role rules to asset changes

Confirm, update and delete on the generic asset routes now follow the rule of
the asset's entity: workspace admin for the logo, project admin for the cover,
project admin or uploader for attachments, member or uploader otherwise (INFRA-1149, INFRA-1197).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1149] fix(security): address review

Rename asset role tests after the permission rule each one covers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1149] fix(security): address review feedback

- Asset restore applies the same role rule as update/delete (can_modify_asset)
- Add a test: a project guest can't restore another user's deleted attachment, the uploader can
- Tests assign the response before asserting on its status instead of making requests inside assert

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1149] fix(security): address review feedback

- The legacy asset delete and restore routes (by asset path) apply
  can_modify_asset, like the v2 routes.
- can_modify_asset: the uploader shortcut requires an active role in the
  asset's project, if it has one.
- Tests: legacy delete/restore follow the role rules; an uploader with an
  inactive project membership cannot delete or restore.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…10069)

* [INFRA-1158] fix(security): require a non-empty matching OAuth state

Add validate_oauth_state, which pops the session state and accepts the
callback only when both values are non-empty and match (constant time).
Use it in all eight app and space OAuth callbacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1158] fix(security): address review

Fall back to the app base host in the Gitea callback when the session has no host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1158] fix(security): address review feedback

- validate_oauth_state compares first and removes the stored state only on a match, so a mismatched callback no longer drops a pending login's state
- Test: a mismatched callback followed by the matching one logs in
- Add the app GitLab and Google callbacks to the state test matrix
- Compare the parsed scheme and host in the app-host redirect test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
… app (#10070)

* [INFRA-1180] fix(security): bring v1 API permissions in line with the app

v1 cycle delete is limited to project admins or the cycle creator, and a cycle
update without owned_by keeps the current owner. v1 label writes require
project admin. v1 project-member add requires an active workspace membership.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1180] fix(security): address review

Check the target's active workspace membership on every member PATCH, and keep an explicit null cycle owner assigning the requester.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1180] fix(security): address review feedback

- ProjectAdminPermission (both copies) now also admits a workspace admin
  who is a project member at any role, matching allow_permission.
- v1 cycle delete reuses ProjectAdminPermission for its admin check.
- Tests: a workspace admin with project role member can create labels and
  delete cycles; one outside the project cannot create labels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…nts (#10071)

* [INFRA-1146] fix(security): scope public Space asset uploads to comment images

Public asset uploads now require comments enabled on the board, accept only
COMMENT_DESCRIPTION, and bind only to the caller's own EXTERNAL comment on it.
The bulk endpoint binds only the caller's own comment images to such a comment (INFRA-1144).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1146] fix(security): address review

Treat an empty comment id on upload as unbound and refuse bulk binding when board comments are disabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
#10072)

* [INFRA-1165] fix(security): reset role when rejoining a public project

Self-joining a public project reactivated an inactive ProjectMember row with
its previous role. Reactivation now sets the workspace role a new joiner gets,
and only touches inactive rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1165] fix(security): address review feedback

- Rejoin reactivation now also sets updated_by and updated_at, since
  .update() skips the model's save() hooks.
- Test asserts updated_by on the reactivated membership.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ted writes (#10073)

BaseSessionAuthentication.enforce_csrf now refuses unsafe requests whose Origin
is not the request's own host, a configured base URL, or a CORS/CSRF trusted origin.
Requests without an Origin header (non-browser clients) and safe methods are unaffected.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

@dheeru0198 dheeru0198 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review against current preview (6c16585)

Looks good with a couple of nits. The invite guard is still needed on preview.

  1. minor apps/api/plane/app/views/project/invite.py:55, apps/api/plane/tests/contract/app/test_project_invite_list_scope_app.py:9: Suggest rewording the comment and test docstring to state the authorization rule being enforced rather than describing the prior gap.
  2. minor apps/api/plane/tests/contract/app/test_project_invite_list_scope_app.py:83: Negative tests cover a non-member only. Suggest adding a case for an ordinary project member without admin rights, expecting 403 on list, retrieve and delete.
  3. nit apps/api/plane/app/views/project/invite.py:169: Preview now contains #10072's role reset in this file. Rebase and preserve it; the merge appears conflict-free.

Notes from an automated review (Claude Code + Codex), checked against current preview.

dheeru0198 and others added 3 commits October 21, 2026 20:38
…10061)

* [INFRA-1195] fix(security): verify Redis TLS certificates by default

rediss:// connections (redis_instance and the django-redis cache) now verify the
server certificate and hostname. REDIS_SSL_CA_CERTS sets a custom CA bundle and
REDIS_SSL_CERT_REQS=none turns verification off. Also covers INFRA-1210.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1195] fix(security): address review

Honour ssl_cert_reqs from REDIS_URL when deciding hostname checks, and document mounting a custom CA bundle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1195] fix(security): address review feedback

- AIO: document REDIS_SSL_CERT_REQS and REDIS_SSL_CA_CERTS in
  variables.env and the README, including a -v mount for the CA bundle.
- AIO start.sh: pass both through from the container environment, so
  -e values are not replaced by the plane.env defaults.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1195] fix(security): address review feedback

- REDIS_SSL_CERT_REQS=optional keeps hostname checking on; only none turns it off.
- Tests: mapping for optional expects ssl_check_hostname=True, and a connection
  built with optional has check_hostname=True.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…nstall (#10074)

* [INFRA-1160] fix(security): generate object-storage credentials per install

install.sh/swarm.sh generate random MinIO credentials on install and replace the
template placeholders on upgrade; the CLI compose no longer falls back to them.
setup.sh generates the pair for source builds, and settings drop the fallback and
log a critical warning when MinIO runs with the placeholder pair.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1160] fix(security): address review feedback

- The API warns when AWS_SECRET_ACCESS_KEY is the template value,
  whatever the access key is.
- install.sh and swarm.sh rotate whenever the secret is the template value
  (or empty), and ignore quotes from older templates when comparing.
- docker-compose.yml keeps the access-key/secret-key fallbacks for MinIO and
  the API, so installs upgraded with an older setup.sh, or with blank keys,
  still start; the API warning covers them.
- README: download the latest setup.sh before upgrading.
- Test: custom access key with the template secret logs the warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1160] fix(security): address review feedback

- Reword the comment above the storage credential warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ate limits (#10075)

* [INFRA-1189] chore(security): make proxy hop count configurable for rate limits

Add an optional NUM_PROXIES setting and pass TRUSTED_PROXIES/NUM_PROXIES
through the CLI compose. Defaults are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* [INFRA-1189] fix(security): address review feedback

- NUM_PROXIES accepts at most 3 digits, so an oversized value is ignored
  with a warning instead of failing settings load.
- variables.env ships NUM_PROXIES= uncommented, so an upgrade keeps an
  operator's value; an empty value is still treated as unset.
- README: "leaving NUM_PROXIES empty" matches the shipped template.
- Test: a 5000-digit value keeps DRF's default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
- Reword the invitation permission comment, the join-endpoint comment and
  the test docstrings to state the access rule.
- Add a test that an active project member without the admin role gets 403
  on list, retrieve and delete, and the invitation is kept.
- Reword the join comment in UserProjectInvitationsViewset to state that
  membership writes use only the validated project IDs.
@dheeru0198
dheeru0198 force-pushed the web-8291/project-invite-list-admin-scope branch from 932beba to d409b05 Compare October 22, 2026 12:01

@dheeru0198 dheeru0198 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving: review points addressed and re-verified; CI green.

@dheeru0198
dheeru0198 merged commit 0d7b541 into preview Oct 26, 2026
16 checks passed
@dheeru0198
dheeru0198 deleted the web-8291/project-invite-list-admin-scope branch October 26, 2026 19:06
sriramveeraghanta pushed a commit that referenced this pull request Nov 9, 2026
…ect admins (#9444)

* [WEB-8291] fix: gate project invitation list/retrieve/destroy to project admins
* chore(security): drop advisory identifiers from code comments
* [WEB-8291] fix: address review feedback

(cherry picked from commit 0d7b541)
questbibek pushed a commit to questbibek/plane that referenced this pull request Nov 23, 2026
…ect admins (makeplane#9444)

* [WEB-8291] fix: gate project invitation list/retrieve/destroy to project admins
* chore(security): drop advisory identifiers from code comments
* [WEB-8291] fix: address review feedback

(cherry picked from commit 0d7b541)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants