Back to skill

Security audit

Gaokao City Budget

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent university living-cost budgeting skill, with the main caution that generated HTML reports should sanitize web-sourced text and links.

Install only for the intended China-focused university cost research workflow. Expect the skill to search public websites and create local HTML report files for single-city or comparison reports; generated reports should escape cited text and allow only safe http/https source links before opening or sharing.

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
references/output-templates.md:484
Finding

Unescaped External Data and Unvalidated URLs in Generated HTML Reports

Content
View full analysis
[来源1] — [内容] · 采集时间:[日期]
· [来源2] — [内容] · 采集时间:[日期]
``` At lines 626–632, externally derived source and descriptive data are placed directly into quoted HTML attributes: ```html
[X,XXX–X,XXX 元]
[区域说明]
``` ```html
[XXX–X,XXX 元]
食堂+外卖估算
``` ### Technical Analysis The Skill obtains URLs, platform names, descriptions, and other report content from public search results and community sources. The HTML templates place these values into HTML text and quoted attribute contexts without requiring context-sensitive encoding or URL-scheme validation. A maliciously crafted value containing quotation marks and HTML markup could terminate a `data-tip` or `href` attribute and introduce additional attributes or elements. For example, an attacker-controlled description shaped like the following could create an event handler after template substitution: ```text " onmouseover="ATTACKER_CODE ``` Likewise, a source URL using a dangerous scheme such as `javascript:` could execute script when the user clicks the generated source link. The template does not require an allowlist restricting links to `https:` or `http:`. The included static animation script is not itself malicious. The vulnerability arises because generated reports are executable HTML documents and untrusted research data is not explicitly separated from their markup and script context. ### Attack Path 1. A ...[truncated 1383 chars]
Remediation
View remediation
`, `"`, and `'`. - Apply attribute-specific encoding to values inserted into `data-tip`, `href`, and other attributes. 2. **Validate source URLs** - Parse each URL before adding it to the report. - Permit only explicitly approved schemes, normally `https:` and optionally `http:`. - Reject `javascript:`, `data:`, `file:`, `vbscript:`, and malformed URLs. - Resolve and validate redirected destinations where practical. 3. **Harden external links** - Add `target="_blank"` only when needed. - When opening a new browsing context, add: ```html rel="noopener noreferrer" ``` 4. **Avoid raw string interpolation** - Generate report elements through a safe DOM API and assign untrusted text through `textContent`. - Alternatively, use a template engine that performs context-aware auto-escaping by default. - Never construct HTML by concatenating raw search-result metadata. 5. **Sanitize permitted rich content** - If formatting from external sources must be preserved, process it with a maintained HTML sanitizer using a minimal element and attribute allowlist. - Do not permit event-handler attributes, script-capable elements, inline styles, or arbitrary URI-bearing attributes. 6. **Add explicit Skill instructions** - State that web content, community quotations, source labels, and URLs are untrusted. - Require escaping and validation before inserting any retrieved value into an HTML report. - Require plain-text rendering when safe sanitization cannot be guaranteed. 7. **Add regression tests** - Test source values containing quotation marks, angle brackets, event handlers, and encoded payloads. - Test links using mixed-case or encoded dangerous schemes. - Verify that payloads are displayed as inert text and that unsafe links are omitted. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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 (11)

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/output-templates.md (reported line 278)May include surrounding context.

md
</head>
<body>

<!-- ① 页眉 -->
<div class="page-header">
  <div class="city-tag">高考志愿参考 · 生活成本</div>
  <h1>[城市名] 大学生活费预算</h1>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/output-templates.md (reported line 278)May include surrounding context.

md
</head>
<body>

<!-- 1 页眉 -->
<div class="page-header">
  <div class="city-tag">高考志愿参考 · 生活成本</div>
  <h1>[城市名] 大学生活费预算</h1>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/output-templates.md (reported line 371)May include surrounding context.

md
</div>
  </div>

  <!-- ④ 房租详情 -->
  <div class="card">
    <div class="card-title"><span class="icon icon-green">🏠</span>住宿费用参考</div>
    <div class="cost-grid">

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/output-templates.md (reported line 371)May include surrounding context.

md
</div>
  </div>

  <!-- 4 房租详情 -->
  <div class="card">
    <div class="card-title"><span class="icon icon-green">🏠</span>住宿费用参考</div>
    <div class="cost-grid">

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file title and all instructional content are written exclusively in Chinese, which effectively imposes a specific language on skill operation or documentation. Under the policy, language constraints should either be optional for the user or clearly justified as region-specific; this file does not provide such opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The HTML template hard-codes lang="zh-CN", and the surrounding template content is entirely written as Chinese-only output guidance. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes the skill as estimating university living costs based on '房租、餐饮、交通三大支柱'. This file, however, explicitly adds additional dimensions such as utilities, daily necessities/communications, and macro city cost rankings/comparisons, which broadens the operational scope beyond the declared three-pillar model.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description states that single-city reports are generated as HTML files and saved to the outputs directory. Because this behavior writes files to disk, the markdown should clearly warn users that running the skill may create local output files so they are aware of the system-side effect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The multi-city comparison mode specifies that an HTML heatmap file will be saved to the outputs directory. This is a file-write operation affecting the user's workspace, and the markdown lacks a direct warning that files will be created during this mode.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The output section formalizes that modes A and B produce HTML reports saved under outputs, but presents this as process detail rather than a user warning. For markdown-scoped warning checks, file-writing behavior that affects user data or workspace should be explicitly disclosed as a caution or note.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This file is written primarily in Chinese, but key labels such as "Query" and section headings are partially in English. Under the policy rule, forcing a specific language or mixed locale without opt-in can be a natural-language policy issue when no user choice or justification is provided.

Content

No source excerpt is available for this finding.