jira/apps/api/plane/tests/contract/app
Manish Gupta 3478d4fac4
[WEB-8352] fix(security): scope SubIssuesEndpoint to the URL project (#9466)
* [WEB-8352] fix(security): scope SubIssuesEndpoint to the URL project (GHSA-gxhv-fw9x-2pg3)

SubIssuesEndpoint is guarded only by ProjectEntityPermission, which verifies
the caller belongs to the URL project_id but not that the path issue_id lives
in that project. Both handlers then resolved issues without a project scope:

- GET filtered sub-issues by parent_id + workspace__slug only, leaking the
  names/priorities/assignees/dates of another project's sub-issues (read IDOR).
- POST loaded the parent by bare pk (no workspace/project scope) and filtered
  the moved sub-issues by workspace__slug only, letting any project member
  re-parent issues from other projects/workspaces (write IDOR).

Scope the parent lookup and both sub-issue querysets to the URL project_id
(and bind the parent to the workspace), returning 404 when the parent is not
in the caller's project. Adds 5 contract tests (3 security, 2 positive
controls); fail-before verified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* [WEB-8352] fix: dispatch sub-issue activity only for project-scoped issues (CodeRabbit/Copilot #9466)

The DB update + response were scoped to the URL project, but the activity loop
still iterated the raw caller-supplied sub_issue_ids. A cross-project id
(excluded from the re-parent) would still fire issue_activity.delay, whose task
does an unscoped Issue.objects.get and bumps updated_at — touching a foreign
issue and creating a bogus activity row.

Dispatch from the project-scoped sub_issues (scoped_sub_issue_ids) instead.
Strengthened the test to assert the foreign issue is absent from the response
body (sub_issues / state_distribution) and that no activity is dispatched for it
(mock). Fail-before verified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(security): drop advisory identifiers from code comments

Explanations kept unchanged; only the IDs are removed.

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Plane AI <noreply@plane.so>
2026-08-28 01:52:19 +05:30
..
__init__.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
test_api_token.py refactor: logging with retention + API token hardening (#9148) 2026-05-27 16:00:05 +05:30
test_authentication.py [WEB-7946] fix: add rate limiting to email/password sign-in and sign-up endpoints (#9335) 2026-08-28 00:13:58 +05:30
test_avatar_url_annotation.py fix: cast avatar_asset to CharField to resolve mixed type errors in URL concatenation (#9512) 2026-07-30 20:29:41 +05:30
test_cycle_issue_app.py [WEB-8019] fix(security): scope CycleIssue reassignment lookup to workspace/project (#9349) 2026-07-09 18:33:48 +05:30
test_deploy_board_project_scope_app.py [WEB-8075] fix: scope ProjectMemberPermission SAFE_METHODS to project membership (#9375) 2026-07-16 16:01:52 +05:30
test_issue_list_guest_scope_app.py [WEB-8074] fix: scope IssueListEndpoint to guest created_by (#9374) 2026-07-16 16:03:25 +05:30
test_page_order_by_allowlist_app.py [WEB-8110] fix: sanitize page list order_by against an allowlist (#9387) 2026-08-28 00:16:47 +05:30
test_page_version_project_scope_app.py [WEB-8095] fix: scope page-version reads to the URL project (GHSA-g49r/ghcr) (#9380) 2026-07-16 16:03:06 +05:30
test_project_app.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
test_project_member_is_active_authz.py [WEB-8060] fix(security): enforce authz on is_active member (de)activation (#9367) 2026-07-09 18:37:39 +05:30
test_spaces_board_object_scope_app.py [WEB-8283] fix: bind Spaces board object IDs to the anchor's project (#9442) 2026-08-28 00:17:41 +05:30
test_sub_issue_cross_project_scope_app.py [WEB-8352] fix(security): scope SubIssuesEndpoint to the URL project (#9466) 2026-08-28 01:52:19 +05:30
test_webhook_secret_key_scope_app.py [WEB-8103] fix: stop leaking webhook HMAC secret_key on reads (#9382) 2026-08-28 00:16:01 +05:30
test_workspace_app.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
test_workspace_cycles_modules_project_scope_app.py [WEB-8068] fix: scope workspace cycles/modules listing to project membership (#9373) 2026-07-16 16:00:08 +05:30
test_workspace_file_asset_project_scope_app.py [WEB-8066] fix: scope workspace asset get/patch/delete to project membership (#9372) 2026-07-14 20:11:32 +05:30
test_workspace_user_preference_app.py fix: scope workspace user preference filter to current user (#9279) 2026-06-21 03:31:05 +05:30