Back to skill

Security audit

詹明明·今天拍什么

Security checks for vulnerabilities and agentic risk

Overview

This Chinese short-video topic skill is coherent in purpose, but it gives the agent under-scoped authority to trust external vault rules, run unaudited local scripts, and persist user feedback automatically.

Install only if you trust the local vault and repository scripts it will use, and prefer running it with explicit confirmations before commands or persistent writes. Review or disable the automatic feedback writeback and external-script steps before using it on shared or sensitive workspaces.

Vulnerability Patterns
  • 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
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:131
Finding
Shell Command Injection Through an Unescaped User-Controlled Keyword## Vulnerability Details **File Location**: `SKILL.md`, line 131 **Vulnerability Type**: Shell command injection **Risk Level**: High ### Complete Vulnerable Instruction ```text 1. Personal canonical source: python3 {vault}/07-scripts-and-tools/surface_candidates.py --kw "{keyword}" --top 15, prioritizing save rate. ``` The source instruction directly places the user-supplied keyword into a shell command. The path labels and placeholder above are rendered in English, but the command structure is unchanged. ### Technical Analysis The value represented by `{keyword}` originates from the user's topic request and is inserted into a command enclosed only by double quotes. Double quotes do not prevent shell evaluation of command substitutions such as `$()` or backticks. If the agent follows this instruction through a shell execution tool, a value such as: ```text $(id > /tmp/agent-command-proof) ``` can be evaluated by the shell before it is passed to the Python script. Other shell metacharacters may become exploitable if quoting is changed, omitted, or reconstructed by the agent. This is an instruction-level command-injection flaw rather than evidence that a malicious payload is currently bundled in the project. Exploitability depends on the agent using a shell to execute the documented command, which the Skill explicitly directs it to do. ### Attack Path 1. An attacker invokes the Skill with a crafted topic or keyword containing shell command substitution. 2. The Skill interpolates that value into the documented `python3` command. 3. The agent submits the reconstructed command to a shell-capable execution tool. 4. The shell evaluates the substitution before launching `surface_candidates.py`. 5. The injected command executes with the operating-system identity and permissions of the agent process. ### Impact Assessment Successful exploitation permits arbitrary command execution within the agent's existing pr ...[truncated 647 chars]
Remediation
## Remediation Suggestions - Do not construct a shell command by interpolating user-controlled text. - Invoke the program through a structured process API with a fixed argument array, for example: ```python subprocess.run( [ "python3", validated_script_path, "--kw", user_keyword, "--top", "15", ], check=True, shell=False, ) ``` - If the agent platform supports structured command arguments, require that interface and explicitly prohibit shell execution. - Validate the keyword against an appropriate length and character policy before execution. - Resolve and validate the script path against an approved vault root. - Run the script in a sandbox with minimal filesystem and network permissions. - Add a regression test using payloads containing `$()`, backticks, quotes, newlines, semicolons, and redirection characters. - If safe structured execution cannot be guaranteed, remove automatic execution and require explicit user approval after displaying the exact command and arguments.

T07 · Tool Hijacking and Spoofing

