Back to skill

Security audit

XHS Writing Coach

Security checks for vulnerabilities and agentic risk

Overview

This is a Xiaohongshu writing coach, but it asks agents to maintain shared long-term strategy memory that could change future behavior without clear user approval or isolation.

Review this before installing if your agent can edit installed skill files. The writing-coach behavior is otherwise ordinary, but the bundled 'living know-how' instructions should ideally be read-only or require explicit approval before saving lessons, histories, or user-specific preferences.

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
references/strategy-notes.md:3
Finding
Uncontrolled Persistent Strategy Memory Can Influence Future Sessions## Vulnerability Details **File Location**: `SKILL.md:36-38`; `references/strategy-notes.md:3-4`; `references/strategy-notes.md:66-67` **Vulnerability Type**: T02: Agent Memory Poisoning **Risk Level**: Medium ### Vulnerable Snippets `SKILL.md:36-38` ```markdown ## Living know-how See `references/strategy-notes.md` for the evolving playbook. Update it whenever we learn new tactics or notice repetition. ``` `references/strategy-notes.md:3-4` ```markdown This file is **the long-term “know-how” memory** for the skill. Update it whenever we learn something new about what works (and what gets repetitive). ``` `references/strategy-notes.md:66-67` ```markdown Anti-repeat rule: - Keep a 7-day history; avoid same archetype for the next 2–3 days. ``` ### Technical Analysis The skill explicitly designates `references/strategy-notes.md` as long-term memory and instructs the agent to update it whenever new tactics are learned. It also calls for retaining a seven-day history. These instructions create a persistent state channel through which information originating in a user request or external research can become part of the instructions used in later sessions. No trust-boundary validation, provenance tracking, per-user isolation, expiration policy, approval requirement, or restriction on the type of information that may be persisted is specified. Consequently, attacker-controlled content could be interpreted as a useful tactic and written into the strategy file as an enduring behavioral rule. The issue is an instruction-level persistence weakness rather than arbitrary system-code execution. The reviewed files contain no executable scripts or direct file-writing implementation, so exploitation depends on the hosting agent having permission and tooling to follow the documented update instruction. ### Attack Path 1. An attacker invokes the writing skill and supplies a purported optimization tactic, formatting pref ...[truncated 1238 chars]
Remediation
## Remediation Suggestions 1. Make bundled strategy and reference files read-only during normal skill execution. 2. Require explicit, informed authorization before persisting any lesson, preference, history, or user-provided content. 3. Store preferences in isolated per-user state rather than in a shared skill file. 4. Treat persisted entries as untrusted data rather than executable instructions. Use a strict schema with bounded fields and reject entries that attempt to alter safety, compliance, tool use, or system behavior. 5. Record provenance, creation time, author or session identity, review status, and expiration for every persisted entry. 6. Add a review or approval step before learned tactics become part of the shared strategy. 7. Apply precedence rules ensuring that current system instructions, safety requirements, and platform policies always override stored preferences. 8. Avoid retaining full user prompts or personal information. Keep only the minimum non-sensitive metadata required for repetition control, with a short retention period. 9. If a seven-day history is necessary, store non-reversible archetype identifiers rather than user content and automatically delete expired records. 10. Audit existing strategy entries and remove any user-specific, unsupported, or compliance-overriding instructions.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Natural-Language Policy Violations

Medium
Confidence
87% confidence
Finding
This file contains prescriptive writing guidance centered on Chinese phrasing, including explicit title patterns in Chinese and XHS-specific output conventions. Because the instructions do not offer a user opt-in or explain that the skill is intentionally limited to a Chinese-language platform context, this can violate language/locale policy requirements.

Natural-Language Policy Violations

Medium
Confidence
82% confidence
Finding
The contract fixes output structure for XHS content and includes a Chinese tag requirement, which effectively constrains the skill to a specific language/locale behavior. Without an explicit statement that the skill is region-specific or that the user has chosen this locale, the file embeds a language policy assumption.

Static analysis

No suspicious patterns detected.