Back to skill

Security audit

Study Notes

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its study-notes purpose, but it needs review because it installs unpinned packages into the active Python environment and generated HTML loads third-party JavaScript.

Install only after reviewing the runtime commands. Prefer a virtual environment with pinned dependencies instead of `--break-system-packages`, and avoid opening generated HTML with sensitive embedded homework images unless the KaTeX assets are bundled locally or the content has been redacted.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
references/design-system.md:296
Finding

Generated HTML Executes Remote JavaScript Without Integrity Verification

Content
View full analysis

Vulnerability Details

File Location: references/design-system.md:296-335 and SKILL.md:463-466
Vulnerability Type: Remote third-party JavaScript execution without Subresource Integrity
Risk Level: High

Vulnerable Code

html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js"
  onload="
    renderMathInElement(document.body, {
      delimiters: [
        {left:'$$', right:'$$', display:true},
        {left:'$',  right:'$', display:false}
      ],
      throwOnError: false,
      macros: {
        '\\dj':      '{\\text{đ}}',
        '\\degree':  '{{}^\\circ}',
        '\\d':       '{\\mathrm{d}}',
        '\\e':       '{\\mathrm{e}}',
        '\\i':       '{\\mathrm{i}}',
        '\\cdotp':   '{\\cdot}',
        '\\unit':    '{\\,\\text}',
        '\\celsius': '{{{}^\\circ\\text{C}}}',
        '\\bm':      '{\\boldsymbol}'
      }
    });
  "></script>

Technical Analysis

The skill directs the agent to copy an HTML template that downloads and executes two JavaScript resources from cdn.jsdelivr.net whenever a generated study-notes file is opened. Although the URLs identify KaTeX version 0.16.9, the script elements do not contain integrity attributes, and there is no Content Security Policy restricting script or network behavior.

Consequently, the reviewed skill package does not contain the complete code that ultimately executes. Control of the CDN response, the associated package distribution, or a trusted network path could allow the returned JavaScript to differ from the code expected during the audit. The remote script executes with the same browser-document privileges as the legitimate KaTeX library.

This ...[truncated 1505 chars]

Remediation
View remediation

Remediation Suggestions

  1. Vendor the exact KaTeX CSS, JavaScript, fonts, and auto-render component inside the skill or embed them directly into generated output.
  2. If a CDN must remain supported, add verified SHA-384 or SHA-512 Subresource Integrity hashes and crossorigin="anonymous" to every external stylesheet and script:
    html
    <script
      defer
      src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js"
      integrity="sha384-VERIFIED_HASH"
      crossorigin="anonymous"></script>
    
  3. Generate integrity values from independently verified release artifacts rather than copying unverified hashes from the same delivery channel.
  4. Add a restrictive Content Security Policy. Prefer bundled scripts with hash-based authorization and set connect-src 'none' if generated notes require no network access.
  5. Remove inline event handlers such as onload and place the initialization logic in a bundled, reviewed script so that a strict CSP can be used.
  6. Add an offline test confirming that generated files render correctly with networking disabled.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:98
Finding

Unpinned Python Dependencies Are Installed Into the Active Environment

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:98 and references/workflow-orchestration.md:155
Vulnerability Type: Unpinned dependency installation without hash verification
Risk Level: Medium

Vulnerable Code

bash
pip install pymupdf --break-system-packages -q
bash
# pip install sympy --break-system-packages -q

The PDF helper repeats the same installation instruction:

python
except ImportError:
    sys.exit("PyMuPDF not installed. Run: pip install pymupdf --break-system-packages -q")

Technical Analysis

The documented workflow instructs users or agents to install pymupdf and sympy without fixed versions or cryptographic hashes. Installation therefore resolves to whichever release the configured package index serves at execution time rather than to an artifact reviewed with this project.

The --break-system-packages option explicitly bypasses protections intended to prevent pip from modifying an externally managed Python installation. This can alter the active environment, produce dependency conflicts, or replace packages relied upon by other applications. Package installation also runs package build and installation logic with the privileges of the invoking process.

The package names observed in the project are established package names rather than apparent typosquatting attempts, and no malicious package is bundled in the repository. The risk arises from mutable, unverified supply-chain inputs and installation into an insufficiently isolated environment.

Attack Path

  1. An attacker compromises a relevant package release, its package-index account, the configured package index, or a dependency selected by the resolver.
  2. A user or agent follows the skill instructions and runs the unpinned installation command.
  3. pip downloads the currently resolved artifact without checking it against a project-maintained hash.
  4. Build or installation code from ...[truncated 749 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every direct and transitive dependency to an approved version.
  2. Maintain a lock file or requirements file containing cryptographic hashes, and install with hash enforcement:
    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  3. Download packages only from an explicitly configured trusted index and verify artifacts against independently obtained release information.
  4. Install dependencies in a dedicated virtual environment:
    bash
    python3 -m venv .venv
    .venv/bin/python -m pip install --require-hashes -r requirements.txt
    
  5. Remove --break-system-packages from all documentation and error messages.
  6. Consider a reproducible container or prebuilt, signed environment for PDF and symbolic-math processing.
  7. Add automated dependency scanning and a controlled update process before changing pinned versions.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises an educational content generator that creates polished HTML study notes and full step-by-step homework solutions. In contrast, the code shown does not generate notes, solve problems, summarize PDFs, or respond to academic requests. Its actual function is narrowly focused on concatenating preexisting HTML fragments and statically checking the resulting HTML for formatting/rendering issues related to KaTeX and markup structure. This is a materially different primary purpose, not merely a supporting detail of the described skill. The build/check CLI behavior is also unrelated to the declared trigger conditions about user study-note or homework requests.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a user-facing educational skill whose primary purpose is generating academic notes and full homework solutions in polished HTML. The actual code chunk does none of that. It is a maintenance/repair script for already-existing HTML content, specifically fixing dangerous Unicode characters inside KaTeX math spans and saving modified files. While math-fixing could be a supporting implementation detail inside a larger note-generation system, this code chunk by itself is materially different in primary purpose and capability from the declared skill behavior. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description centers on creating educational HTML notes and full homework-solution pages. The actual code does not generate notes, solve problems, render figures, or build the described standalone HTML output. Instead, it post-processes an existing HTML file to extract flashcards and quiz items into a TSV for Anki import. This is a materially different primary purpose and an undeclared capability. While it is adjacent to study-note workflows, it is not merely an implementation detail of note generation; it is a separate export/conversion tool with different behavior and outputs.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose is a user-facing educational content generator that creates polished HTML notes and homework solutions. The actual code does not generate notes, solve problems, process PDFs, or render standalone study pages. Instead, it is a test harness for build_and_check.py, focused on validating macro registration and forbidden-command detection behavior. This is a materially different primary purpose and unrelated to the declared triggers, so it is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose is an end-user educational content generator that creates polished HTML notes and homework solutions. The actual code chunk does not generate notes, solve problems, process user requests, or render standalone educational HTML pages. It is a narrow internal test file for validating behavior of a math-markup repair tool (fix_html and check_unicode_in_math). This is a materially different primary purpose, so the description does not accurately represent the supplied code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose focuses on producing polished standalone HTML study notes and full homework solutions from user requests or uploaded academic materials. The actual code does not implement or test any of those behaviors. Instead, it is a regression test for a separate module that converts HTML deck/quiz fragments into Anki-compatible cards and normalizes math formatting. This is a materially different primary purpose and capability set, so the description does not accurately represent the supplied code chunk.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly supports generating full homework solutions, but the description does not prominently warn users or downstream systems about this high-risk educational-integrity behavior. Hidden capability to provide complete answers can bypass policy expectations, facilitate cheating, and cause accidental invocation where only study assistance was intended.

Content

No source excerpt is available for this finding.

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/design-system.md (reported line 295)May include surrounding context.

md
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TOPIC — 学习笔记</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>📖</text></svg>">
<!-- KaTeX -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js"

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/design-system.md (reported line 346)May include surrounding context.

md
<body>
<div class="page">

<!-- HEADER -->
<div class="header">
  <h1>TOPIC</h1>
  <p class="subtitle">SUBTITLE</p>

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/design-system.md (reported line 678)May include surrounding context.

md
<div class="section">
  <div class="section-header">...</div>

  <div class="callout exam">...</div>          <!-- section-level banner: OK outside card -->

  <div class="card">
    <h3>定理陈述</h3>

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/problem-solutions.md (reported line 42)May include surrounding context.

md
<h3 id="q3-stmt">题目</h3>
    <p>质量 $m_1 = 2\,\text{kg}$ 的滑块以 $v_0 = 3\,\text{m/s}$ 撞上静止的 $m_2 = 4\,\text{kg}$ 滑块并粘连,求碰后共同速度与机械能损失。</p>

    <!-- FIGURE: either inline SVG (simple) or embedded <img> (complex/photo). See §3–§4. -->
    <div style="text-align:center;margin:12px 0;">
      <svg viewBox="0 0 360 120" width="360" xmlns="http://www.w3.org/2000/svg"><!-- simple diagram --></svg>
    </div>

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
95% confidence
Finding

The trigger phrases are extremely broad and can cause the skill to activate on ordinary study/help requests that did not ask for file generation, solution writing, or homework completion. Over-triggering increases the chance of inappropriate behavior, including unsolicited full homework solutions and unnecessary file/tool usage on user content.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill instructs the agent to run pip install ... --break-system-packages during normal processing of user-supplied PDFs. Installing packages at runtime expands the attack surface, can alter the host environment, and may execute setup/install code from external repositories, which is unnecessary and risky in a content-generation skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The HTML template forces lang="zh-CN", and the surrounding template strings and labels are written in Chinese throughout the generated page. This constitutes a language/locale policy issue because the skill imposes a specific locale by default rather than offering a user choice or clearly documenting that the template is only for a China/Chinese-specific use case.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The template loads KaTeX CSS and JavaScript from jsDelivr at runtime, which means generated pages are not truly self-contained and will make external network requests when opened. This leaks user metadata such as IP address, user agent, and viewing time to a third party, and it also creates a supply-chain dependency where compromised or changed CDN assets could affect every generated note page.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document hard-codes Chinese labels and headings for problem cards, which can override or ignore the user's preferred language. In an educational skill this is primarily a product safety and usability issue: users may receive outputs they cannot understand, and language mismatch can undermine informed review of generated homework solutions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The rules require Chinese-only wording for the solution summary and table of contents, with no user opt-in. This creates the same language-forcing issue at a policy level, making non-Chinese output impossible even when the surrounding request is in another language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs embedding uploaded photos and PDF crops directly into self-contained HTML as base64 data URIs, but gives no privacy warning or redaction guidance. In this context, homework photos and worksheets may contain names, student IDs, handwritten notes, watermarks, or other sensitive content that would be permanently copied into the generated output and easy to redistribute.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file includes mandatory or user-facing labels such as 已核验 ✓, 用刚才 §2.3 的动量守恒, and 本章习题自测, which steer generated content toward Chinese. The document does not state that the skill is China/Chinese-specific or give users an opt-in choice of language, so it creates a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The generated flashcard back text uses fixed Chinese strings such as "正确答案" and the quiz tag is hard-coded as "自测", which imposes a specific language on users. The file does not offer a language option or document a justified locale-specific limitation, so this is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest focuses on producing polished study notes and homework solutions as a single HTML file. Persisting quiz answers in browser localStorage introduces stateful client-side data retention that is not mentioned in the manifest and is not necessary for the core note/solution generation function.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The design-system text explicitly says the quiz/notes are self-contained and fit an offline, owned-by-the-student single-file model. In the same file, the HTML template imports KaTeX from external CDN URLs, which contradicts that offline/self-contained claim because math rendering depends on network availability unless previously cached.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module documentation at L003-L023 explicitly says the deck is embedded as plain HTML elements inside a hidden div, and even emphasizes 'NOT JSON'. However, the runtime error at L104 tells users to add a '

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.