T09 · Insecure Skill Coding Practices
- Location
scripts/save_persona.py:89- Finding
Path Traversal Through Username Allows Writes Outside the Persona Directory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill has a coherent persona-generation purpose, but it handles private conversation history and persona files with unsafe scoping and file handling that warrants review before installation.
Install only if you are comfortable letting the skill read local memory files, send sampled conversation text through the model for style analysis, and store a reusable persona profile. Before wider use, the publisher should validate usernames, enforce persona-directory containment, replace predictable /tmp files with secure temporary handling or in-memory transfer, clean up raw message data, require explicit consent before profiling, and disclose or restrict real-person style imitation.
scripts/save_persona.py:89Path Traversal Through Username Allows Writes Outside the Persona Directory
scripts/forget.py:24Path Traversal Allows Files Outside the Persona Directory to Be Reset or Deleted
scripts/analyze.py:74Untrusted Memory Content Can Poison Generated Role-Play Instructions
scripts/analyze.py:137Predictable Shared Temporary Files Expose Conversation Data and Permit Cross-Run Interference
A second description/behavior mismatch is present: the skill promises persona creation, refresh, reset, and role-play support, but the analyzed behavior does not implement those flows as described. Such inconsistencies can hide unintended data processing paths or cause the agent to operate under false assumptions about state and user authorization.
A second description/behavior mismatch is present: the skill promises persona creation, refresh, reset, and role-play support, but the analyzed behavior does not implement those flows as described. Such inconsistencies can hide unintended data processing paths or cause the agent to operate under false assumptions about state and user authorization.
The role-play mode constructs a hidden impersonation workflow that tells the model to imitate a named user's style while explicitly not revealing the imitation. This enables deceptive impersonation, increasing the risk of social engineering, fraudulent messages, reputational harm, and misuse of a profile derived from private historical conversations.
The skill instructs the agent to read from memory/ and write persona artifacts and temporary files, but it declares no explicit tool scope or permissions. This creates unnecessary ambiguity about what file operations are authorized and increases the chance of over-broad access or unsafe execution in hosts that infer capabilities implicitly.
The skill directs analysis of historical conversations to derive and persist a user-specific persona profile. Even if intended as a feature, this is privacy-sensitive profiling because it transforms prior chats into a reusable behavioral dossier, which may exceed user expectations unless informed consent, minimization, and retention controls are in place.
Using a broad everyday trigger like "persona" can activate the skill in unrelated conversations. In this skill, accidental activation is more sensitive because it may prompt inspection of historical memory and creation of a user profile, causing unintended privacy-affecting behavior.
Passing prompts built from memory-derived content directly back into the LLM creates a prompt-injection and privacy boundary issue. Historical messages may contain adversarial instructions or sensitive content that the model then reinterprets during analysis, potentially leading to unsafe output, leakage, or manipulation of the generated profile.
The standalone trigger term "refresh" is overly vague and may match routine user language. Because refresh here can initiate memory-based analysis and profile updates, accidental triggering could lead to unintended processing of conversation history.
The JSON template hard-codes the emoji frequency field to Chinese values ("低|中|高") rather than using a locale-neutral schema or offering language choice. This can violate language/locale policy because it imposes a specific language in a general-purpose persona file with no documented opt-in or regional justification.
The prompt builder forwards user messages verbatim into the LLM input, which means private historical content is reproduced and sent onward for processing. In a persona-generation skill this is functionally related to the feature, but it still increases privacy risk because unnecessary verbatim retention and broad prompt inclusion can leak sensitive content to logs, downstream systems, or model providers.
The function writes the full prompt, containing conversation-derived content, to a fixed path under /tmp. Fixed temporary filenames are prone to unintended cross-process access, stale data exposure, and accidental reuse, especially on shared systems or multi-tenant agent runners.
The skill writes the full LLM prompt with sampled user messages to /tmp without informing the user. This is a privacy and data-handling issue because the stored artifact contains directly readable excerpts of historical conversations that may be sensitive.
In normal operation, the script prints the full analysis prompt to stdout between ANALYSIS_PROMPT_START and ANALYSIS_PROMPT_END, and that prompt embeds up to 60 historical user messages verbatim. In many agent/runtime environments, stdout is logged, surfaced to operators, or captured by other tools, so this creates an unnecessary disclosure path for private conversation content.
The script serializes the full extracted message list into /tmp/persona_meta.json for later processing. Persisting raw conversation text in a temporary file broadens the attack surface and retention window for sensitive user data beyond what is required to generate the persona.
The script persists raw extracted messages and metadata to /tmp/persona_meta.json without any user-facing disclosure or consent signal. Because the file includes message content and file paths, it expands the exposure of personal data beyond what users would reasonably expect from a style-analysis feature.
The module docstring, argparse descriptions, and operational messages are written entirely in Chinese, which imposes a specific language on users. Under the policy, locale constraints should either be optional for the user or clearly documented as justified for a region-specific tool, which is not present here.
This code file contains natural-language strings such as the module docstring, argument descriptions, and status messages entirely in Chinese. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.
This Python file contains natural-language documentation and interface text entirely in Chinese, including the module docstring and CLI help strings, with no indication that the skill is China-specific or that another language is available. That creates a locale policy issue because the skill imposes a specific language on users without opt-in.
The script prints errors, success messages, and summary output in Chinese, which continues the language-locking behavior throughout runtime. Because the file does not offer a language choice or justify a region-specific requirement, this is a natural-language policy violation.
The module description, CLI descriptions, runtime messages, and generated prompt are all written in Chinese, which imposes a specific language on users without any opt-in or selection mechanism. Under the stated policy, forcing a specific language without user choice is a natural-language policy concern.
No suspicious patterns detected.