/

CVE-2026-23896

Severity:

HIGH RISK

(7.2)

Improper Privilege Management in Immich API Key Permission

CVE-2026-23896

Analyzed

Vulnerability type

Category:

Improper Privilege Management

CWE:

CWE-269

Impact:

Privilege Escalation to Administrative Access

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A privilege escalation flaw in Immich allows low-privilege API keys to update their own permissions using an exposed update endpoint.

When exploited, this behavior enables a non-admin API key to grant itself full administrative rights and take over management of the Immich instance.

Affected context

This vulnerability appears in Immich deployments where API keys are used to authenticate and authorize access to backend functionality.

The issue manifests specifically in the API key update endpoint, where the system does not adequately restrict which permissions an API key may assign to itself.

Environments that expose these management APIs to users or service integrations, especially over the network, are more likely to be at risk if a low-privilege key is compromised or misused.

Exploit preconditions

  • Attack surface: Immich API, specifically the API key update endpoint.
  • Required access: Possession of a valid but low-privilege API key.
  • Trigger point: Calling the API key update endpoint to modify the permissions associated with the same API key.
  • Why exploitation is possible: The authorization logic fails to distinguish between actions performed by privileged administrators and actions performed by low-privilege keys, allowing self-servicing of higher privileges without an independent privilege check.

Why this happens

The root cause is insufficient privilege enforcement when updating API key permissions, mapping to CWE-269: Improper Privilege Management.

Instead of enforcing a strict policy that only appropriately privileged identities (e.g., admins) may modify or grant high-level permissions, the system allows an API key to modify its own privilege set.

This design breaks the expected authorization boundary by trusting the caller's current identity without verifying that it is allowed to perform elevation-related operations.

Conceptually, the bug is that permission mutation operations are not guarded by privilege checks that are stronger than the permissions being requested.

Potential impact

  • A low-privilege API key can grant itself full administrative capabilities.
  • Unauthorized full control over user accounts, albums, photos, and videos.
  • Ability to change configuration, manage users, or alter system settings via admin-level endpoints.
  • Potential exposure, modification, or deletion of all stored media and associated metadata.
  • Use of the compromised instance as a foothold for broader infrastructure attacks if integrated with other systems.

General mitigation guidance

Effective mitigation focuses on enforcing strict authorization boundaries around permission-changing operations.

Recommended patterns include:

  • Require that only identities already holding high-level or administrative roles can modify API key permissions, especially for elevation to admin-equivalent scopes.
  • Implement server-side checks that compare the caller's current privileges against the requested changes, rejecting any operation that results in privilege elevation beyond the caller's own level.
  • Separate "self-management" actions (e.g., key rotation, description updates) from "privilege management" operations and apply stricter controls to the latter.
  • Apply the principle of least privilege by designing role and scope models where API keys are issued with the minimal required capabilities and cannot independently expand their scope.
  • Log and review all permission changes and administrative actions to discourage misuse and support incident response.

How teams detect issues like this

Detection can focus on both code-level patterns and runtime signals:

  • Static analysis and code review:
  • Identify endpoints that modify roles, scopes, or permissions and verify they enforce strict authorization checks beyond simple authentication.
  • Look for update or "self-service" APIs where the subject can modify attributes that directly control privilege level.
  • Flag any logic that ties authorization to "who is calling" without separately validating "what privilege level is required" for the operation.
  • Policy enforcement:
  • Define and enforce security policies requiring explicit privilege checks for role- or permission-changing operations.
  • Integrate automated checks into CI/CD pipelines to detect missing or inconsistent authorization decorators/middleware on sensitive endpoints.
  • Runtime monitoring:
  • Log all changes to API key permissions, including caller identity, previous scopes, and new scopes.
  • Alert on suspicious patterns, such as low-privilege keys acquiring admin-level permissions or frequent permission changes from the same key or IP.

Sources

SourceLink
github.comgithub.com/immich-app/immich/security/advisories/GHSA-237r-x578-h5mv

Frequently asked

questions

Yes, if an attacker can obtain or create a low-privilege API key and reach the Immich API over the network, they can abuse the update endpoint to escalate that key's permissions.

The attacker needs valid access via a low-privilege API key. No prior administrative rights are required; the flaw lies in the ability of that key to grant itself higher privileges.

Enforce strong, centralized authorization checks on any endpoint that changes roles, scopes, or permissions. Only identities that already have sufficient privilege (e.g., administrators) should be able to modify or grant elevated permissions, and self-service operations must never allow privilege escalation.

Adopt a consistent access-control design that distinguishes between authentication and authorization, require explicit privilege checks for all elevation-related actions, and include authorization-focused reviews in code reviews and security testing. Additionally, model roles and scopes conservatively so that even misconfigurations have limited blast radius.

Find out what's already
exploitable in your codebase.