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

[HIGH] H6: updateUserGroups precedence bug — group removal never runs, users accumulate groups forever #338

Description

@rubenvdlinde

Severity: HIGH

Location: lib/Controller/ContactpersonenController.php lines 598–710, specifically line 628

Description:
updateUserGroups contains a precedence bug in the in_array call:

in_array(needle: $group->getGID() === true, haystack: $allowedGroups)

The === operator has higher precedence than the function arguments, so needle evaluates to the boolean result of $group->getGID() === true, which is always false. $curCatalogGroups is therefore always an empty array, and the removal-from-groups branch never executes. Users continuously accumulate group memberships with no way for the system to revoke them.

Suggested fix:

in_array(needle: $group->getGID(), haystack: $allowedGroups) === true

Source: deep team-reviewer pass 2026-05-27

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions