Back to skill

Security audit

guidelines

Security checks for vulnerabilities and agentic risk

Overview

This is a real FTdesign HTML generator, but its helper script can write outside the intended workspace and can embed unsafe HTML from configuration values into previews.

Review before installing. Only run the Python generator on configuration files you trust, check output_filename carefully, and avoid previewing generated HTML from untrusted input. The script should be fixed to constrain output paths to a dedicated generated directory, refuse unexpected overwrites, validate icon class names, and HTML-escape rendered strings.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate-html.py:68
Finding

Arbitrary File Write Through Unrestricted Output Filename

Content
View full analysis
Remediation
View remediation
Path: candidate_name = Path(filename) if candidate_name.is_absolute(): raise ValueError("Absolute output paths are not permitted") if ".." in candidate_name.parts: raise ValueError("Parent-directory traversal is not permitted") if candidate_name.suffix.lower() != ".html": raise ValueError("Output files must use the .html extension") base = output_dir.resolve() candidate = (base / candidate_name).resolve() if not candidate.is_relative_to(base): raise ValueError("Output path escapes the configured output directory") return candidate ``` 3. Use the validated path for every page-generation method: ```python output_path = validate_output_filename(self.output_dir, output_filename) output_path.write_text(html_content, encoding="utf-8") ``` 4. Consider refusing to overwrite existing files unless the caller provides an explicit overwrite option: ```python with output_path.open("x", encoding="utf-8") as output_file: output_file.write(html_content) ``` 5. If overwrites are required, verify that the destination is a regular file under the approved directory and is not a symbolic link. 6. Run the generator with a minimally privileged account and never as an administrator or root user. 7. Add automated tests covering absolute paths, nested traversal, symbolic-link escapes, alternate extensions, and valid nested output paths. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate-html.py:55
Finding

HTML and Script Injection Through Unescaped Configuration Values

Content
View full analysis
内容管理 - 文章列表", f"{page_title}") html_content = html_content.replace("内容管理系统", system_name) # Replace sidebar html_content = self._replace_sidebar(html_content, system_name, sidebar_icon, menu_items) # Replace breadcrumb and title html_content = html_content.replace("文章列表", page_title) ``` Equivalent replacements occur in the form and detail generators: ```python # Replace placeholders html_content = html_content.replace("内容管理 - 编辑文章", f"{page_title}") html_content = html_content.replace("内容管理系统", system_name) # Replace sidebar html_content = self._replace_sidebar(html_content, system_name, sidebar_icon, menu_items) # Replace breadcrumb and title html_content = html_content.replace("编辑文章", page_title) ``` ```python # Replace placeholders html_content = html_content.replace("内容管理 - 文章详情", f"{page_title}") html_content = html_content.replace("内容管理系统", system_name) # Replace sidebar html_content = self._replace_sidebar(html_content, system_name, sidebar_icon, menu_items) # Replace breadcrumb and title html_content = html_content.replace("文章详情", page_title) ``` Sidebar values are also interpolated directly into text and attribute contexts: ```python """Replace sidebar content""" # Replace icon if sidebar_icon: html_content = html_content.replace('class="ri-box-3-fill"', f'class="{sidebar_icon}"') # Generate menu HTML menu_html = "" current_group = None for item in menu_items: group = item.get("group", "主菜单") if group != ...[truncated 3806 chars]
Remediation
View remediation
{safe_group}\n' menu_html += ( f'' f'{safe_name}\n' ) ``` 3. Do not rely solely on escaping for icon class names. Validate them against a strict allowlist or conservative pattern: ```python import re ICON_PATTERN = re.compile(r"^ri-[a-z0-9-]+$") def validate_icon(value: str) -> str: if not ICON_PATTERN.fullmatch(value): raise ValueError("Invalid Remix Icon class") return value ``` 4. Prefer a maintained template engine with automatic HTML escaping rather than manual global string replacement. 5. Add a restrictive Content Security Policy to generated pages. If no JavaScript is required, a suitable baseline is: ```html ``` 6. Render previews in a sandboxed, isolated origin without privileged IDE APIs. Do not share the preview origin with authenticated or sensitive applications. 7. Add regression tests using payloads that attempt to break out of text, title, and quoted attribute contexts. 8. Validate the complete configuration schema, including maximum string lengt ...[truncated 50 chars]
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (15)

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/templates/base-layout.html (reported line 7)May include surrounding context.

