[security] Mass assignment fix sweep
fix: [security] Mass assignment fix sweep
[security] Mass assignment fix sweep831142-fix-security-mass-assignment-fix-sweep-cve-2026-56422fixsecurity mass assignment fix sweep
Committed by iglocska
commit message
fix: [security] Mass assignment fix sweep
CollectionsController::edit() — sharing-group authorisation parity gap.
The distribution=4 sharing-group access check (checkIfCanBeUsed) only ran
when 'distribution' was present in the request body. CRUDComponent::edit()
retains the stored value for any field the request omits and applies no
fields whitelist here, so a perm_modify user editing their own collection
could retarget an existing distribution=4 collection onto a sharing group
they are NOT authorised to use simply by omitting 'distribution' (it stays
4 from the stored record) while mass-assigning sharing_group_id. The add
path correctly gates the SG on create; this restores parity on edit (same
class as the EventReports editReport fix ab9619dfa).
Fix: validate the EFFECTIVE distribution (body value if present, else the
stored value) and run checkIfCanBeUsed against the effective sharing group
whenever the effective distribution is 4 and the request actually changes
the distribution or the sharing group. An untouched SG on an unrelated edit
is left as-is so a legitimate owner can still edit other fields without the
check firing on a now-unauthorised stale SG. REST-reachable, so CSRF
field-hashing is irrelevant.
Live before/after proven: org-531 user (not a member of SG 19) re-scoped
their collection to SG 19 pre-fix; post-fix the same request is rejected
with "Invalid Sharing Group or not authorised." and the stored SG is
preserved; legit name-only / authorised-SG / distribution-downgrade edits
still succeed.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>Editor assessment
This commit patches CVE-2026-56422. The body explains a subtle parity gap in CollectionsController::edit(): the sharing-group check ran only when distribution appeared in the body, so a user could mass-assign sharing_group_id while omitting the field and leave the stored value at four. It then describes validating the effective distribution and running checkIfCanBeUsed against the effective group, and carefully notes that untouched groups on unrelated edits stay allowed. The rejection message and the legitimate-edit cases in the live proof show thorough verification. Clear reasoning, long but organized, with the audit-style title as its main flaw.