Back to skill

Security audit

ecommerce-ops-assistant

Security checks for vulnerabilities and agentic risk

Overview

The skill is an e-commerce helper, but it persistently records usage, errors, notes, and preferences and tells future agents to adapt from that data without clear consent or retention controls.

Review this skill before installing. Its shopping-platform advice appears purpose-aligned and I found no exfiltration or destructive code, but the built-in memory system can retain business notes and preferences across sessions and may affect future behavior. Install only if you are comfortable with local persistent memory, or disable/remove the learner and SKILL.md writeback instructions first.

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

Unvalidated User-Controlled Preferences Persisted Across Sessions

Content
View full analysis

Vulnerability Details

File Location: scripts/learner.py, lines 99-103
Vulnerability Type: Persistent agent-memory poisoning through unrestricted preference storage
Risk Level: Medium

Evidence

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 dispatch passes arbitrary command-line values directly to this persistence function:

python
elif args.cmd == "prefer":
    record_preference(sd, args.key, args.val)
    print("✅ 已记录偏好")

SKILL.md, lines 86-115, directs the agent to record user preferences in learned_patterns.json and apply important stored preferences during later uses.

Technical Analysis

The preference key and value are accepted without validation, normalization, an allowlist, provenance metadata, expiration, or separation between benign presentation preferences and behavioral instructions. They are then written into the persistent learned_patterns.json state.

A user can therefore supply a value framed as an agent directive rather than as ordinary preference data. Because the skill documentation instructs future invocations to adopt important saved preferences, a later agent session may treat attacker-controlled persistent text as trusted operating guidance. The Python module does not itself execute stored values as code; exploitation depends on a future agent reading and following the persisted preference. Nevertheless, this creates a durable trust-boundary violation between untrusted conversation input and future agent behavior.

The related documentation also recommends writing accumulated experience back into SKILL.md after recurring failures. The provided script does not implement that writeback automatically, so direct modification of SKILL.md is not established by the audited code. Any such modification would r ...[truncated 1546 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace arbitrary key/value storage with an explicit allowlist of benign preference fields, such as output language, report length, currency, and platform.
  2. Validate values against field-specific schemas, enumerations, type limits, and conservative maximum lengths.
  3. Reject values containing imperative behavioral directives or references to system prompts, safety rules, credentials, tool authorization, file access, or instruction precedence.
  4. Store provenance with every preference, including the originating user, session, timestamp, and whether it was explicitly confirmed.
  5. Scope persistent preferences per authenticated user or tenant instead of sharing one skill-wide state file.
  6. Treat loaded preferences strictly as untrusted data. Never insert them into system- or developer-level instructions, and never allow them to override security policy or tool authorization.
  7. Require explicit confirmation before a preference is saved and provide commands to inspect, expire, and delete stored entries.
  8. Remove or tightly constrain the instruction to write learned material back into SKILL.md. Any proposed documentation change should require review and must never be generated directly from untrusted error notes or preferences.
  9. Use atomic, permission-restricted file updates and define a retention period for stored state.
  10. Add tests proving that instruction-like values cannot alter future agent policy or tool behavior.
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
99% confidence
Finding

The skill is presented as an e-commerce operations assistant, but it also includes a generic self-learning subsystem that records usage history, errors, and user preferences to local files. This hidden persistence materially expands the skill's behavior beyond its declared purpose, undermines informed consent, and increases the risk of retaining sensitive business or user data without clear justification.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Broad trigger phrases such as '电商运营' and '选品' can cause the skill to activate in ordinary conversations that only loosely relate to e-commerce. Unintended invocation is more concerning here because the skill has write-capable tools and documents persistent storage behavior, increasing the chance of unnecessary data handling.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented self-evolution behavior allows the skill to change its future behavior based on accumulated records and to write back experience into SKILL.md. That creates an uncontrolled capability expansion path, making the skill less predictable, harder to audit, and more susceptible to prompt- or data-driven drift outside the intended e-commerce assistant scope.

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 writing of user preferences and usage history but does not provide a clear warning, consent mechanism, or retention disclosure. This can lead to silent collection of user or business-context data, which is especially risky in an operations assistant that may process sensitive commercial information.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly stores user preferences, error history, and usage patterns in a persistent JSON file without showing a necessity tightly tied to the core e-commerce function. Persistent profiling can expose commercially sensitive preferences or operational details across sessions and creates privacy and data minimization concerns.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Persisting preferences and interaction history in a local memory file can unintentionally disclose user-provided data to later sessions, other skills, or anyone with filesystem access. Because this is an e-commerce assistant, stored notes may include merchant strategy, product plans, complaint patterns, or other commercially sensitive material.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The example command records the user preference 输出语言 with the fixed value 中文, which suggests a default or enforced language choice. The file does not indicate that users can choose another language or that the locale constraint is optional and justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module is explicitly described as a generic cross-skill self-learning component usable by any WorkBuddy skill, which exceeds the declared ecommerce-operations scope of this specific skill. Scope expansion matters because it enables persistent telemetry and behavioral accumulation infrastructure that can be reused beyond the user’s expected purpose, increasing privacy and trust risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The save function writes accumulated preferences, notes, errors, and operational history into a local JSON file without any user-facing warning, consent flow, or storage controls. Silent persistence is dangerous because users may disclose proprietary store metrics, customer-service content, or other sensitive operational context believing the interaction is ephemeral.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code persistently records capabilities used, success/failure status, error types, free-form notes, and arbitrary user preferences to disk. Because notes and preferences are unconstrained, they can capture sensitive business data or personal information unrelated to the ecommerce assistant’s stated purpose, creating unnecessary data retention and privacy exposure.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The learner usage examples say the capability name should be things like '简历优化' and '比价', which are unrelated to the declared e-commerce operations functions. This indicates the embedded documentation was reused from another skill and does not match the actual intended domain of this one.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The module description, usage text, and runtime-facing strings are written only in Chinese, which effectively constrains interaction to a single language. There is no indication that the language is optional, configurable, or justified as region-specific.

Content

No source excerpt is available for this finding.