Immich Stored XSS to API Key Exfiltration and Account Hijacking (CVE-2026-35455)
by emanuelepns · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-35455
- Category
- web
- Affected product
- Immich (self-hosted photo/video management)
- Affected versions
- Not specified in source
- Disclosed
- 2026-07-05
- Patch status
- unpatched
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-05 |
| Author / Researcher | emanuelepns |
| CVE / Advisory | CVE-2026-35455 |
| Category | web |
| Severity | High |
| CVSS Score | Not specified in source |
| Status | Weaponized |
| Tags | immich, stored-xss, exfiltration, api-key-theft, account-hijacking, self-hosted-photos, c2 |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Immich (self-hosted photo/video management) |
| Versions Affected | Not specified in source |
| Language / Platform | Python C2 server + JS payload |
| Authentication Required | No (victim must view attacker-controlled content) |
| Network Access Required | Yes |
Summary
A stored XSS vulnerability in Immich allows an attacker to inject a malicious script (via a photo/asset field) that executes in a victim’s authenticated session. The included demo automates generation of a new API key from within the hijacked session and exfiltrates it to an attacker-controlled C2 server, resulting in full, persistent unauthorized access to the victim’s Immich account.
Vulnerability Details
Root Cause
User-controlled content rendered in the Immich UI is not properly sanitized, allowing stored JavaScript execution in the context of a victim’s authenticated session.
Attack Vector
- Inject a malicious payload into an Immich field that gets rendered without sanitization (e.g. via a shared asset).
- When the victim views the affected content, the payload executes in their authenticated browser session.
- The payload calls Immich’s API to generate a new long-lived API key and exfiltrates it to the attacker’s C2 server.
- The attacker uses the stolen API key for persistent, unauthorized account access.
Impact
Full account takeover and persistent unauthorized access to a victim’s Immich instance via a single stored-XSS interaction.
Environment / Lab Setup
Target: A self-hosted Immich instance
Attacker: Docker (C2 server + Caddy reverse proxy), a victim browser session
Proof of Concept
PoC Script
See
server.pyandtomas.jsin this folder.
| |
Runs a local C2 server that receives exfiltrated API keys from the injected tomas.js payload once a victim’s session executes it, demonstrating end-to-end account hijacking.
Detection & Indicators of Compromise
Signs of compromise:
- New API keys created without a corresponding user-initiated settings action
- Unusual outbound network requests from the Immich web client
Remediation
| Action | Detail |
|---|---|
| Primary fix | Apply the Immich vendor patch addressing the stored XSS once available — monitor project advisories |
| Interim mitigation | Sanitize/encode all user-controlled fields rendered in the Immich UI; enforce a strict Content-Security-Policy |
References
Notes
Mirrored from https://github.com/emanuelepns/immich-exfiltration-demo on 2026-07-05.
| |