Summary
Jellyfin media server versions prior to 10.11.7 contain a vulnerability chain in the subtitle upload endpoint that allows user-controlled file paths and extensions to be written outside the intended subtitles directory.
An authenticated user with subtitle upload permissions can abuse this to perform arbitrary file writes, pivot to arbitrary file reads, extract the database, escalate to admin, and ultimately achieve remote code execution as root.
Affected context
The vulnerability occurs in Jellyfin's subtitle upload functionality (POST /Videos/{itemId}/Subtitles), where the Format field influences the resulting file extension and path handling.
It manifests when the server accepts user-supplied subtitle metadata without sufficient validation or canonicalization of the target path and file extension.
Deployments that grant subtitle upload permissions to administrator accounts or delegated users, and that run Jellyfin with elevated OS privileges (e.g., root), are particularly exposed to this issue.
Exploit preconditions
- Attack surface: HTTP API for subtitle uploads (
/Videos/{itemId}/Subtitles). - Required access: An authenticated account with the "Upload Subtitles" permission (typically an administrator, or a user explicitly granted this capability).
- Trigger point: Submission of a crafted subtitle upload request where the
Format(and related file naming) induces traversal outside the intended directory and writes attacker-controlled content. - Why exploitation is possible: The server fails to rigorously validate or normalize the file extension and resolved filesystem path derived from user input, allowing directory traversal and arbitrary file placement, which can then be chained into file read, database extraction, privilege escalation, and RCE.
Why this happens
The core issue is insufficient validation and normalization of user-controlled path components when constructing filesystem locations for uploaded subtitle files.
By allowing the Format value (and related fields) to influence the effective file extension and path without robust checks, the code permits traversal sequences and unintended directory targets, aligning with CWE-22: Path Traversal and CWE-20: Improper Input Validation.
Additionally, inadequate sanitization and normalization of file types and extensions (e.g., failure to strip or canonicalize crafted values) reflect CWE-187: Partial String Comparison, where incomplete or naive checks on user input give a false sense of safety.
In abstract terms, any feature that persists user-supplied content to disk, but derives the destination path or filename directly from request fields without strict whitelisting and canonical path enforcement, is susceptible to this class of bug.
Potential impact
- Arbitrary file write within the Jellyfin server's filesystem context.
- Arbitrary file read via crafted
.strmfiles referencing attacker-chosen paths. - Extraction of Jellyfin's database, potentially revealing user accounts, tokens, and configuration secrets.
- Privilege escalation from a non-admin account to administrative control of the Jellyfin instance.
- Remote code execution on the underlying host, potentially as root, for example via modification of sensitive loader configuration such as
ld.so.preload. - Full compromise of the media server, lateral movement to other services, and persistent backdoors.
General mitigation guidance
Effective mitigation focuses on eliminating unsafe path handling and constraining what uploaded subtitles can do at the filesystem layer.
Pattern-based defensive measures include:
- Strict path whitelisting: Derive subtitle storage paths solely from server-side configuration and fixed directory roots, never directly from user input.
- Extension whitelisting: Validate the
Formatfield and any derived filename against a strict allowlist of known-safe subtitle formats (e.g.,.srt,.ass,.vtt) using exact matches, not partial string checks. - Canonicalization and enforcement: Resolve the final path to its canonical form and verify that it remains within the intended subtitles directory before writing; reject any request that escapes the allowed root.
- Separated privileges: Run Jellyfin under a dedicated, least-privileged OS account without access to sensitive system files or loader configuration, and avoid running it as root.
- Defense-in-depth controls: Use filesystem permissions, containers, or sandboxes to limit the impact of a compromise, and consider read-only mounts for sensitive directories that should never be modified by the application.
- Permission minimization: Grant subtitle upload permissions only to accounts that genuinely require them, and regularly review role assignments.
How teams detect issues like this
Organizations can approach detection by combining code-level review with behavioral monitoring:
- Static analysis: Configure rules to flag uses of user-controlled data in file path construction, especially where concatenation or interpolation is used to build filesystem paths without validation or canonicalization.
- Code review signals: During manual review, pay attention to upload endpoints and media handling code that:
- Accepts file format, extension, or path segments from the client.
- Does not enforce strict allowlists or canonical path checks.
- Uses partial matches (e.g.,
contains,startsWith) to validate file types instead of exact comparisons. - Policy enforcement: Integrate secure coding guidelines and automated checks in CI/CD to prevent new path traversal patterns or arbitrary file writes from being introduced.
- Runtime monitoring: Log subtitle upload actions and filesystem errors, and monitor for uploads resulting in unexpected paths or file types; alerts can be triggered when uploads correspond to non-subtitle extensions or sensitive directories.

