Back to skill

Security audit

teaching-app-builder

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent teaching-page generator, with browser CDN and Markdown-sanitization risks users should understand before using it with untrusted content.

Install only if you are comfortable with the skill creating local HTML files and those files contacting public CDNs when opened. For sensitive or untrusted teaching material, ask the agent to sanitize Markdown before inserting it into the DOM and to prefer local or SRI-protected dependencies.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
references/libraries.md:174
Finding

Unsanitized Markdown Rendering Enables Client-Side HTML Injection

Content
View full analysis
``` ### Technical Analysis The example parses `mdText` with `marked.parse()` and assigns the resulting string directly to the DOM through `innerHTML`. Marked is a Markdown parser, not an HTML sanitizer. Depending on its configuration, embedded HTML and dangerous attributes in the source Markdown can remain in the rendered output. If `mdText` contains user-controlled educational material, an attacker can insert elements with executable event handlers, dangerous URL schemes, malicious forms, or embedded external content. Although script elements inserted through `innerHTML` are not reliably executed by browsers, event-handler payloads such as an image `onerror` handler can execute when the generated page is opened. This is especially relevant because the Skill is explicitly intended to transform user-provided teaching text into a browser-openable HTML file. ### Attack Path 1. An attacker supplies educational Markdown containing malicious HTML, for example: ```html ``` 2. The content is placed into the `mdText` variable without sanitization. 3. `marked.parse(mdText)` preserves or emits the malicious HTML. 4. The result is assigned to `article.innerHTML`. ...[truncated 959 chars]
Remediation
View remediation
``` 2. If raw HTML is not required, configure the rendering pipeline to reject or escape embedded HTML. 3. Use `textContent` instead of `innerHTML` wherever rich HTML rendering is unnecessary. 4. Restrict dangerous URL schemes and remove event-handler attributes, forms, iframes, embedded objects, and unnecessary external-resource elements. 5. Add regression tests covering at least: - `` - `` - Links using the `javascript:` scheme - Malicious iframes and forms - Encoded or mixed-case variants of dangerous attributes 6. Add a restrictive Content Security Policy to generated pages as defense in depth. Do not treat CSP as a substitute for sanitization. ]]>

T08 · Insecure Dependencies

Warning
Location
references/cdn-catalog.md:109
Finding

Runtime CDN Dependencies Are Loaded Without Subresource Integrity

Content
View full analysis
``` Other documented runtime dependency examples follow the same unverified loading pattern, including: ```html ``` ### Technical Analysis The Skill instructs generated HTML files to download and execute JavaScript from third-party CDN and mirror domains when the page is opened. Versions are pinned, which reduces accidental version drift, but the resources do not use Subresource Integrity hashes. Without an `integrity` attribute, the browser accepts and executes any content returned for the referenced URL. If a CDN account, mirror infrastructure, DNS resolution path, TLS termination point, or upstream asset is compromised, the effective code executed by previously reviewed HTML files can change after generation. The fallback mechanism expands availability but also expands the trust boundary: either the primary CDN or fallback CDN can provide executable code. The use of `document.write()` is not itself the primary vulnerability here; the security concern is that it inserts another remotely hosted script without integrity verification. ### Attack Path 1. An attacker compromises or gains the ability to alter an asset served by a configured CDN or mirror. 2. A user opens a generated teaching HTML file that references the affected asset. 3. The browser downloads ...[truncated 1139 chars]
Remediation
View remediation
``` 2. Generate hashes from independently obtained, reviewed release artifacts rather than trusting content downloaded from the same CDN being protected against. 3. Ensure fallback resources use the exact same verified content and integrity hash. If mirror content is not byte-identical, maintain and verify a separate approved hash. 4. Prefer embedding audited dependencies into the standalone HTML file where licensing, file size, and project requirements permit. This removes runtime supply-chain changes and better satisfies the standalone-file objective. 5. Continue pinning exact dependency versions, and introduce a controlled update process that includes: - Reviewing upstream release notes. - Verifying provenance and checksums. - Scanning the updated asset. - Regenerating integrity hashes. - Testing the generated HTML offline and online. 6. Minimize the number of dependencies and CDN origins. Remove libraries that are not required by a generated application. 7. Consider a restrictive Content Security Policy that allowlists only required origins. CSP is defense in depth and does not replace integrity verification. 8. Document the expanded trust implications of fallback CDNs and avoid automatic fallback to sources that cannot provide immutable, verifiable artifacts. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (12)

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/libraries.md (reported line 8)May include surrounding context.

