[BUG]: Members can change fields they must not change on their own record #664

Closed
opened 2026-11-13 11:47:36 +01:00 by simon · 0 comments
Owner

Description

A member who is signed in (permission set own_data) can change every field of their own member record, not only their contact data. Reproduced on main a927a3a4: signed in as a member, a note was saved on the own record.

What a member can change today:

  • all member fields: join date, exit date, notes, fee type (only to a type with the same interval), membership_fee_start_date (not in the form, but accepted by the action);
  • all own custom field values, including deleting them (e.g. IBAN, "SEPA mandate");
  • "Reactivate" clears an exit date the board has set.

Protected today: linking to a user account, deleting the member, fee cycles.

Cause: :update_member accepts all member_fields plus fee fields (lib/mv/membership/member.ex:129); the own_data policy checks only the record scope :linked (member.ex:244-248, lib/mv/authorization/permission_sets.ex:123-128); the deactivate component offers reactivate to members (lib/mv_web/live/member_live/show/deactivate_component.ex:31-49).

Proposal

  • A dedicated self-service update action for members that accepts only contact fields: first/last name, email, street, house number, postal code, city, country. Everything else is read-only for members.
  • Custom field values: members can neither create, change nor delete them until a per-field member-access setting exists (then the setting decides). Read access stays.
  • Members cannot deactivate or reactivate themselves.
  • The board/admin paths stay unchanged.

Acceptance criteria

  • A member submitting forged params for exit date, join date, notes, fee type, membership_fee_start_date or any custom field gets them rejected; tests send the forged input through the LiveView and the action.
  • A member can still change their contact fields.
  • A member can no longer delete or change own custom field values.
  • Deactivate/reactivate is not offered to and not accepted from members.
  • Board and admin behavior unchanged (regression tests).

Dependencies

  • None. Do first
  • After #644 (same deactivate_component.ex; defines the exit-date semantics)
## Description A member who is signed in (permission set `own_data`) can change every field of their own member record, not only their contact data. Reproduced on main a927a3a4: signed in as a member, a note was saved on the own record. What a member can change today: - all member fields: join date, exit date, notes, fee type (only to a type with the same interval), `membership_fee_start_date` (not in the form, but accepted by the action); - all own custom field values, including deleting them (e.g. IBAN, "SEPA mandate"); - "Reactivate" clears an exit date the board has set. Protected today: linking to a user account, deleting the member, fee cycles. Cause: `:update_member` accepts all `member_fields` plus fee fields (`lib/mv/membership/member.ex:129`); the `own_data` policy checks only the record scope `:linked` (`member.ex:244-248`, `lib/mv/authorization/permission_sets.ex:123-128`); the deactivate component offers reactivate to members (`lib/mv_web/live/member_live/show/deactivate_component.ex:31-49`). ## Proposal - A dedicated self-service update action for members that accepts only contact fields: first/last name, email, street, house number, postal code, city, country. Everything else is read-only for members. - Custom field values: members can neither create, change nor delete them until a per-field member-access setting exists (then the setting decides). Read access stays. - Members cannot deactivate or reactivate themselves. - The board/admin paths stay unchanged. ## Acceptance criteria - [ ] A member submitting forged params for exit date, join date, notes, fee type, `membership_fee_start_date` or any custom field gets them rejected; tests send the forged input through the LiveView and the action. - [ ] A member can still change their contact fields. - [ ] A member can no longer delete or change own custom field values. - [ ] Deactivate/reactivate is not offered to and not accepted from members. - [ ] Board and admin behavior unchanged (regression tests). ## Dependencies - None. Do first - After #644 (same deactivate_component.ex; defines the exit-date semantics)
simon closed this issue 2026-11-13 16:40:15 +01:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
local-it/mitgliederverwaltung#664
No description provided.