Back to skill

Security audit

social-collaboration-mind

Security checks for vulnerabilities and agentic risk

Overview

The core collaboration tool is local and simple, but the skill also asks agents to store and reuse persistent preferences and potentially rewrite skill instructions, so it should be reviewed before installation.

Install only if you are comfortable with the skill keeping local cross-session memory. Treat learned_patterns.json as untrusted data, avoid storing sensitive notes or free-form instructions in it, require explicit confirmation before applying saved preferences, and do not let an agent automatically rewrite SKILL.md from accumulated usage history.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T02 · Agent Memory Poisoning

Warning
Location
scripts/learner.py:92
Finding

Unvalidated Persistent Preferences Can Poison Future Agent State

Content
View full analysis

Vulnerability Details

File Location: scripts/learner.py:92-96; related behavioral instructions in SKILL.md:72,82-84 and scripts/section.md:16,26-28
Vulnerability Type: Persistent agent-state poisoning
Risk Level: Medium

Vulnerable Code

python
def record_preference(skill_dir, key, value):
    data = load_learning(skill_dir)
    data["preferences"][key] = value
    save_learning(skill_dir, data)
    return data

The command-line interface passes unrestricted user-supplied values into this function:

python
p_pre  = sub.add_parser("prefer"); p_pre.add_argument("skill_dir")
p_pre.add_argument("--key", required=True); p_pre.add_argument("--val", required=True)

The Skill documentation instructs agents to persist important user preferences in learned_patterns.json, apply them in later uses, and incorporate repeatedly observed experiences into SKILL.md.

Technical Analysis

The learning module accepts arbitrary preference keys and values and saves them to persistent JSON storage without:

  • An allowlist of supported preference keys.
  • Type, length, or content validation.
  • Separation of declarative preferences from executable behavioral instructions.
  • Provenance or trust metadata.
  • Expiration or session boundaries.
  • Explicit approval before persisted state is applied in later sessions.

This creates a durable influence channel through which content originating from an untrusted request can be represented as a user preference. The associated Skill instructions direct future agents to adopt stored preferences and recommend rewriting SKILL.md based on accumulated observations. If an agent follows those instructions without treating stored content strictly as untrusted data, attacker-controlled text could influence subsequent sessions.

The Python implementation does not independently execute stored values, automatically load them into social_mind.py, or directly rewrite SKILL.md. Exploitation therefore depends on ...[truncated 1878 chars]

Remediation
View remediation

Remediation Suggestions

  1. Allowlist supported preferences

    • Define a fixed schema of permitted keys.
    • Reject unknown keys rather than storing arbitrary entries.
    • Constrain each value to an expected type and enumerated set where possible.
  2. Validate and bound all persisted input

    • Enforce maximum key and value lengths.
    • Reject control characters and instruction-like multiline content where free-form text is unnecessary.
    • Store operational notes separately from preferences that may affect behavior.
  3. Treat memory as untrusted data

    • Explicitly instruct agents never to execute or follow instructions embedded in stored values.
    • Present persisted values as quoted data with clear provenance.
    • Do not place stored content into system or developer instruction contexts.
  4. Require confirmation before future application

    • Ask the authenticated user to approve a preference before persisting it.
    • Ask again before applying security-sensitive or behavior-changing preferences in a later session.
    • Provide commands to inspect, revoke, and reset persisted preferences.
  5. Add provenance and lifecycle controls

    • Record who supplied each preference, when it was recorded, and whether it was verified.
    • Add expiration timestamps and session or tenant isolation.
    • Prevent one user's state from affecting another user.
  6. Prohibit automatic Skill instruction rewriting

    • Remove the direction to write accumulated experience directly into SKILL.md.
    • If updates are required, generate a structured proposal or patch for explicit human review.
    • Never interpolate free-form stored values into Skill instructions.
  7. Use atomic and permission-restricted storage

    • Write updates through a temporary file followed by an atomic replacement.
    • Restrict file permissions to the intended user.
    • Validate the complete JSON schema when loading existing state and fail safely on malformed data.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest presents the skill as a social-collaboration decision engine, but the documented behavior adds a separate persistent learning and preference-tracking system unrelated to the stated purpose. This description-behavior mismatch can mislead users and orchestrators into invoking a skill under false assumptions, enabling unnoticed data collection and behavior changes across sessions.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill instructs use of a learner component that writes persistent state (learned_patterns.json) but the manifest declares no tool scope or file-write permissions. This creates an undeclared capability boundary: a caller may treat the skill as a local decision helper while it also persists data to disk, undermining transparency and consent around storage.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation introduces a persistent self-learning system that records usage history and user preferences, expanding the skill from a local decision helper into a cross-session memory component. That scope expansion increases privacy and integrity risk because future outputs may be influenced by accumulated state that users did not expect from the declared collaboration function.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Granting generic cross-session memory and preference tracking is broader than necessary for choosing collaboration strategies from current partner signals. Unnecessary persistent memory increases the attack surface for privacy leakage, profiling, and unintended behavioral steering based on stale or overbroad historical data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill describes storing usage history, error records, and user preferences without a clear privacy notice, retention policy, or consent model. Persistent collection of these data can expose behavioral patterns or sensitive preferences, especially if multiple users share the environment or the file is later exfiltrated.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation explicitly instructs persisting user preferences and usage history across sessions, creating durable state that can influence later behavior. In the context of a skill advertised as a collaboration-strategy helper, this is more dangerous because the persistence is not central to the stated function and may evade user expectation and governance controls.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

