T09 · Insecure Skill Coding Practices
- Location
utils.py:22- Finding
Insecure Storage and Transmission of Bearer Credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a TrailSnap photo CLI, but it can delete photos and overwrite local files without adequate safeguards while storing API tokens in plaintext.
Review carefully before installing. Use only a least-privilege TrailSnap token, avoid non-local HTTP endpoints, protect or rotate the token because it is stored in plaintext, and do not allow an agent to run photos delete or medias get --format file without explicit human approval and a safe output path.
utils.py:22Insecure Storage and Transmission of Bearer Credentials
commands/medias.py:43Caller-Controlled Media Output Path Allows Arbitrary File Overwrite
A skill presented as a viewing/query tool reportedly also supports photo deletion, which is a destructive operation inconsistent with user expectations. Hidden destructive capability raises the risk of accidental or unauthorized data loss if the skill is invoked under a read-only trust model.
A skill presented as a viewing/query tool reportedly also supports photo deletion, which is a destructive operation inconsistent with user expectations. Hidden destructive capability raises the risk of accidental or unauthorized data loss if the skill is invoked under a read-only trust model.
A skill presented as a viewing/query tool reportedly also supports photo deletion, which is a destructive operation inconsistent with user expectations. Hidden destructive capability raises the risk of accidental or unauthorized data loss if the skill is invoked under a read-only trust model.
A skill presented as a viewing/query tool reportedly also supports photo deletion, which is a destructive operation inconsistent with user expectations. Hidden destructive capability raises the risk of accidental or unauthorized data loss if the skill is invoked under a read-only trust model.
The skill metadata states this CLI is intended for querying and viewing photo-related information, but the code exposes a delete subcommand that performs a destructive action. This capability mismatch is dangerous because a caller, reviewer, or higher-level agent may trust the skill as read-only and invoke it in contexts where deletion is unexpected, enabling unauthorized or accidental data loss.
The delete handler directly issues a DELETE request for a user-supplied photo ID even though the skill is presented as a query/view tool. In agentic environments, unjustified destructive functionality increases the chance of misuse or prompt-confusion attacks leading to irreversible deletion of user content.
The examples document a destructive photos delete command even though the skill metadata presents the tool as a read/query interface for viewing photo and album information. This mismatch can mislead an agent or user into invoking deletion in a context where only non-destructive operations were expected, increasing the risk of unintended data loss.
The code stores and loads a bearer token from a plaintext .env file in the skill directory, which creates a credential exposure risk if the filesystem is readable by other local users, included in backups, or accidentally committed to source control. In this skill context, the token grants access to TrailSnap API data, so compromise could expose photo, album, location, and people metadata.
from pathlib import Path
from urllib.parse import urlencode
ENV_FILE = Path(__file__).parent / ".env"
def load_env():
if not ENV_FILE.exists():
The skill advertises executable CLI behavior with file read, file write, and network access, but does not declare any tool scope or permission boundaries. This increases the chance that an agent can invoke broader capabilities than users expect, especially since the skill also configures credentials and persists them locally.
The skill instructs users to store an API token in a local .env file without guidance on file permissions, secure storage, rotation, or avoiding accidental disclosure. Tokens stored this way are at risk of being read by other tools, committed to source control, or exposed through logs and backups.
The manifest says the skill is used to query photos, albums, tags, locations, and people information. This file adds a config set command that accepts an API URL and bearer token and persists them via save_env, which is configuration/credential management rather than querying photo data.
The command accepts an API token and immediately persists it via save_env(args.url, args.token) without any visible confirmation prompt, print/log message, or inline comment/docstring explaining that credentials will be written to storage. For a code file, storing sensitive credentials without any user disclosure matches the missing user warning criterion.
The skill's user-facing help text and status messages are written only in Chinese, which imposes a specific language on users without any opt-in, fallback, or documented regional restriction. This matches the policy category for language/locale constraints in natural-language content within code files.
The CLI help text and status messages are written exclusively in Chinese, which imposes a specific language on all users with no opt-in or fallback. Under the stated policy, forcing a specific language without user choice is a natural-language policy violation unless the locale limitation is explicitly justified.
This code sends user-supplied location timeline and date-range parameters to backend endpoints via make_request, but there is no confirmation prompt, warning message, or explanatory comment indicating that potentially sensitive location-related data will be transmitted. Because location history is privacy-sensitive, the absence of any user disclosure is a quality/safety concern for a code file.
The manifest describes a CLI for querying photos, albums, tags, locations, and people information, which implies read/query operations. This command includes a file output mode that downloads raw media content and writes it to an arbitrary local path, going beyond simply viewing or querying metadata/data in the CLI output.
The skill's stated purpose is to query and view photo and album information. Allowing the caller to provide any output path and writing downloaded bytes there introduces a filesystem write capability that is not obviously required for a query-focused CLI.
This code performs a file write operation when format == "file", but there is no warning, confirmation, or pre-action user-facing disclosure that data will be saved to the provided path. The only message appears after the write completes, which does not warn the user before affecting the filesystem.
The command help text and user-facing messages are written in Chinese throughout the file, with no indication that the skill is region-specific or that users can choose another language. This creates a natural-language locale policy concern because the skill enforces a specific language without opt-in.
The code performs photo deletion immediately without any warning, dry-run, or confirmation step. That makes accidental invocation or unsafe agent behavior more likely to cause irreversible loss, especially when commands may be composed from ambiguous user instructions.
The documentation exposes a destructive delete operation without any warning, confirmation step, or note about irreversible consequences. In an agent setting, examples strongly influence tool use, so presenting deletion as a routine command can cause accidental execution and permanent removal of user photos.
The skill is described as a query/viewing tool, but its documented command set also includes photos delete, which expands it from read-only access into destructive capability. This mismatch can cause an agent or user to invoke a deletion action in a context where only retrieval was expected, increasing the risk of unintended data loss.
Documenting a delete command without any warning, confirmation, or safety note makes accidental destructive use more likely, especially when consumed by automation or an agent. In this skill's context, photo deletion is more dangerous because the tool otherwise appears oriented toward information retrieval, so a mutating operation may be invoked without appropriate caution.
The config set operation accepts an API URL and bearer token, but the manifest gives no warning that credentials may be stored locally or transmitted to a remote server. This can lead users or agents to handle secrets unsafely, especially if pointed at non-HTTPS endpoints such as the provided http://localhost:8000 example pattern.
The manifest exposes a destructive photos delete capability and even includes an example invocation, but provides no warning, confirmation requirement, or indication that this operation is irreversible. In an agent setting, this increases the chance of accidental or prompt-induced destructive actions against user photo data.
No suspicious patterns detected.