Summary
Immich contains a broken access control issue in the album membership update endpoint that lets non-owner editors change user roles without proper owner-only restrictions.
An attacker with editor access to a shared album can demote the current owner and promote themselves to owner over sequential requests, ultimately gaining full control over the album and its membership.
Affected context
This vulnerability appears in Immich deployments that expose the PUT /albums/:id/user/:userId endpoint for managing album membership and roles.
It is relevant when shared albums have multiple members with editor permissions and the backend does not enforce strict role-based constraints on who can modify ownership or change member privileges.
The issue is most pronounced in collaborative or family/shared photo library scenarios where editors are expected to have limited rights compared to owners but still retain access to album management APIs.
Exploit preconditions
- Attack surface: HTTP API endpoint
PUT /albums/:id/user/:userIdwithin the Immich backend. - Required access: Valid authenticated user with editor-level access to a shared album where another user is designated as owner.
- Trigger point: Sending crafted role-change requests targeting album members, including the current owner, to modify their role assignments.
- Why exploitation is possible: The access control logic fails to enforce that only the album owner (or a higher-privileged role) can modify ownership-related fields, allowing editors to perform role changes that should be restricted.
Why this happens
The root cause is insufficient authorization checks on a sensitive role-management endpoint, mapping directly to CWE-863: Incorrect Authorization.
The backend treats editor-level users as authorized to modify album member roles, including ownership changes, without differentiating between operations that should be owner-only and those that editors may legitimately perform.
Abstractly, this reflects a pattern where a generic "can edit album" permission is reused for privileged operations such as demoting owners and promoting other accounts, rather than implementing granular checks tied to the specific action being performed.
Potential impact
- An editor can promote their own account to album owner and demote or evict the original owner.
- Attackers may gain full control over shared album content, including deletion of photos and metadata.
- Legitimate owners could lose visibility or access to their albums if removed or downgraded.
- In multi-tenant or shared environments, this could facilitate social engineering or account takeover scenarios centered around content control.
General mitigation guidance
Effective mitigation focuses on reinforcing authorization boundaries around role changes and ownership management.
Typical defensive patterns include:
- Implementing explicit authorization checks that restrict ownership and role modification actions to the current album owner or an application-wide administrator role.
- Separating "content editing" permissions from "membership and role management" permissions, ensuring editors cannot alter privileged roles.
- Validating requested role transitions against a server-side policy that disallows demoting the sole owner or promotes only under controlled conditions.
- Logging and auditing ownership changes to help detect anomalous role transitions and support rollback mechanisms.
How teams detect issues like this
Detection generally involves both preventive and retrospective techniques:
- Static or unit tests asserting that only owner or admin roles can invoke role-changing logic in the album membership controller or service layer.
- Code reviews focused on authorization middleware usage and ensuring that role-management routes require stronger privileges than content editing routes.
- Policy-based checks that flag endpoints modifying
role,owner, or membership state where authorization guards are weak, missing, or reused from lower-privilege actions. - Runtime monitoring and audit trails for sudden ownership flips, especially when executed by non-owner accounts, allowing security teams to investigate and remediate misuse.