清单描述该技能应基于协作伙伴的信号推断状态并选择委派、咨询、监督等协作策略;但本文件的模块文档和实现是一个“任意 WorkBuddy 技能可调用”的通用自进化学习器,负责记录操作历史、用户偏好、错误模式和复盘建议。这些持久化学习与跨技能分析能力并非该技能描述中显式声明的社会协作推断功能,属于额外行为范围。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This is a natural-language policy issue because the file presents its purpose, usage instructions, and operational output in a single language only. There is no indication that the skill is region-specific or that users can opt into another language, which can violate language/locale choice requirements.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

resolve_skill_dir 支持传入任意目录或 ~/.workbuddy/skills 下任意技能名,配合后续读写 learned_patterns.json,使该脚本可对其他技能的数据进行初始化、记录和分析。这是一种通用本地遥测/学习基础设施能力,而不是实现“从伙伴信号推断协作策略”的直接必要功能。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This section adds a generic cross-session learning and memory subsystem that persists user preferences, error history, and operational telemetry beyond the skill’s stated social-collaboration purpose. Scope expansion like this increases privacy and data-retention risk because the stored data can accumulate sensitive behavioral context without a clear need tied to the declared capability.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation explicitly instructs persistent storage of cross-session user preferences and usage history in a local file for future reuse without establishing necessity, minimization, or consent. Even when stored locally, this creates a durable behavioral profile that can expose sensitive preferences, mistakes, and workflow history if accessed by other tools, users, or later prompts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs operators to store user preferences and error notes persistently without warning users that this data will be retained. Error notes and preference entries can easily contain sensitive personal or operational information, so silent persistence creates a privacy and secondary-disclosure risk.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instructions create a retention mechanism for natural-language preferences, failure details, and usage information in a reusable memory file. Natural-language stores are especially risky because they often capture more sensitive context than intended and can later be surfaced, leaked, or repurposed outside the original task.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Persisting and automatically reusing a language preference without offering choice or opt-in is a smaller but real privacy and autonomy issue. While the data element is less sensitive than broader telemetry, it still demonstrates silent cross-session profiling and behavior shaping.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains natural-language instructions and outputs in Chinese only, including the module docstring and runtime messages. That effectively forces a specific language for users without opt-in or a documented justification for a locale-specific skill, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The manifest frames the skill as self-contained and local, while later instructions require invoking a separate learner that persists state and modifies future behavior. This inconsistency weakens operator trust and reviewability because the effective runtime behavior depends on an undocumented secondary workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The example instructs persisting an output-language preference (中文) as a stored default without emphasizing that this should only happen based on user choice. Even low-sensitivity preference storage can normalize silent profiling and can become problematic when aggregated with other recorded history.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The JSON contains user-facing natural-language labels such as "协作心智" in capability metadata and recent operation records, but there is no indication that the skill offers language choice or documents a justified locale restriction. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The text states the system automatically reviews and accumulates experience without human maintenance, and the iteration rules say experience will be written back into SKILL.md. However, the concrete usage examples only invoke learner.py commands around recording, preference storage, insight, and reflect against the skill directory and learned_patterns.json, with no documented mechanism for editing SKILL.md.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.