Error
Location
SKILL.md:193
Finding
Execution of Mutable Scripts Outside the Audited Skill Package## Vulnerability Details **File Location**: `SKILL.md`, lines 193–193 **Vulnerability Type**: Unverified external local code execution **Risk Level**: High ### Complete Vulnerable Instruction ```text 5. Mandatory duplicate check: first run python3 scripts/rebuild_published_index.py from the root of the repository containing this Skill, where scripts, config.yaml, and the Skill directories are siblings. Rebuild the automatic published index from the published-content directory. ``` A second external execution directive also appears at line 131: ```text python3 {vault}/07-scripts-and-tools/surface_candidates.py --kw "{keyword}" --top 15 ``` The path labels and placeholder above are rendered in English, while preserving the operational command structure. ### Technical Analysis Neither script is shipped in the audited project tree. The Skill delegates code execution to files located in a mutable vault or in the parent repository. Consequently, reviewing this package does not establish what code will execute when the Skill is used. The duplicate-check instruction is marked mandatory and tells the agent to leave the Skill directory, locate a sibling repository script, and execute it. There is no requirement to: - Resolve the path against a trusted root. - Verify ownership or write permissions. - Check a cryptographic digest or signed manifest. - Inspect the script before execution. - Confirm the script is not a symbolic link. - Obtain user approval. This creates a local payload-substitution channel. Anyone able to modify the external script, replace the repository root, alter path resolution, or introduce a malicious symbolic link can cause attacker-controlled code to run under a legitimate-looking mandatory operation. ### Attack Path 1. An attacker gains write access to the parent repository, shared vault, workspace, archive extraction location, or another component that supplies the refe ...[truncated 1099 chars]
Remediation
## Remediation Suggestions - Package every required script inside the audited Skill distribution. - Resolve scripts relative to a fixed, canonical Skill root rather than the current working directory, parent repository, or mutable vault. - Publish a signed manifest containing an approved cryptographic digest for every executable file. - Before execution, verify the canonical path, regular-file status, ownership, permissions, and digest. - Reject symbolic links and paths that resolve outside the approved package directory. - Do not describe script execution as mandatory unless the executable is part of the trusted package. - Require explicit user approval before running any executable outside the package. - Execute helper scripts in a sandbox with only the minimum read and write paths required for their function. - Disable network access for index-rebuilding and local candidate-selection helpers unless it is demonstrably necessary. - Log the exact canonical path and verified digest of each executed helper.

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:34
Finding
Automatic Persistence of Attacker-Controlled Feedback Into Framework and Memory State## Vulnerability Details **File Location**: `SKILL.md`, lines 34–37 and 237–239 **Vulnerability Type**: Persistent agent memory poisoning **Risk Level**: High ### Complete Vulnerable Instructions ```text The framework includes a feedback automatic-writeback mechanism. Execute it by default; the user does not need to request the framework explicitly each time. Automatically write any feedback supplied by the user back into the framework according to section 5, without requiring the user to identify it specially. ``` The end-of-session memory instruction adds: ```text Before finishing, identify which topic classes the user rejected and which judgment methods the user confirmed or later data validated. Write these items into the topic Skill memory after checking for duplicates. ``` These passages are English renderings of the complete operational requirements at the cited lines. ### Technical Analysis The Skill explicitly classifies any user feedback as material to be written into a persistent framework. It also directs the agent to extract rejected topic classes and purportedly validated methods and save them into Skill memory. No trust boundary or confirmation requirement separates ordinary conversational text from durable instructions or rules. There is also no defined schema that restricts stored content to inert data. If later sessions read the resulting files as instructions, attacker-controlled text can influence future agent behavior. The risk is amplified by the instruction at line 21 to read Skill memory at startup and by the rule-precedence model that treats vault state as authoritative. Thus, the project contains both sides of a memory-poisoning path: 1. User-controlled conversational input is written persistently. 2. Persistent vault memory and rules are loaded in later sessions. The project does not show the missing external writeback implementation, so the exact serialization behavior c ...[truncated 1748 chars]
Remediation
## Remediation Suggestions - Remove the policy that automatically persists any user feedback. - Require explicit, informed confirmation before every persistent write. - Show the user the exact normalized data that will be stored, its destination, retention period, and scope. - Store preferences as typed data fields, not free-form Markdown or instruction text. - Treat all persisted memory as untrusted data when it is loaded. - Never concatenate memory records into the agent's instruction layer. - Enforce a strict schema with length limits and an allowlist of record types. - Reject commands, tool directives, role markers, prompt delimiters, file paths, URLs, and policy-like language from persistent preference fields. - Separate memory by user and workspace; do not use a shared global vault for conversational feedback. - Keep an append-only audit log and support inspection, rollback, expiration, and deletion. - Require stronger authorization for changes to framework rules than for ordinary preference records. - Add tests in which feedback contains prompt-injection strings and verify that later sessions treat the content only as quoted data.

T01 · Skill Instruction Hijacking

