Back to skill

Security audit

Multi Group Chat Manager

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent chat-management purpose, but it handles raw group chats, persistent profiles, and reputation scores with weak consent and access-control boundaries.

Install only in groups where members have been clearly told that messages may be collected, analyzed, and stored as profiles and affection scores. Limit use to trusted administrators, restrict OneBot to a local trusted endpoint, validate user and group IDs before use, add retention/deletion controls, and fix the scan pipeline before relying on scores for moderation decisions.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/memory.py:101
Finding

Path Traversal Through Unsanitized User Identifiers

Content
View full analysis
str: return os.path.join(self.storage_dir, f"{user_id}.json") def _load(self, user_id: str) -> dict: path = self._filepath(user_id) if not os.path.exists(path): return {"user_id": user_id, "memories": []} try: with open(path, "r", encoding="utf-8") as f: return json.load(f) except (json.JSONDecodeError, OSError): return {"user_id": user_id, "memories": []} def _save(self, user_id: str, data: dict): path = self._filepath(user_id) with open(path, "w", encoding="utf-8") as f: json.dump(data, f, ensure_ascii=False, indent=2) ``` #### `scripts/profiles.py:298-324` ```python def save_composite(user_id: str, data: dict): comp_dir = PROFILES_DIR / "composite" comp_dir.mkdir(parents=True, exist_ok=True) path = comp_dir / f"{user_id}.json" composite = { "user_id": user_id, "name": data.get("name", ""), "first_seen": data.get("first_seen", int(time.time())), "last_updated": data.get("last_updated", int(time.time())), "update_count": data.get("update_count", 0), "group_roles": data.get("group_roles", {}), } with open(path, "w", encoding="utf-8") as f: json.dump(composite, f, ensure_ascii=False, indent=2) def load_composite(user_id: str) -> dict: path = PROFILES_DIR / "composite" / f"{user_id}.json" if not path.exists(): return {} try: with open(path, "r", encoding="utf-8") as f: return json.load(f) except (json.JSONDecodeError, OSError): return {} ``` #### `scripts/affection.py:103-119` ```python def _log_ ...[truncated 3635 chars]
Remediation
View remediation
str: value = str(user_id) if not re.fullmatch(r"[0-9]{1,32}", value): raise ValueError("Invalid user identifier") return value ``` 2. Resolve and verify every generated path: ```python from pathlib import Path def safe_user_json_path(root: Path, user_id: str) -> Path: safe_id = validate_user_id(user_id) root = root.resolve() candidate = (root / f"{safe_id}.json").resolve() if candidate.parent != root: raise ValueError("Path escapes the storage directory") return candidate ``` 3. Use this single helper in `memory.py`, `profiles.py`, and `affection.py` rather than implementing path construction separately. 4. Reject path separators, traversal components, absolute paths, null bytes, and platform-specific separator variants even if support for nonnumeric identifiers is required. 5. Run the Skill under a dedicated account with write permission only to its data directories. Project source, configuration, and unrelated user files should be read-only where practical. 6. Use atomic writes through a temporary file created inside the validated destination directory, followed by `os.replace()`. 7. Add regression tests for identifiers including: ```text ../config ../../config ..\config /absolute/path C:\absolute\path user/other user\other ``` Each test should verify that the operation is rejected and that no file outside the designated storage root is read or modified. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/onebot_collector.py:535
Finding

Integrated Scan Bypasses Rule-Engine Watermarks and Allows Duplicate Affection Updates

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (44)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description covers a broad, integrated system with memory/profile management, collection, scanning, and rule-engine orchestration. The supplied code chunk is much narrower: it is an affection score manager with rule-based adjustments and logging to local JSON files. Some description elements are partially consistent—such as centralized config use and JSON + file-lock protection for affection data—but the main claimed capabilities of user profiling, memory decay/reinforcement, collector/scanner pipeline, and differentiated group scanning are absent from this code. Because the actual chunk’s behavior represents only one subsystem of the declared skill and omits many core claimed capabilities, the description does not accurately represent what this supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The description presents a broad feature-rich skill whose primary purpose includes user profiling, favorability scoring, memory decay/reinforcement, collector/rule-engine processing, and multi-group scan orchestration. The supplied code does not perform any of those behaviors. It is limited to configuration loading and merging. While config management is one small part of the declared description, the actual chunk lacks the core claimed functionality. Additionally, the description claims hot reload without restart, but this module only supports reload when callers explicitly pass force_reload=True; otherwise it caches values. Therefore the code chunk does not accurately represent the declared behavior and should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill advertises convenience features but does not prominently warn that it collects, stores, and processes group messages for profiling and scoring. In a context involving persistent behavioral profiling and reputation scoring, lack of clear notice undermines informed consent and can lead to covert surveillance of users.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file’s stated purpose is to pull complete group chat history and integrate it with profiling and scoring systems, which creates a direct natural-language data leakage path. Because the skill context explicitly includes user profiling, memory reinforcement, and downstream AI analysis, exposing raw communications is more dangerous than a normal chat-management utility.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The scan workflow deliberately prepares full message contents and per-user message sets for AI profiling and memory reinforcement. This is dangerous because it operationalizes large-scale behavioral analysis of users from chat content, increasing the risk of privacy violations, unauthorized secondary use, and leakage of sensitive personal information.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/rule_engine.py (reported line 83)May include surrounding context.

python
data = _read_json(path)
        rules = data.get("rules", [])
        self._rules_cache[group_id] = rules
        return rules

    def list_groups(self) -> list:
        """列出有规则文件的群 ID 列表"""

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README describes persistent storage of user profiles, affection scores, logs, and session state for group members without clear consent, retention, notice, or access-control guidance. In a chat-management skill, this creates a real privacy and surveillance risk because sensitive behavioral data can accumulate silently and be queried or misused by operators.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The privacy section says '数据仅存本地,不会上传任何服务器' at L152, which communicates a no-upload/local-only intent. However, elsewhere the same README states the skill supports QQ/OneBot, Feishu, Discord, Telegram (L11) and includes a 'OneBot collector' (L71, L100), which necessarily involves sending requests to chat platform endpoints to collect messages. That is an active contradiction in the documentation's privacy/intent claims.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documents capabilities that imply file reads/writes, shell execution, and network access, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, missing scope declarations can let the runtime or operator grant overly broad access by default, increasing blast radius if the skill is misused or compromised.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The file’s natural-language instructions, trigger phrases, and operational guidance are presented only in Chinese, which effectively forces a specific language for use and administration. The document does not offer an alternate language option or state that the skill is intentionally limited to a Chinese-language deployment context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Broad trigger phrases like generic online/offline words can be activated during normal conversation, causing the agent to change session state or start scans unintentionally. In this skill, accidental activation is more dangerous because state changes can lead to message collection, profiling, and score updates across groups.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly instructs the AI to read users' raw message histories and extract new traits for storage, creating a direct natural-language workflow for processing personal content into persistent profiles. This is dangerous because it operationalizes large-scale surveillance and inference from chat content, including sensitive or contextual information users may not expect to be summarized and retained.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Ambiguous profile-query triggers increase the chance that ordinary conversation is interpreted as a request to reveal stored profile information. Because the output contains accumulated personal traits and behavioral summaries, false activations can expose sensitive data through natural-language interactions.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented DM flow allows the AI to return stored user profile data on request, which creates a straightforward natural-language disclosure channel for personal information. Even with a private-chat restriction, exposing inferred personality, interests, and behavior to an inquirer can violate privacy if identity, authorization, or subject consent are not robustly enforced.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill enables detailed affection-score and history disclosure for arbitrary users through admin-triggered natural-language queries. This is sensitive evaluative profiling data, and exposing it can harm users through reputation impacts, bias, retaliation, or social engineering, especially because the system stores historical judgments and reasons.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The privacy section promises that other people cannot query a user's data, yet the documented flow explicitly allows administrators to retrieve arbitrary users' affection details. This is a policy/behavior contradiction that can mislead users about who can access sensitive profiling data and result in unauthorized disclosure relative to user expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The config sets "output_language" to "zh-CN", which imposes a specific language/locale by default. In this file there is no accompanying natural-language indication of user opt-in, choice, or a clear region-specific justification, so it matches the policy-violation criterion for forced locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The config sets output_language: "zh-CN", which imposes a specific language/locale choice. Under the policy rules, forcing a language without offering user choice or documenting a justified region-specific constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module description and all user-facing strings are written in Chinese, and the CLI/output behavior is hardcoded to that locale. This creates a natural-language locale policy issue because the skill does not provide any user opt-in, language selection, or documented region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The default configuration sets output_language to zh-CN, which is a locale/language constraint expressed in natural-language-adjacent configuration. The file does not indicate that users can choose another language or that this restriction is required for a region-specific purpose, so it appears to violate the language/locale policy criteria.

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 documentation and user-facing CLI/help strings exclusively in Chinese, including the module docstring and command descriptions. The file does not provide any opt-in, fallback language, or justification that the skill is intended only for a Chinese-speaking region or audience, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill persistently stores user-supplied memory/profile content to disk as JSON without any consent notice, data minimization, retention control, encryption, or access-control measures visible in this file. In the context of a multi-group chat manager that profiles users and tracks preferences, this increases privacy risk: sensitive personal content may be collected and retained indefinitely, then exposed through local compromise, backups, logs, or misuse by operators.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

The helper posts requests to the configured OneBot HTTP endpoint, and the overall skill purpose is to retrieve message history from an external service. While the code comments mention the API, there is no user-facing warning near execution paths that using this tool sends group identifiers and request metadata to a network service and may expose chat data over that interface.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/onebot_collector.py (reported line 83)May include surrounding context.

python
timeout = obot["timeout"]

    try:
        resp = requests.post(url, json=params or {}, timeout=timeout)
        data = resp.json()
    except requests.RequestException as e:
        return {"status": "failed", "retcode": -1, "data": None,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The collector bulk-exports group messages, user aggregates, and message texts to stdout as JSON without any consent check, minimization, or warning. In a skill explicitly designed for profiling and affection scoring, this creates a real privacy exposure because sensitive conversations can be surfaced, logged, or forwarded downstream unintentionally.

Content

No source excerpt is available for this finding.