Back to skill

Security audit

COS后期提示词

Security checks for vulnerabilities and agentic risk

Overview

This skill mainly generates cosplay photo-editing JSON presets, but it also writes files locally and can persist user-provided style instructions into its own skill data.

Install only if you want a Chinese-language cosplay photo-editing preset generator and are comfortable with it creating JSON files in Downloads. Do not use the style-learning feature for untrusted style text unless you review exactly what will be written to references/styles-learned.md, because learned entries persist and can affect future preset generation.

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
SKILL.md:217
Finding

Persistent Prompt Injection Through the Learned-Style Store

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:217-228; supporting data schema at references/styles-learned.md:3-11
Vulnerability Type: Persistent prompt injection through user-controlled instruction storage
Risk Level: Medium

Vulnerable Code Segment

The following is an English translation of the complete relevant source section from SKILL.md:217-228:

markdown
### Style Learning (Adding a New Style to the Library)

Trigger: The user provides a style that is not in the built-in library
(by supplying a name and characteristics, or an image in that style) and
asks the Skill to learn it.

Process:
1. Extract: Summarize the style according to the five recognition dimensions
   and prepare a new entry containing the style name, trigger words,
   characteristics, and instruction wording.
2. Confirm: Show the proposed entry to the user and obtain consent before writing.
3. Store: Append it to `references/styles-learned.md`, preserving the entry
   template, and tell the user that the style has been learned.
4. Invoke: During subsequent generation, match it alongside the built-in library;
   the user can invoke it by asking to use the newly learned style.

Note: Learning modifies a Skill file. Perform it only when the user explicitly
asks the Skill to learn the style, and show the entry for confirmation before
writing it.

The supporting schema in references/styles-learned.md:3-11 defines the persisted field as follows:

markdown
# Learned Style Library

Maintained by the style recognition and learning feature. New styles supplied
by users and absent from the built-in style library are appended here after
user confirmation. During generation, consult the built-in library first and
then this library.

## Entry Template

### <Style Name>
- Trigger words: Words the user may use
- Characteristics: Line, color, lighting, texture, and atmosphere dimensions
- Instruction wording: Chinese-language description that can be injected
  d
...[truncated 2513 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace free-form instruction storage with a strict structured schema containing only validated visual properties, such as:
    • Style name
    • Trigger words
    • Line characteristics
    • Color palette
    • Lighting characteristics
    • Texture
    • Atmosphere
  2. Generate final style prose from those validated fields instead of persisting directly injectable instruction text.
  3. Apply allowlist validation that permits descriptive visual vocabulary while rejecting:
    • Role or identity changes
    • Instructions directed at the agent
    • Tool or filesystem requests
    • URLs and external resource references
    • Code blocks or executable syntax
    • Requests to ignore, override, or replace instructions
    • Output-format control directives
  4. Treat learned entries as untrusted data and place them inside explicit delimiters when they are read.
  5. Require the user to review an exact file diff before committing an entry, rather than only reviewing a summarized version.
  6. Restrict writes to the single learned-style data file and use atomic file replacement to prevent corruption.
  7. Add provenance metadata recording when and why each style was added.
  8. Provide commands to inspect, disable, delete, and reset learned entries.
  9. Revalidate all persisted entries every time they are loaded so that previously stored unsafe content cannot bypass newer validation rules.
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 (15)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs the agent to write generated files directly into the user's Downloads directory and report the path. Unprompted filesystem writes expand the skill from content generation into local side effects, which can violate user expectations, enable unwanted file drops, and create a primitive persistence or staging mechanism if similar patterns are reused in more dangerous skills.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The badge explicitly declares the skill language as Chinese, and later instructions state that JSON values are professional Chinese descriptions for direct use. The README does not offer an opt-in language choice or explain a necessary region-specific constraint, so this appears to impose a locale/language preference in a way that conflicts with the policy criteria.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill says it must be used for 'any' style-related request such as '二次元', '电影感', '高级感', and for broad questions like '这个风格怎么做', which can appear in many general conversations beyond this specific skill's intended scope. It does not provide clear exclusion conditions or negative examples to prevent accidental activation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill tells the agent to save output into the user's Downloads folder without a prominent prior warning in the skill description or a consent gate at execution time. Hidden side effects reduce transparency and can surprise users with local file creation, which is especially risky when the skill is triggered broadly.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The persistent 'style learning' feature directs the skill to modify its own knowledge base by appending to 'references/styles-learned.md'. Self-modifying behavior creates a prompt/data poisoning surface where a user can introduce malicious or policy-bypassing content that persists across future uses of the skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file states that the core output is a Chinese visual description, which imposes a specific language by default. Because no user choice or opt-in is provided here, this is a natural-language locale policy concern under the language/locale rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill content is written entirely in Chinese and strongly steers outputs toward Chinese without indicating any fallback or user-language negotiation. This can cause unsafe or unusable behavior for users who operate in other languages, increasing the risk of misunderstanding instructions or producing outputs the user cannot validate before use.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file instructs the agent to invoke this skill whenever users mention broad aesthetic terms like '二次元', '电影感', '写实', or '高级感'. These are common descriptive phrases that can appear in many unrelated conversations, so the trigger scope is overly broad and may cause unintended skill activation, leading the agent to override user intent or route ordinary image discussions into this specialized workflow.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list includes many generic style and parameter terms without scope guards, including common words for style, realism, simplicity, and image proportions. Because these terms are widely used outside this skill's intended context, they create a high risk of accidental invocation and prompt hijacking at the routing layer, especially if the host agent uses keyword-based tool selection.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The activation examples include broad everyday terms such as “眼睛” and “妆容”, which are not specific enough to clearly distinguish when this skill should activate versus when a user is merely mentioning those subjects. The file also does not provide exclusion conditions or negative examples to narrow trigger scope.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger list includes generic nouns like “头发” and “光泽”, which can occur in ordinary conversation without indicating a request to run this skill. The activation boundary is unclear because no constraints or non-trigger examples are given.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The listed triggers include very broad terms such as “衣服” and “瑕疵”, which are common descriptors and do not by themselves indicate a request for clothing repair or enhancement. The description lacks specificity about what combination of words or intent should activate the module.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This JSON manifest contains user-facing role and instruction content entirely in Chinese, with no indication that language selection is optional or that the skill is intentionally limited to a Chinese-speaking context. Under the policy, forcing a specific language or locale without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The section titled "中文提示词写作建议" gives prescriptive guidance centered on Chinese prompts and states that Chinese works well, without indicating that users may choose another language. This can be read as a locale/language preference baked into the skill materials rather than an explicit user-controlled option.

Content

No source excerpt is available for this finding.