Back to skill

Security audit

Local Auto Emoji

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent emoji purpose, but it needs Review because it hides user/channel gating and has material privacy, external-code-loading, and local-file safety concerns.

Install only if you trust the publisher and deployment environment. Before enabling it, require explicit disclosure and controls for avatar retention, third-party Qwen/DashScope processing, emotion-log retention, allowed channels/users, and path validation for user IDs and version cleanup.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/manage_emojis.py:65
Finding

Unsanitized User Identifier Allows Filesystem Path Traversal

Content
View full analysis
Tuple[str, str]: """ 创建新版本(保存头像) 返回:(userid, version_path) """ if userid is None: userid = self.generate_userid() # 创建版本文件夹:__ timestamp = int(time.time()) # 查找该 userid 的最大 seq existing_versions = [] for item in self.assets_public.iterdir(): if item.is_dir() and item.name.startswith(f"{userid}_"): parts = item.name.split('_') if len(parts) >= 3: seq = int(parts[-1]) existing_versions.append((seq, item)) seq = 1 if existing_versions: seq = max(seq, *[v[0] for v in existing_versions]) + 1 version_dir = self.assets_public / f"{userid}_{timestamp}_{seq}" version_dir.mkdir(parents=True, exist_ok=True) # 保存头像 avatar_dest = version_dir / "avatar.jpg" shutil.copy2(avatar_path, avatar_dest) # 更新索引 self.index["users"][userid] = { "latest_version": version_dir.name, "versions": [v[1].name for v in sorted(existing_versions, key=lambda x: x[0])] + [version_dir.name], "avatar_path": str(avatar_dest) } ``` ```python # scripts/manage_emojis.py:127-140 sorted_versions = sorted( versions, key=lambda v: int(v.split('_')[-1]) ) to_delete = sorted_versions[:-max_versions] for v in to_delete: v_path = self.assets_public / v if v_path.exists(): shutil.rmtree(v_path) prin ...[truncated 2699 chars]
Remediation
View remediation
str: if not USER_ID_PATTERN.fullmatch(userid): raise ValueError("Invalid user identifier") return userid ``` 2. Reject absolute paths, path separators, `.` components, and `..` components even if future identifier formats become more permissive. 3. Resolve each destination and verify that it remains beneath the intended root: ```python root = self.assets_public.resolve() destination = (root / directory_name).resolve() if destination != root and root not in destination.parents: raise ValueError("Destination escapes the asset directory") ``` 4. Apply the same containment check immediately before `mkdir()`, `copy2()`, and `rmtree()` operations. 5. Validate every version name loaded from `index.json`. Prefer storing opaque version identifiers rather than filesystem paths. 6. Before recursive deletion, require that the target: - Is a direct child of `assets/public`; - Matches the expected version naming pattern; - Is not a symbolic link; - Resolves beneath the asset root. 7. Treat index files as security-sensitive state. Use restrictive file permissions, atomic writes, schema validation, and integrity protection where appropriate. 8. Add tests covering absolute paths, nested paths, `../` traversal, symbolic links, malformed index entries, and identifiers containing platform-specific separators. ]]>

T08 · Insecure Dependencies

Error
Location
scripts/generate_emojis.py:18
Finding

Unverified External Project Is Given Import Precedence and Executed

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Undeclared access restrictions to specific channels or identities, combined with a public-facing description that implies a general-purpose emoji skill, create a trust and policy gap. Hidden identity/channel targeting can enable selective behavior that is not obvious to reviewers, which is especially concerning when paired with local storage and user-personalized avatar processing.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Undeclared access restrictions to specific channels or identities, combined with a public-facing description that implies a general-purpose emoji skill, create a trust and policy gap. Hidden identity/channel targeting can enable selective behavior that is not obvious to reviewers, which is especially concerning when paired with local storage and user-personalized avatar processing.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Undeclared access restrictions to specific channels or identities, combined with a public-facing description that implies a general-purpose emoji skill, create a trust and policy gap. Hidden identity/channel targeting can enable selective behavior that is not obvious to reviewers, which is especially concerning when paired with local storage and user-personalized avatar processing.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Undeclared access restrictions to specific channels or identities, combined with a public-facing description that implies a general-purpose emoji skill, create a trust and policy gap. Hidden identity/channel targeting can enable selective behavior that is not obvious to reviewers, which is especially concerning when paired with local storage and user-personalized avatar processing.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module docstring claims the workflow will wait for user confirmation after receiving an avatar, but process_message immediately stores the avatar and starts generation. Because avatars are personal images, processing them without the promised confirmation undermines user consent and can lead to unauthorized retention and biometric/profile generation from sensitive user content.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises functionality that implies local file handling, and the static analysis indicates actual file read/write capabilities, but the manifest does not declare any tool scope or permissions. Undeclared filesystem access weakens reviewability and least-privilege controls, making it easier for the skill to read or modify local data beyond what users would reasonably expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill describes broad automatic triggering during normal conversation based on keywords, external factors, and history, which can cause unintended activation and processing of routine user messages. In context, this is more dangerous because the skill also appears to store files and maintain history, so overbroad triggers may expand collection and action far beyond deliberate user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill indicates it will request and use a user's avatar image to generate custom emojis, but it does not provide a clear upfront privacy warning at the point of description. Avatar images are personal data, and processing them without prominent disclosure and consent increases privacy risk and can surprise users about biometric or identity-linked handling.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Using a common greeting like '你好' as a first-use trigger is too vague and likely to activate unintentionally. Because activation leads to requesting an avatar and potentially starting a personalized generation flow, an everyday phrase becomes an unsafe gateway into collecting personal image data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation mentions an external image-generation API but does not warn users that their data may be sent to a third-party service. This omission is risky because avatar images and related prompts may leave the local environment, creating confidentiality, compliance, and data-sharing concerns that users did not knowingly accept.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The module description, class docstrings, and keyword set are written to analyze Chinese-language emotional content, with no indication that users can opt into another language or that the locale restriction is documented as intentional. Under the policy, forcing a specific language/locale without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code persists conversation-derived context to a local JSON log without any consent, disclosure, retention control, or access protection. Even though context is truncated, it may still contain sensitive user data, and storing it in plaintext increases privacy and data exposure risk if the host is shared or compromised.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

User message content is retained in a persistent plaintext history log, creating a straightforward confidentiality risk. In the context of an emotion-analysis skill, users may send intimate or sensitive text, so logging even partial context can leak private information through local file access, backups, crash reports, or unintended sharing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains natural-language strings and comments exclusively in Chinese, including the module description, argument help text, and runtime status/error messages. Under the policy rule for language/locale, forcing a single language without user opt-in or justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
77% confidence
Finding

The manifest name and description emphasize a local auto-emoji system, but this module imports and depends on an external GetEmoji project and the dashscope-backed QwenImageGenerator. That external model/service dependency is not obviously implied by a 'local' emoji system description and broadens the capability beyond straightforward local emoji handling.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a broader system that can automatically send emojis, support incremental updates, and mix text with images. In this file, the implemented behavior is limited to generating emoji images from an avatar and saving them to a local directory; there is no sending logic, no incremental update handling, and no图文混排 behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module-level natural-language description and all user-facing strings are hard-coded in Chinese, with no indication that users can choose another language or locale. The policy requires avoiding forced language constraints unless the limitation is clearly documented and justified or the user can opt in.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The dedicated _is_kaige_channel logic embeds user-specific access control unrelated to emoji generation, and it is duplicated, suggesting ad hoc targeting rather than principled authorization. In a skill context, undocumented identity-based branching is risky because it can conceal selective behavior, facilitate favoritism or evasion of review expectations, and make the skill act differently depending on who invokes it.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill advertises a general-purpose automatic emoji system, but process_message denies service unless the channel label matches hard-coded values. This hidden, user-specific gating is dangerous because it creates behavior that is materially different from the stated purpose and can be used to selectively privilege or exclude users without transparency, which is a classic indicator of deceptive or policy-bypassing skill behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

When an avatar is provided, the code saves it via create_version and uses it for emoji generation without any user-facing disclosure that the image will be stored locally and versioned under assets/public. In the context of profile-image handling, silent persistence increases privacy risk because users may reasonably expect transient processing rather than durable storage of personal photos.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
74% confidence
Finding

All user-facing instructions, examples, and trigger phrases are presented only in Chinese, and the usage examples imply Chinese-language interaction such as '你好' and Chinese keyword triggers. Without an explicit opt-in, language choice, or documentation that the skill is intentionally Chinese-only, this can be interpreted as a locale policy issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

Automatic cleanup of old emoji versions involves deletion of user-related assets, yet the description does not warn users that prior versions may be removed. While lower severity than hidden exfiltration, silent deletion can still cause unexpected data loss and complicate user expectations around retention and recoverability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This JSON file defines all visible names and prompt text in Chinese only, with no indication that users can choose another language or opt in to a Chinese-only experience. That creates a natural-language locale constraint that may conflict with organizational policy requiring language choice or explicit documentation of locale limitations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file contains a Chinese-only natural-language description in the skill header. Because there is no accompanying indication that the skill supports language choice or that it is intentionally region-specific, this may violate a language/locale policy requiring user opt-in or justification for locale constraints.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module docstring says it will '输出 8 种情感之一', but EMOTIONS defines 12 values and the keyword mappings also cover those 12 categories. This is an active contradiction between the documented intent and the implemented behavior, not merely an omitted detail.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.