Error
Location
references/规则卡.md:3
Finding
Untrusted External Vault Files Can Override Packaged Skill Rules## Vulnerability Details **File Location**: `references/规则卡.md`, lines 3–3 **Vulnerability Type**: External instruction override without integrity validation **Risk Level**: High ### Complete Vulnerable Instruction ```text When the author's vault contains corresponding rule files, the vault takes precedence and this file is only the baseline. If the two locations differ, follow the vault first and then return to modify this file. ``` Related startup behavior appears in `SKILL.md`, lines 21–24: ```text Read the family agreement, interaction specification, topic Skill memory, shared memory, and the built-in rule card before beginning. When the vault contains corresponding rule files, use the vault as authoritative. ``` The passages above are English renderings of the complete operational requirements at the cited locations. ### Technical Analysis The reviewed package explicitly gives higher authority to external, mutable vault files than to its audited built-in rules. No integrity, provenance, ownership, or content validation is required before those files are loaded. This reverses the expected trust model: the immutable or reviewed package becomes subordinate to workspace state that can change independently. It also directs the agent to propagate external differences back into the packaged rule file, potentially converting a temporary vault compromise into a longer-lived package modification. The affected external files are not included in the supplied project, so their safety cannot be established by this audit. The vulnerability is the unconditional precedence and propagation policy itself, not a claim that those absent files are currently malicious. ### Attack Path 1. An attacker obtains write access to the vault through another Skill, a shared workspace, a compromised synchronization client, or an overly broad agent permission. 2. The attacker places malicious instructions in a rule or memory file that ...[truncated 957 chars]
Remediation
## Remediation Suggestions - Make packaged rules authoritative by default. - Treat vault files as untrusted data or optional user configuration, never as higher-priority instructions. - Define a strict schema for permitted vault overrides and reject free-form behavioral instructions. - Verify external files against an approved owner, canonical path, regular-file check, and signed digest where appropriate. - Present proposed rule changes as a diff and require explicit administrator approval. - Prohibit automatic propagation from vault files into packaged Skill files. - Open built-in Skill files read-only during normal execution. - Separate user preferences from security rules and system behavior. - Record the source and precedence of every loaded rule in an audit log. - If required governance files are missing or fail validation, stop safely rather than falling back to mutable or remembered instructions.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Context-Inappropriate Capability

High
Confidence
96% confidence
Finding
Automatic feedback writeback into framework files is dangerous because user-provided text is treated as trusted configuration input and persisted for future behavior. That creates a durable prompt-injection path where a malicious user can poison the agent's long-term instructions, alter future outputs, or degrade safety controls without a separate authorization step.

Description-Behavior Mismatch

Medium
Confidence
82% confidence
Finding
The manifest frames the skill as a collaborative evaluator of ideas rather than a generator, explicitly saying it does not one-click produce topic lists. However, the implementation includes a dedicated Mode A to pull signals, generate 3–5 candidate topics, and write approved topics into a pipeline file. That is a broader operational behavior than the narrow manifest claim suggests.

Vague Triggers

Medium
Confidence
95% confidence
Finding
Broad natural-language triggers increase the chance of unintended invocation during ordinary conversation. If the skill can read internal files, run scripts, or perform persistent writes, accidental activation expands the attack surface and may cause unauthorized side effects from benign user phrasing.

Natural-Language Policy Violations

Medium
Confidence
83% confidence
Finding
The instruction says "跟用户说话时只说人话,不说理论名" in context of an otherwise Chinese-only skill and provides no option for language or locale choice. Because the skill description and operating instructions assume Chinese output without offering user opt-in or alternatives, this may violate language/locale choice policy.

Description-Behavior Mismatch

Medium
Confidence
91% confidence
Finding
The skill expands beyond topic analysis into automatic memory/framework writeback, which introduces state-changing behavior not clearly bounded by the stated purpose. Hidden or implicit writes can let ordinary user feedback alter persistent instructions or project memory, creating a prompt-injection and integrity risk across future runs.

Context-Inappropriate Capability

Medium
Confidence
80% confidence
Finding
A topic-selection assistant may reasonably compare against prior topics, but invoking a repository script to rebuild published indexes from released content folders is a maintenance operation over the broader content system. That capability is not clearly justified by the manifest's limited description of interactive topic evaluation.

Natural-Language Policy Violations

Medium
Confidence
87% confidence
Finding
The file is entirely written as Chinese-only operating instructions and does not mention any option to adapt output language to user preference. Under the policy rule for language or locale constraints, this can be a violation when a skill effectively forces one language without explicit user opt-in or a documented region-specific justification.

Natural-Language Policy Violations

Low
Confidence
85% confidence
Finding
This markdown file contains a natural-language instruction entirely in Chinese and does not indicate that language selection is optional or user-configurable. Under the stated policy, forcing a specific language without opt-in can be a locale/language policy violation.

Static analysis

No suspicious patterns detected.