CVE-2026-40605
Tautulli path traversal allows authenticated users to delete directories.
- CVSS 5.7
- CWE-22
- Input Validation and Sanitization
- Remote
Tautulli is a Python based monitoring and tracking tool for Plex Media Server. Prior to version 2.17.1, a path traversal vulnerability in the cache deletion endpoint allows authenticated API access to delete directories outside the configured cache path. This can cause arbitrary data loss and service disruption. Version 2.17.1 fixes the issue.
- CWE
- CWE-22
- CVSS base score
- 5.7
- Published
- 2026-06-04
- OWASP
- A01 Broken Access Control
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Path Traversal
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- Tautulli
- Fixed by upgrading
- Yes
Solution
Upgrade Tautulli to version 2.17.1 or later.
Vulnerable code sample
import os
import shutil
class PlexAPI:
def __init__(self, cache_dir):
self.cache_dir = cache_dir
def delete_cache(self, **kwargs):
if 'dir' in kwargs:
# The 'dir' parameter is taken directly from user-controlled input
# and joined with the base cache directory without sanitization.
cache_dir = os.path.join(self.cache_dir, kwargs.get('dir'))
# An attacker can use path traversal sequences (e.g., '..') in the
# 'dir' parameter to target directories outside of self.cache_dir.
if os.path.isdir(cache_dir):
# If the constructed path is a valid directory, it is deleted.
shutil.rmtree(cache_dir)
return True
return FalsePatched code sample
import os
import shutil
# The configured base directory for the cache.
BASE_CACHE_DIR = "/opt/tautulli/cache"
def fixed_delete_cache_directory(directory_name: str):
"""
Safely deletes a subdirectory within the cache, preventing path traversal.
This represents the fixed logic for the vulnerability.
"""
# Resolve the canonical path of the base directory to prevent symlink issues.
real_base_dir = os.path.realpath(BASE_CACHE_DIR)
# Create the full path to the user-requested directory.
# At this point, the path is still potentially unsafe.
# e.g., /opt/tautulli/cache/../../etc
unsafe_path = os.path.join(real_base_dir, directory_name)
# Resolve the full path to its canonical form, collapsing any '..' parts.
# e.g., /opt/tautulli/cache/../../etc becomes /etc
real_path_to_delete = os.path.realpath(unsafe_path)
# --- VULNERABILITY FIX ---
# Check if the fully resolved path is a sub-path of the real base directory.
# os.path.commonpath will return the longest common sub-path. If it's not
# equal to the base directory, the path has escaped. We also prevent
# deletion of the base directory itself.
if (os.path.commonpath([real_base_dir, real_path_to_delete]) == real_base_dir
and real_path_to_delete != real_base_dir):
# If the path is safe and is a directory, proceed with deletion.
if os.path.isdir(real_path_to_delete):
# In the actual application, this line would be active.
# shutil.rmtree(real_path_to_delete)
pass
else:
# The path is outside the allowed directory or is the base directory.
# Silently block the operation and do nothing.
passPayload
/api/v2?cmd=delete_cache&folder=../../../../../../../../etc&apikey=YOUR_API_KEY
Cite this entry
@misc{vaitp:cve202640605,
title = {{Tautulli path traversal allows authenticated users to delete directories.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-40605},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-40605/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