Chart.js — 常规统计图

html
<!-- 坑:canvas 必须放在固定高度的容器里,否则 responsive 会把页面无限撑高 -->
<div style="height:340px; position:relative;">
  <canvas id="chart1"></canvas>
</div>

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/libraries.md (reported line 8)May include surrounding context.

Chart.js — 常规统计图

html
<!-- 坑:canvas 必须放在固定高度的容器里,否则 responsive 会把页面无限撑高 -->
<div style="height:340px; position:relative;">
  <canvas id="chart1"></canvas>
</div>

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/skeleton.md (reported line 15)May include surrounding context.

md
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__标题__</title>

<!-- ===== 按需取消注释引入库(URL/坑见 cdn-catalog.md & libraries.md)=====
<script src="https://cdn.bootcdn.net/ajax/libs/Chart.js/4.4.1/chart.umd.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/mermaid/10.9.0/mermaid.min.js"></script>
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/KaTeX/0.16.9/katex.min.css">

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/skeleton.md (reported line 15)May include surrounding context.

md
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>__标题__</title>

<!-- ===== 按需取消注释引入库(URL/坑见 cdn-catalog.md & libraries.md)=====
<script src="https://cdn.bootcdn.net/ajax/libs/Chart.js/4.4.1/chart.umd.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/mermaid/10.9.0/mermaid.min.js"></script>
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/KaTeX/0.16.9/katex.min.css">

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill description contains very broad trigger phrases like '做个网页/做个演示/可视化一下' that can match many ordinary requests and cause the skill to activate when the user did not clearly ask for this specialized capability. Over-broad routing can lead to unintended file generation, unnecessary tool use, and increased exposure to downstream risks from the skill’s write-to-disk behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file explicitly recommends loading third-party JavaScript from public CDNs and even adds automatic fallback to alternate CDNs, but it does not mention integrity pinning, privacy disclosure, or the supply-chain risk of executing remote scripts in users' browsers. In this skill's context, generated teaching apps are intended to be opened locally and trusted by end users, so silently pulling executable code from external origins increases the chance of compromised CDN content, dependency tampering, or unexpected tracking without user awareness.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file is written entirely in Chinese and does not indicate that the user can choose another language or that the skill is intentionally restricted to a Chinese-speaking audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The example takes Markdown output from marked.parse(mdText) and assigns it directly to innerHTML. If mdText can contain untrusted or user-supplied content, embedded HTML or dangerous attributes/scripts may be rendered, leading to DOM XSS in the generated teaching app.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The skill instructs the agent to write a .html file to the current working directory by default, but does not require a clear user-facing warning or confirmation before modifying the filesystem. This can surprise users, create files in unintended locations, or overwrite expected workspace contents if the path handling is ambiguous.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file contains user-facing instructional content exclusively in Chinese, and it does not indicate that the skill is region-specific or that users can opt into this language. Under the natural-language policy criteria, forcing a specific language without user choice is a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill guidance is presented only in Chinese and does not offer a language choice or explain that the skill is intentionally limited to a Chinese-speaking audience. Under the language/locale 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.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Line L009 sets <html lang="zh-CN">, which fixes the generated app to a specific locale. The surrounding markdown presents this as a reusable general skeleton, but does not indicate that Chinese-only output is optional or limited to a region-specific use case.

Content

No source excerpt is available for this finding.