/

CVE-2026-53662

Severity:

CRITICAL RISK

(9.6)

Reflected XSS (CWE-79) in Immich Auth Login Flow

CVE-2026-53662

Deferred

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79, CWE-601

Impact:

Account Takeover and Privilege Abuse

Severity:

CRITICAL RISK

(9.6)

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 reflected cross-site scripting vulnerability in Immich's /auth/login flow allows attacker-controlled JavaScript to execute in the application's origin via a crafted continue URL parameter.

When a victim clicks a malicious login link while authenticated, the injected script can abuse their existing session to mint all-permission API keys and fully compromise their account.

Affected context

The issue occurs in Immich deployments that use the affected commits and expose the /auth/login page to users.

It manifests when the continue query parameter from the URL is passed directly into SvelteKit's redirect() logic without validating scheme, origin, or content.

This context is most risky when users are already authenticated and can be induced to follow attacker-controlled login links, such as through phishing, chat messages, or embedded redirects.

Exploit preconditions

  • Attack surface: Public-facing /auth/login endpoint in the Immich web UI.
  • Required access: Ability to convince a logged-in user to click a crafted URL containing a malicious continue parameter.
  • Trigger point: Processing of the continue query parameter during the login flow and its use in SvelteKit's redirect() call.
  • Why exploitation is possible: The application trusts the continue parameter and uses it in redirect logic without validating scheme or origin, enabling attacker-controlled script execution within Immich's origin and under the victim's authenticated session.

Why this happens

The root cause is insufficient validation of user-controlled data used in redirect and navigation logic.

Specifically, the continue query parameter from the request URL is treated as a trusted redirect target and passed directly into SvelteKit's redirect() function, with no scheme, origin, or content checks.

This behavior aligns with CWE-79 (Improper Neutralization of Input During Web Page Generation) and CWE-601 (Open Redirect) because untrusted input influences the client's navigation in a way that can inject executable script into the application context.

The insecure pattern is relying on client-side redirects driven by unvalidated query parameters, effectively allowing an attacker to control where and how the browser executes code under the site's origin.

Potential impact

  • An attacker may execute arbitrary JavaScript in the victim's browser under Immich's origin.
  • An attacker could mint all-permission API keys using the victim's existing authenticated session.
  • The attacker may gain persistent access to the victim's account and stored media.
  • An attacker could perform privileged actions such as modifying settings, accessing private albums, or sharing content as the victim.
  • The vulnerability can be used as a building block for broader lateral movement within environments that trust Immich API keys.

General mitigation guidance

Effective mitigation centers on reducing trust in user-controlled redirect parameters and preventing script execution through them.

Common defensive patterns include:

  • Validating redirect targets against a strict allowlist of internal paths, rejecting any external schemes, origins, or malformed values.
  • Avoiding direct use of query parameters in redirect logic without normalization and canonicalization.
  • Ensuring that any data used in client-side navigation is encoded and treated as data, not executable content.
  • Implementing robust output encoding in templates and components that render URL-derived values.
  • Applying least-privilege principles to API keys and session actions so that a single compromised session cannot mint unconstrained credentials.

How teams detect issues like this

Detection usually combines review of redirect logic and analysis of user-controlled parameters:

  • Static analysis rules targeting open redirect and XSS sinks, such as functions that perform redirects or manipulate location based on query parameters.
  • Code review practices that flag direct usage of request parameters (e.g., continue, next, returnUrl) in redirect or navigation flows without validation or allowlisting.
  • Security-focused linting or automated tooling configured to detect unvalidated redirect targets and unencoded template outputs.
  • Runtime monitoring of unusual redirect patterns and suspicious query parameters in authentication-related endpoints.
  • Policy enforcement requiring explicit validation functions or helpers for all redirect parameters in web applications.

Sources

SourceLink
github.comgithub.com/immich-app/immich/commit/4eb100327ea5da2e90381b96809f1f1cc51cc7e3
github.comgithub.com/immich-app/immich/security/advisories/GHSA-8244-8vpr-vp9c

Frequently asked

questions

It can impact any user account in an affected Immich deployment if the user is authenticated and can be tricked into clicking a crafted login link. The attack scales with the attacker's ability to distribute such links (for example, via phishing or social engineering).

The attacker only needs the ability to send or host a malicious URL and persuade a logged-in user to visit it. No prior access to the server or user credentials is required, but the user must have an active session for account takeover to succeed.

The most robust fix is to strictly validate the continue parameter against a whitelist of expected internal paths, rejecting or sanitizing any value that does not match. Additionally, avoid using raw query parameters in redirect logic and ensure that any data influencing page generation is properly encoded or normalized.

Adopt a standard redirect-handling utility that enforces allowlisted destinations, integrate XSS and open-redirect checks into code review, and use automated security testing tools to scan for unvalidated redirect parameters and unsafe output handling in authentication flows.

Find out what's already
exploitable in your codebase.