Back to skill

Security audit

学习阶段计划

Security checks for vulnerabilities and agentic risk

Overview

This skill coherently creates Chinese study-plan HTML reports, with a real template-safety issue users should understand before opening generated reports.

Install only if you want a Chinese study-plan generator that creates local HTML reports. Treat generated reports as active HTML: avoid feeding untrusted markup into plan fields, and prefer a hardened version that escapes template values before opening reports in a browser.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
  • 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
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
assets/report_template.html:297
Finding

Unescaped HTML Template Substitution Allows Script Injection

Content
View full analysis
{{PLAN_TITLE}} ``` ```html
{{STAGE_BADGE}}

{{PLAN_TITLE}}

📅 {{DATE_RANGE}} ⏱ {{TOTAL_DAYS}} days 📋 {{SUBJECT}}
``` It also inserts complete generated HTML fragments without an established sanitization boundary: ```html {{PHASE_DETAILS}} ``` ```html
{{MILESTONE_CARDS}}
``` ```html {{CHECKPOINT_ROWS}} ``` ```html
{{TIPS_ITEMS}}
``` The generation instructions define task, milestone, checkpoint, and tip fields as direct substitutions into HTML elements: ```html
{{TASK_CONTENT}}
``` ```html
{{MS_ICON}}
{{MS_TITLE}}
{{MS_DESC}}
📅 {{MS_DATE}} 📊 {{MS_METRIC}} {{MS_PRIORITY_LABEL}}
``` ### Technical Analysis The skill instructs the agent to collect user-supplied study information, preserve user subject wording, generate additional textual fields, and replace template placeholders with those values. No contextual HTML escaping, allowlist sanitization, or input validation require ...[truncated 2682 chars]
Remediation
View remediation
`, `"`, and `'`. - Use separate encoding rules for HTML text, attributes, URLs, CSS values, and JavaScript contexts. 2. **Use an auto-escaping template engine** - Replace unrestricted string substitution with a template engine that escapes values by default. - Reserve raw-HTML output operations for static, developer-controlled fragments only. 3. **Construct repeated sections safely** - Represent phases, tasks, milestones, checkpoints, and tips as structured data. - Generate nodes through safe DOM APIs and assign user-derived values through `textContent`. - If server-side generation is required, escape each nested textual field before assembling the fragment. 4. **Sanitize any intentionally supported HTML** - If formatting markup must be accepted, process it with a maintained HTML sanitizer configured with a strict allowlist. - Reject scripts, event-handler attributes, inline frames, embedded objects, dangerous URL schemes, and active SVG or MathML content. - Do not rely on pattern matching or simple tag removal as a sanitizer. 5. **Validate structural template fields** - Restrict `PRIORITY_CLASS`, `PHASE_CLASS`, numeric percentages, dates, and similar structural values to explicit allowlists or validated formats. - Do not allow arbitrary user-controlled strings in class names, style attributes, or other structural contexts. 6. **Harden report rendering** - Add a restrictive Content Security Policy that blocks inline scripts and event handlers. - Move legitimate interaction code to a fixed local script and authorize it with a hash or nonce where appropriate. - Present generated reports in a sandboxed frame without unnecessary same-origin or privileged capabilities. 7. **Add security regression tests** - Test every user-derived fie ...[truncated 301 chars]
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (6)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest description includes many generic phrases like study plan and review plan that overlap with normal conversational requests. In a skill-routing system, this can make the skill activate too often, leading to over-collection of user details and unexpected file-writing actions for requests that did not require this skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger conditions are very broad and match common study-related requests such as general planning or review help. This can cause unintended skill invocation, increasing the chance the agent performs file-generation behavior or overrides a more appropriate skill without the user explicitly asking for this workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instruction "HTML 报告始终为中文" mandates a single language for output regardless of user preference. This is a language/locale policy concern because the skill does not present Chinese as an opt-in choice or explain a necessary region-specific reason for the restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The HTML document declares lang="zh-CN", and the visible UI text throughout the template is written in Simplified Chinese. This imposes a specific language/locale on all users with no opt-in, fallback, or justification that the skill is region-specific, which matches the language/locale policy-violation category.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs the agent to write HTML files into the workspace and later modify them in place, but it does not require informing the user first. This creates a transparency and consent issue and can lead to unexpected persistent artifacts or overwriting prior outputs, especially during iterative edits.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains user-facing reference content exclusively in Chinese, and nowhere indicates that the skill is China-specific or that users may choose another language. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.