From 96e11107b5a38a634e03fa20ae357ab4e3026564 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Tue, 31 May 2022 17:28:33 +0200 Subject: [PATCH] jellyfin: fix permissions on state directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, all configuration and state data was accessible to all users on the system running jellyfin. This included user passwords in the Jellyfin database, as well as credentials for LDAP if configured. The exact set of accessible data depends on system configuration. Thanks to Sofie Finnes Øvrelid for reporting this issue. Fixes: CVE-2022-32198 Co-Authored-By: Martin Weinelt (cherry picked from commit 7eab23d517cfd3a2e8d40e0d72cdb8fb0969bf9a) --- nixos/modules/services/misc/jellyfin.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/modules/services/misc/jellyfin.nix b/nixos/modules/services/misc/jellyfin.nix index 04cf82f8a46b..789b78702e9b 100644 --- a/nixos/modules/services/misc/jellyfin.nix +++ b/nixos/modules/services/misc/jellyfin.nix @@ -53,7 +53,10 @@ in User = cfg.user; Group = cfg.group; StateDirectory = "jellyfin"; + StateDirectoryMode = "0700"; CacheDirectory = "jellyfin"; + CacheDirectoryMode = "0700"; + UMask = "0077"; ExecStart = "${cfg.package}/bin/jellyfin --datadir '/var/lib/${StateDirectory}' --cachedir '/var/cache/${CacheDirectory}'"; Restart = "on-failure";