T09 · Insecure Skill Coding Practices
- Location
scripts/plex_cli.py:17- Finding
Predictable Shared Temporary Cache Permits Metadata Disclosure, Cache Poisoning, and Symlink Attacks
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Plex skill is mostly purpose-aligned, but it caches detailed private library metadata in a predictable shared temp file while describing that caching too narrowly.
Review this before installing if your Plex library contents are private. Use a limited Plex token if possible, avoid running it on shared machines, and clear or relocate the cache until the skill uses a private per-user cache directory with restrictive permissions and clearer retention controls.
scripts/plex_cli.py:17Predictable Shared Temporary Cache Permits Metadata Disclosure, Cache Poisoning, and Symlink Attacks
scripts/plex_cli.py:2Automatically Resolved Plex Dependency Is Not Version-Pinned
metadata.json:18Privacy Documentation Understates the Scope and Retention of Cached Plex Metadata
The description is broadly aligned with the main purpose: this is indeed a standalone command-line Plex management tool with playback controls and temporary caching in the system temp directory. However, the declared permissions are empty, while the code clearly requires network access to a Plex server, reads sensitive connection credentials from environment variables, and performs substantial metadata access and local caching. It also exposes additional management and monitoring capabilities—listing libraries, sessions, clients, server info, and continue-watching data—that are not mentioned in the description. These are material undeclared capabilities/resources rather than mere implementation details, so this should be flagged as a mismatch.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
from plexapi.server import PlexServer
# ClawHub security warning remediation:
# 1. We no longer use .env files (assumes environment variables are injected by the agent).
# 2. Cache is now stored in the system temp directory to avoid persistent file tracking in the skill folder.
CACHE_FILE = os.path.join(tempfile.gettempdir(), "plex_media_cache.json")
The skill declares access to sensitive environment variables and describes local caching, but it does not define an explicit tool scope such as permissions or allowed-tools. In an agent setting, missing scope boundaries increases the chance of unintended file access, credential handling, or writes beyond what operators expect, especially because the skill uses env, file_read, and file_write capabilities.
The CLI exposes state-changing playback actions (play, pause, resume, stop) that execute immediately against named Plex clients with no confirmation, policy check, or access control beyond possession of the Plex token. In an agent context, this increases the risk of unintended or unauthorized commands affecting active user sessions and devices, especially if natural-language requests are misinterpreted or the skill is invoked indirectly.