Back to skill

Security audit

data-privacy-guardian

Security checks for vulnerabilities and agentic risk

Overview

This privacy/security advice skill is mostly coherent, but it adds automatic local learning and self-modification instructions that can retain sensitive security context without clear consent or limits.

Review this carefully before installing. The privacy guidance itself is useful, but the learning feature should be disabled or made explicit and opt-in, with limited fields, no free-form sensitive notes, no automatic SKILL.md rewriting, and a clear way to inspect and delete stored data.

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:67
Finding

Unvalidated User-Controlled Data Can Poison Persistent Agent Memory

Content
View full analysis

Vulnerability Details

File Location: scripts/learner.py:67-89; persistent state is consumed according to SKILL.md:119-151
Vulnerability Type: T02: Agent Memory Poisoning
Risk Level: Medium

Vulnerable Code

python
def record_op(skill_dir, capability, success=True, error=None, note=None):
    data = load_learning(skill_dir)
    data["totalOps"] += 1
    cap = data["capabilityStats"].setdefault(capability, {"count": 0, "success": 0, "fail": 0})
    cap["count"] += 1
    if success:
        cap["success"] += 1
    else:
        cap["fail"] += 1
        data["totalErrors"] += 1
    if error:
        ep = data["errorPatterns"].setdefault(error, {"count": 0, "lastNote": "", "lastTime": ""})
        ep["count"] += 1
        ep["lastNote"] = note or ""
        ep["lastTime"] = data["lastUpdated"] or datetime.datetime.now().strftime("%Y-%m-%dT%H:%M")
    rec = {"t": data["lastUpdated"], "cap": capability, "ok": success, "err": error, "note": note}
    data["recentOps"].append(rec)
    data["recentOps"] = data["recentOps"][-20:]
    save_learning(skill_dir, data)
    return data

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

The associated instructions in SKILL.md:119-151 direct the agent to record user preferences in learned_patterns.json, apply them on subsequent uses, and write accumulated experience back into SKILL.md after defined thresholds are reached.

Technical Analysis

The record_op and record_preference functions persist attacker-controlled capability, error, note, preference key, and preference value fields without schema validation, content filtering, trust labels, or length restrictions. The data is stored in learned_patterns.json, which is explicitly intended to influence later executions.

Persistence alone is no ...[truncated 2605 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the instruction that permits runtime learning data to rewrite SKILL.md. Treat the packaged Skill definition as immutable during normal operation.
  2. Treat every value in learned_patterns.json as untrusted data, never as executable instructions or higher-priority behavioral rules.
  3. Define strict schemas for preferences, using enumerated keys and constrained value types. For example, allow a language preference only from a fixed set rather than accepting arbitrary text.
  4. Reject or quarantine values containing prompt-like directives, tool instructions, requests to override safeguards, or references to hidden prompts and unrelated data.
  5. Apply conservative length limits to capability names, error types, notes, preference keys, and preference values.
  6. Separate operational metrics from behavioral configuration. Free-form error notes should never be used to change agent behavior automatically.
  7. Require explicit, authenticated human review before promoting any learned information into persistent configuration.
  8. Store provenance, author, timestamp, approval status, and trust level with every persisted preference.
  9. Ensure future prompts place persisted values inside clearly delimited data sections and explicitly state that their contents are not instructions.
  10. Limit WebSearch and WebFetch to public information required for reputation or guidance checks. Never submit passwords, verification codes, private messages, stored preferences, or other sensitive user data to those tools.
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 Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as a privacy/security advisor, but it also introduces a generic self-learning subsystem that records usage history, errors, and user preferences to persistent storage. In a privacy-focused skill, undisclosed data collection and retention directly contradict user expectations and can capture sensitive security-related context, increasing the risk of privacy harm or secondary misuse.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

该文件的模块说明明确表示它是“任意 WorkBuddy 技能可调用”的通用学习组件,职责是记录使用情况、用户偏好、错误模式和复盘建议,而不是提供隐私保护、密码安全、反诈骗或法规合规指导。实际代码也围绕跨技能行为日志与偏好持久化展开,和该技能在 manifest 中声明的数据隐私/网络安全管家用途并不一致。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The listed trigger words include very broad terms such as “隐私保护”, “网络安全”, and “安全防护”, which can easily appear in ordinary conversation and could cause unintended invocation. The file does not provide scope constraints, exclusion conditions, or negative examples to clarify when the skill should or should not activate.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation adds a self-learning and experience-accumulation mechanism unrelated to the core privacy/cybersecurity advisory purpose. That broadening of function creates hidden state and persistence, which can be abused or mishandled, especially in a skill users may trust with sensitive security and privacy information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill describes persistent learning and preference storage but does not clearly warn users that their data may be retained locally. Lack of notice is particularly problematic in a privacy-guardian context, where users are likely to share sensitive account, device, or incident details under the assumption of privacy-preserving behavior.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs persistent storage of user preferences, usage frequencies, error patterns, and improvement notes without showing necessity, consent, or safeguards. Because this is a privacy-oriented skill, such retained metadata may reveal sensitive habits, incidents, or account-security concerns even if passwords are not stored directly.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The learning module explicitly instructs storing user preferences and usage-derived data in a local file, creating a durable record that may include sensitive security-advice context. If the file is unprotected, over-retained, or accessed by other processes, it can leak privacy-sensitive behavioral data and undermine the skill's stated protective purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module supports persistent cross-skill profiling by resolving arbitrary skill directories, including ~/.workbuddy/skills/, and storing capability usage, errors, notes, and preferences to disk. In a privacy/security assistant, this is risky because it normalizes collection of user behavioral data beyond the minimum necessary purpose, increasing exposure of sensitive metadata if the host is accessed or logs are later reused.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

record_preference stores arbitrary key/value preferences to disk, and related code also persists free-form operation notes without any notice, consent, classification, or sanitization. Because users may include personal, credential-adjacent, or incident-response details in notes/preferences, this creates silent local retention of potentially sensitive information that could be exposed to other local users, backups, or later processing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description and operational guidance are presented entirely in Chinese and anchored to Chinese legal context, but the file does not explicitly state that this locale is optional or region-specific. This can violate language/locale policy when a skill implicitly forces one language without user opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file presents itself throughout as a data privacy and cybersecurity assistant, but the inline Bash examples tell operators to record capabilities like '简历优化' and errors like '格式识别失败', which belong to a different skill domain. This active documentation mismatch indicates copied guidance that contradicts the declared intent of the current skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The natural-language instructions, comments, and command descriptions presented to users are entirely in Chinese, which effectively forces a specific language for understanding and use. The file does not offer an alternative language, locale selection, or indicate that the skill is intentionally limited to a Chinese-speaking audience.

Content

No source excerpt is available for this finding.