Back to skill

Security audit

交互式教学网页生成器

Security checks for vulnerabilities and agentic risk

Overview

This teaching-page generator has a coherent purpose, but its generated HTML can run untrusted lesson content and remote CDN scripts without clear disclosure.

Review before installing or sharing generated pages. Use it only with trusted input files, and be aware that generated HTML may contact third-party CDNs and execute browser code. Prefer a revised version that escapes lesson content, sanitizes any allowed HTML, bundles or integrity-pins dependencies, and clearly documents online/offline behavior.

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
index.js:308
Finding

Persistent HTML and Script Injection in Generated Pages

Content
View full analysis
${title} ``` ```html

${title}

``` ```javascript if (line.startsWith('# ')) { if (currentSection) html += ''; const title = line.replace(/^#\s+/, ''); html += `

${title}

`; currentSection = 'main'; } else if (line.startsWith('## ')) { if (currentSection) html += '
'; const title = line.replace(/^##\s+/, ''); html += `

${title}

`; currentSection = 'sub'; } else if (line.trim()) { if (line.includes('$$')) { html += `
${line.replace(/\$\$/g, '')}
`; } else if (line.match(/^\[动画:/)) { html += this.renderAnimationBox(line); } else { html += `

${line}

`; } } ``` ### Technical Analysis The generator treats lesson-file content as trusted markup. Document titles, headings, formulas, and ordinary lines are interpolated directly into the generated HTML without HTML escaping or sanitization. Because these values are placed in HTML element contexts, an attacker can inject closing tags, arbitrary HTML elements, inline event handlers, or script-capable content. For example, a lesson line containing: ```html ``` is emitted inside a paragraph as active HTML rather than displayed as text. The same issue affects the document title and heading fields, where closing the existing element permits injection into the surrounding document. This is a persistent injection vulnerability because the payload is copied into the generated HTML file and remains active whenever that file is subsequently opened. ### Attack Path 1. An attacker creates or modifies a Markdown lesson file accepted by the generator. 2. Th ...[truncated 1295 chars]
Remediation
View remediation
`, `"`, and `'` according to the output context. 2. Replace the custom line-based conversion with a maintained Markdown parser configured to disable or escape raw HTML. 3. Sanitize rendered Markdown with an allowlist-based HTML sanitizer before inserting it into the final document. 4. Do not permit event-handler attributes, script elements, dangerous URL schemes, embedded frames, or active SVG content. 5. Remove inline event handlers from generated markup so that a restrictive Content Security Policy can be applied. 6. Add a restrictive Content Security Policy that blocks inline scripts and limits scripts, connections, frames, objects, and base URLs to explicitly approved sources. 7. Add automated security tests using payloads in every supported content context, including headings, paragraphs, formulas, titles, malformed tags, event handlers, SVG payloads, and encoded variants. ]]>

T08 · Insecure Dependencies

Warning
Location
index.js:215
Finding

Third-Party Runtime Scripts Loaded Without Integrity Verification

Content
View full analysis
``` ### Technical Analysis Every generated page retrieves and executes three JavaScript resources from a third-party CDN when the page is opened. Although package versions are specified, the script elements do not include Subresource Integrity hashes. The generated page also lacks a restrictive Content Security Policy. Consequently, the browser has no cryptographic mechanism to verify that the downloaded scripts match the versions reviewed by the project author. A compromise involving the CDN, package publication process, dependency account, DNS resolution, or another delivery component could cause modified JavaScript to run in every generated page opened while online. This behavior also conflicts with the documented claim that output is a self-contained file usable offline. Opening the page makes external network requests and discloses ordinary request metadata, such as the viewer's IP address and user agent, to the CDN. ### Attack Path 1. A user generates an HTML lesson page. 2. The user or a recipient opens the page while connected to the network. 3. The browser requests KaTeX and Anime.js resources from jsDelivr. 4. A compromised dependency or delivery path returns modified JavaScript. 5. Because no integrity hash is supplied, the browser accepts and executes the modified response. 6. The malicious dependency operates with the same browser privileges as the generated page. ### Impact Assessment A successful supply-chain compromise could allow arbitrary JavaScript execution in the generate ...[truncated 631 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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 (3)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generated document hard-codes lang="zh-CN", which imposes a specific language/locale on all outputs. This file also uses Chinese-only user-facing strings throughout, with no opt-in or configuration for alternate languages, matching the policy-violation category for forced locale selection.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The generated HTML unconditionally loads third-party JavaScript from public CDNs (KaTeX auto-render and anime.js). That creates a supply-chain and privacy risk: opening the generated file triggers network requests and executes remote code in the viewer's browser, even though the tool's purpose is to transform local teaching materials into HTML. In this skill context, the risk is more meaningful because users may expect a self-contained offline teaching artifact, not one that depends on and trusts external script providers.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language content of the skill, including its description and usage instructions, is entirely in Chinese. Because the file does not state that the skill is region-specific or offer any language/locale choice, it appears to impose a single language without user opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.