Back to skill

Security audit

考试刷题网站生成器

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent exam-practice site scaffold, but its shipped web template has a concrete stored browser XSS risk when question data or saved wrong-answer data is not fully trusted.

Review and fix the HTML rendering before using this with imported, shared, or user-contributed question banks: render question data with textContent or sanitized HTML, remove inline event handlers, validate JSON fields, and treat localStorage as untrusted. Only enable the optional cron or launchd updater after confirming the path and schedule are exactly what you want.

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

Error
Location
assets/template.html:1087
Finding

Persistent DOM-Based Cross-Site Scripting Through Unsanitized Question Data

Content
View full analysis
${type}`; return `${r.label}`; } ``` ```javascript state.questions.forEach((q, idx) => { const card = document.createElement('div'); card.className = 'question-card'; card.id = `qcard-${q.id}`; card.innerHTML = `
第 ${idx+1} 题 ${badgeHtml(q.type)}

${q.question}

    ${q.options.map((opt,i) => { const key = ['A','B','C','D','E'][i]; return `
  • ${key} ${opt.slice(3)}
  • `; }).join('')}
`; container.appendChild(card); }); ``` The explanation is inserted through another HTML sink: ```javascript const expEl = document.getElementById(`exp-${q.id}`); expEl.style.display = ''; expEl.innerHTML = `
📖 解析

${q.explanation}

`; ``` Question data stored in `localStorage` is subsequently rendered again without sanitization: ```javascript list.innerHTML = `
Remediation
View remediation
{ selectOption(q.id, key); }); ``` 3. **Sanitize any intentionally supported rich HTML.** If explanations must contain formatting, process them with a maintained sanitizer configured with a restrictive element and attribute allowlist. Event-handler attributes, scripts, embedded frames, dangerous URLs, and active SVG content should be prohibited. 4. **Validate question data before use.** Enforce a schema in the generation script and, defensively, in the browser. At minimum: - Restrict IDs to a conservative character set and maximum length. - Restrict answers to supported option letters. - Require `questions` and `options` to be arrays with bounded sizes. - Require expected fields to be strings with reasonable length limits. - Reject duplicate identifiers. - Restrict question types and categories to known values where practical. 5. **Treat localStorage records as untrusted.** Validate and safely render every field loaded from localStorage. Existing malicious or malformed records must not be assumed safe merely because they were written by the application. 6. **Deploy a restrictive Content Security Policy.** After removing inline event handlers and inline script dependencies, use a policy similar to: ```http Content-Security-Policy: default-src 'self'; s ...[truncated 386 chars]
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill claims to generate a complete exam-practice website with substantial UI and application features, but the content only provides manual instructions and references external template/script files rather than fully implementing those capabilities. This mismatch is dangerous because users or orchestration systems may grant trust, invoke the skill in inappropriate contexts, or assume feature/security properties that are not actually present, leading to unsafe automation decisions and over-privileged use.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 27)May include surrounding context.

md
├── index.html # 单页应用(从 assets/template.html 复制并定制)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 79)May include surrounding context.

md
├── index.html # 单页应用(从 assets/template.html 复制并定制)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 150)May include surrounding context.

md
├── index.html # 单页应用(从 assets/template.html 复制并定制)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 165)May include surrounding context.

md
├── index.html # 单页应用(从 assets/template.html 复制并定制)

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 · assets/template.html (reported line 727)May include surrounding context.

html
</head>
<body>

<!-- ====== HEADER ====== -->
<header class="site-header">
  <div class="header-inner">
    <a href="#/" class="site-logo">管综199<span>·</span>突击</a>

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases include broad generic terms such as '每日练习', '题库网站', and '在线做题', which can cause the skill to activate in many ordinary educational conversations unrelated to this specific website generator. Overbroad invocation is risky because it can unexpectedly steer an agent into file-generation or deployment-oriented behavior when the user only wanted general study help, increasing the chance of unintended actions or confusing, unsafe workflow transitions.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 134)May include surrounding context.

md
2. **自动化每日更新**:配置定时任务(cron / launchd)每日执行 `update_daily.py`
3. **在线部署**:可部署到任何静态托管服务(GitHub Pages、Vercel、Netlify 等)

**定时任务示例**(macOS launchd,配置 StartCalendarInterval,Hour=8, Minute=0,路径为 ~/Library/LaunchAgents/com.exam.update-daily.plist)

## 数据流

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This HTML file explicitly sets the document language to zh-CN and all visible UI text is presented in Chinese, which imposes a specific language/locale on users. Under the policy, locale constraints should either be optional for the user or clearly documented as justified for a region-specific tool.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.