Summary
Seerr's ImageProxy can construct cache filenames from upstream HTTP response headers without sufficiently restricting their path components. A malicious or compromised media server, or an attacker able to alter an unencrypted media-server connection, may cause files outside the cache directory to be overwritten and code to execute after a subsequent container restart.
Affected context
The issue occurs in Seerr deployments using the ImageProxy functionality and an unauthenticated avatar proxy request. It becomes risky when upstream Jellyfin or Emby responses provide attacker-controlled or tampered ETag or Content-Type header values that are incorporated into cache paths. Plaintext connections increase exposure to in-transit manipulation, while a compromised upstream server can provide malicious headers directly.
Exploit preconditions
- Attack surface: The unauthenticated
GET /avatarproxy/:jellyfinUserIdImageProxy route - Required access: Control of, compromise of, or man-in-the-middle access to the configured Jellyfin or Emby connection
- Trigger point: Processing and caching an upstream image response
- Why exploitation is possible: Header-derived filename components are combined into a filesystem path and normalized by path and file-writing APIs without an adequate containment check
Why this happens
The underlying bug is a path construction and file-write validation failure. Seerr uses upstream ETag and Content-Type header values when forming a cache filename, but attacker-controlled path components can be interpreted by filesystem APIs as directory traversal. Because the resulting path is not reliably constrained to the intended cache directory, a response can cause an arbitrary file write. This maps primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, with a related CWE-94: Improper Control of Generation of Code consequence when an overwritten application file is later loaded or executed.
Potential impact
- An attacker may overwrite application or configuration files
- The Seerr process may experience altered behavior or denial of service
- Arbitrary code could execute with the privileges of the Node.js user after a restart
- Application secrets or connected media-server data could be exposed
- A compromised container could be used for further lateral movement, depending on its permissions
General mitigation guidance
Mitigation generally focuses on treating all upstream response metadata as untrusted and enforcing filesystem containment.
Common defensive patterns include:
- Generate cache filenames from trusted, fixed-format identifiers or cryptographic digests rather than raw headers
- Reject path separators, traversal markers, absolute paths, and other filesystem-significant characters before path construction
- Resolve candidate paths and verify that they remain beneath the intended cache directory before writing
- Use a dedicated cache directory with restrictive permissions and avoid writing to application code locations
- Prefer encrypted and authenticated connections to media servers to reduce in-transit manipulation
- Run the service with the least privileges needed and use read-only application filesystems where practical
- Separate writable cache storage from executable application directories
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying path construction from HTTP headers, URLs, or other external metadata
- Code review checks for
path.join,resolve, or file-write operations involving untrusted values - Tests that verify canonicalized paths remain within an intended directory
- Runtime monitoring for writes outside approved cache locations
- File-integrity monitoring on application bundles and startup scripts
- Network policy checks that flag plaintext connections to trusted media-server backends
- Automated security review tools that identify tainted data flowing into filesystem APIs