html
<meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{PAGE_TITLE}}</title>
    <!-- Remix Icon CDN -->
    <link href="https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css" rel="stylesheet">
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger examples are broad natural-language requests such as '帮我做个订单查询页面', which can easily overlap with ordinary conversation. In an agent environment, this raises the chance of unintended skill activation and unrequested file-generation behavior, especially because the skill later states it writes HTML files and opens previews automatically.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The page-type keyword mapping uses generic words like '列表', '表格', '查询', '编辑', and '查看', which are common in normal conversation and many unrelated tasks. Without stronger activation constraints, the skill may misclassify user intent and trigger file creation or UI generation when the user only meant to discuss or ask about those concepts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README says the skill will generate HTML files in the workspace and automatically open them in the IDE preview, but it does not describe an explicit warning, consent, or review step. This creates a safety issue because users may unintentionally cause filesystem changes or render generated HTML without understanding that side effects will occur.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The auto-load conditions are underspecified and lack clear boundaries, so the skill may activate on vague or incidental mentions of page-related terms. In an agent environment, ambiguous activation increases the risk of unintended tool/skill invocation, which can override more appropriate behaviors and expand the attack surface for prompt injection through unrelated user content.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger keywords are broad enough that ordinary requests containing generic terms like “列表”, “管理”, or “查看” could activate the skill unintentionally. That can cause the agent to apply this skill in contexts where the user did not ask for HTML generation, leading to incorrect behavior, prompt-context hijacking of normal workflows, or unnecessary file generation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The HTML root sets lang="zh-CN", which forces a specific language/locale in the rendered output. Under the policy, locale constraints should offer user choice or be explicitly justified as region-specific; neither is present in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document explicitly sets the page language to zh-CN and all visible UI text is in Chinese, which imposes a specific language/locale on users. Under the policy, this is a natural-language locale restriction unless the skill offers language choice or clearly documents a justified region-specific scope, neither of which appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This JSON configuration uses Chinese-only natural-language values for the page title, menu labels, field labels, placeholders, and options, with no indication that the skill is region-specific or that users can opt into another language. That creates a natural-language policy concern under the locale/language rule because the file appears to enforce a specific language by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

该 Markdown 文档全文以中文编写,标题和说明未提供其他语言选项,也未说明这是面向特定中文区域或团队的限定文档。根据语言/locale 政策,若强制特定语言而没有用户选择或明确、合理的本地化范围说明,属于自然语言层面的策略问题。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The title and introductory text establish the specification entirely in Chinese, and the document contains prescriptive language throughout without any indication that users may choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document sets lang="zh-CN", and the visible UI text throughout the page is exclusively in Simplified Chinese. This imposes a specific language/locale without any opt-in, alternative, or stated region-specific justification, which matches the policy-violation category for locale constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This template declares lang="zh-CN" and presents all visible UI text in Chinese, which imposes a specific language/locale by default. Under the policy, locale constraints should either be optional for the user or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The visible UI strings in this JSON configuration are entirely in Chinese, including page title, menu labels, filters, and table headers. For a general-purpose skill/config file, this can indicate a fixed language/locale experience without any opt-in, selection mechanism, or documented region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This file is a markdown document, so natural-language policy checks apply. The content consistently forces a single locale (zh-CN and Chinese-only headings/instructions) with no opt-in or note that the skill is intended only for Chinese-speaking or region-specific use.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.