Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

fix(security): IDOR family + OR-API drift (C1/C4/H3)#336

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/pass2-idor-api-drift
May 28, 2026
Merged

fix(security): IDOR family + OR-API drift (C1/C4/H3)#336
rubenvdlinde merged 1 commit into
developmentfrom
fix/pass2-idor-api-drift

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Summary

  • C1 (IDOR) MotionCoauthorController / MotionCoauthorService: any authenticated user could add/remove coauthors or update text on any motion. Added checkMotionAccess() guard in the service (checks @self.owner and coAuthors membership); controller passes callerUid + callerIsAdmin to every mutator.
  • C4 (OR-API drift) EngagementController::resolveParticipantUuid: replaced non-existent findObjects() with canonical setRegister/setSchema/findAll + jsonSerialize.
  • H3 (UID/UUID confusion) WorkspaceService::isMembershipManager: was comparing NC UIDs against members[] which stores participant UUIDs. Added resolveParticipantUuid() helper; now resolves caller UID to participant UUID before the in_array check.

Test plan

  • PHPCS: clean (0 errors)
  • PHPStan: clean (0 errors)
  • Non-admin user cannot add/remove coauthors on motions they did not propose
  • Admin bypass works for all three co-author endpoints
  • Engagement capture for own participant UUID accepted; foreign UUID rejected with 403
  • Workspace membership check correctly uses participant UUID

- MotionCoauthorController: pass callerUid + callerIsAdmin to all
  mutators; catch InvalidArgumentException (403) and RuntimeException
  (404/409) appropriately
- MotionCoauthorService: add checkMotionAccess() guard (checks @self.owner
  proposer match and coAuthors membership) + resolveParticipantUuid()
  helper using canonical OR-API (setRegister/setSchema/findAll/jsonSerialize)
- EngagementController: replace non-existent findObjects() with canonical
  setRegister/setSchema/findAll; use named arg on internal call
- WorkspaceService: add resolveParticipantUuid() helper; fix
  isMembershipManager() to resolve caller's NC UID to participant UUID
  before checking against members[] (which stores participant UUIDs,
  not NC UIDs) — closes H3 UID/UUID confusion
@rubenvdlinde rubenvdlinde merged commit cd9ede5 into development May 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant