An authorization flaw exists in the `checkIfAuthorisedExtend()` function within the SharingGroup model. The system incorrectly grants users with the `perm sync` role an exemption from the extend flag requirement when modifying sharing group membership for all groups, including those created locally (`local = 1`). This exemption should only apply to groups received via sync from other instances (`local = 0`). Consequently, an authenticated user with `perm sync` and `perm sharing group` roles who is a member of a locally-created group without the extend flag can bypass authorization to add or remove organizations and servers from that group. This allows unauthorized modification of sharing group memberships, potentially enabling an attacker to gain access to shared indicators or disrupt data exchange between organizations.