Summary
Jellyfin before 12.0 has a path traversal vulnerability in virtual-folder endpoints that use unvalidated library names in filesystem operations. An unauthenticated attacker who can reach the endpoints before setup completes may be able to move or recursively delete directories, including the data directory and jellyfin.db.
Affected context
The issue occurs in Jellyfin's DELETE /Library/VirtualFolders and POST /Library/VirtualFolders/Name endpoints when library names are used in filesystem operations without adequate path validation. The described risk applies before setup completes, when an unauthenticated attacker can reach these endpoints.
Exploit preconditions
- Attack surface: The virtual-folder HTTP endpoints
- Required access: No authentication is required under the described conditions
- Trigger point: A request to either affected endpoint before setup completes
- Why exploitation is possible: Unvalidated library names may be interpreted as traversal paths or absolute paths during filesystem operations
Why this happens
The underlying issue is insufficient validation and containment of user-controlled path components. When a library name is incorporated into a filesystem path without ensuring that the resolved path stays within an intended directory, traversal sequences or absolute paths can direct file operations elsewhere. This is a path traversal weakness mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.
Potential impact
- An attacker may move or delete directories outside the intended library location.
- Recursive deletion could remove Jellyfin's data directory or
jellyfin.db. - The service could become unavailable or lose application data.
General mitigation guidance
Defensive approaches include validating library names against a strict allowlist and rejecting path separators, traversal components, and absolute paths. Resolve candidate paths and verify they remain within an explicitly designated base directory before performing filesystem operations. Prefer APIs and designs that operate on constrained identifiers rather than user-supplied paths, and limit the service account's filesystem permissions to reduce potential damage.
How teams detect issues like this
Review filesystem operations in virtual-folder handlers for user-controlled values used in path construction, deletion, or movement. Static analysis can flag path joins and file operations that lack canonicalization and base-directory containment checks. Code review and security tests can verify rejection of traversal-like names and confirm that operations remain confined to intended directories. Policy checks can also require path validation before filesystem access.

