Back to skill

Security audit

回忆录制作

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward Chinese oral-history helper that saves user-provided stories locally, with privacy caveats around plaintext storage.

Install only if you are comfortable with interview notes being saved locally in plaintext JSON. Avoid recording highly sensitive family details on shared machines unless you add stricter file permissions, deletion controls, or encryption.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
production_team_storyteller.py:28
Finding
Potentially Sensitive Oral-History Records Stored in Plaintext with Ambient File Permissions## Vulnerability Details **File Location**: `production_team_storyteller.py`, lines 28–41 **Vulnerability Type**: Plaintext storage of potentially sensitive personal data **Risk Level**: Medium ```python def save_raw_memory(self, content, tags): """ 保存原始口述记录,带上时间戳和标签,方便后续翻查。 """ timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") filename = f"{self.data_dir}/memory_{timestamp}.json" data = { "timestamp": timestamp, "content": content, "tags": tags, "status": "raw" } with open(filename, 'w', encoding='utf-8') as f: json.dump(data, f, ensure_ascii=False, indent=4) return f"已存入素材库,编号:{timestamp}" ``` ### Technical Analysis The `save_raw_memory` method writes oral-history content and associated tags directly to an unencrypted JSON file. Such records may contain names, relationships, personal experiences, political or historical recollections, and other sensitive family information. The file is created through Python's ordinary `open(..., 'w')` operation without explicitly enforcing restrictive permissions. Its effective permissions therefore depend on the process umask and surrounding directory permissions. The containing directory is likewise created without an explicit private mode elsewhere in the class. No encryption, redaction, consent control, access-control validation, or retention mechanism protects the stored information. This does not grant an attacker new system privileges. Exploitation requires an existing local user or process to have access to the storage directory or files, such as through permissive filesystem settings, a shared working directory, backup exposure, or another compromised process. ### Attack Path 1. A user records an oral-history segment containing sensitive personal or family information. 2. The skill serializes the complete content and tag ...[truncated 1013 chars]
Remediation
## Remediation Suggestions 1. Create the storage directory with owner-only permissions such as `0700`, and verify that an existing directory is neither a symbolic link nor accessible to unintended users. 2. Create each record atomically with owner-only permissions such as `0600`, using low-level flags including `O_CREAT`, `O_EXCL`, and `O_NOFOLLOW` where supported. 3. Resolve and validate the destination path before writing, particularly when `data_dir` can be supplied by a caller. 4. Encrypt sensitive records at rest using a vetted authenticated-encryption implementation, with keys stored separately from the data. 5. Provide redaction controls so users can remove names and other identifying details before storage. 6. Inform users that personal narratives will be stored, obtain appropriate consent, and define retention and deletion controls. 7. Prevent filename collisions by adding microseconds or a securely generated unique identifier, and use atomic writes to avoid accidental replacement or partial records. 8. Review backup, synchronization, and logging behavior to ensure stored narratives are not copied into less-protected locations.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Vague Triggers

Medium
Confidence
93% confidence
Finding
The invocation example is broad enough that the skill could activate on ordinary conversation about interviewing a parent, without clear boundaries, consent checks, or explicit invocation syntax. In an agent environment, overly loose triggers can cause unintended skill activation, unexpected data collection of sensitive family history, or confusing behavior when the user did not intend to invoke this specific workflow.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
Natural-language strings describing the skill are entirely Chinese-specific and framed around a fixed linguistic context, but the file does not state that the skill is region-specific or provide any opt-in for language preference. This can violate language or locale policy when a skill implicitly enforces one language without user choice.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill persists raw oral-history content and tags to local disk automatically, without any disclosure, consent flow, retention policy, or access controls. Because this content can include sensitive family history, personal memories, or third-party information, silent storage increases the risk of privacy violations and unintended data exposure on shared systems or insecure deployments.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The file presents the skill name, description, and example invocation entirely in Chinese, with no indication that users may choose another language. This can be a language-policy concern if the organization expects skills not to force a specific language or locale without opt-in.

Intent-Code Divergence

Low
Confidence
87% confidence
Finding
The docstring for get_interview_hooks claims it provides hook questions based on theme, and the registered tool description presents it as a usable question-suggestion tool. However, the code falls back to hooks["通用"] even though no such key exists in the dictionary, so unsupported themes would raise an error instead of returning general-purpose questions.