Back to skill

Security audit

SkillFlowChart

Security checks for vulnerabilities and agentic risk

Overview

This is a local flowchart generator whose behavior is mostly disclosed, though generated HTML should be handled carefully when the input comes from an untrusted source.

Install is reasonable for local flowchart generation, but use it on trusted or reviewed nodes.json files only. Avoid opening generated HTML from untrusted skill definitions until loop labels are escaped, legend colors are validated, and a restrictive Content Security Policy is added.

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

Warning
Location
scripts/flowchart.py:693
Finding

Stored HTML/SVG Injection Through Unescaped Workflow Fields

Content
View full analysis
{lp.label}') ``` The loop label is inserted directly into an inline SVG element without calling `_xml_escape()`. #### Unvalidated legend attributes (`scripts/flowchart.py:730-736`) ```python for it, w in zip(items, item_widths): fill = it["fill"] stroke = it["stroke"] parts.append(f' ') parts.append(f' {_xml_escape(it["label"])}') cur += w + gap ``` Custom `legend[].fill` and `legend[].stroke` values are embedded in quoted SVG attributes without validation or escaping. ### Technical Analysis The generator treats `nodes.json` as structured input but does not consistently encode its fields for their destination contexts. Most text fields are passed through `_xml_escape()`, but `loops[].label` is inserted as raw SVG markup. An input such as: ```json { "loops": [ { "from": "end", "to": "start", "label": "", "path": "left_edge" } ] } ``` can close the intended `` element and introduce attacker-controlled SVG or HTML elements into the generated document. Custom legend colors create a separate attribute-injection sink. Because values are placed inside `fill="..."` and `stroke=" ...[truncated 1768 chars]
Remediation
View remediation
{_xml_escape(lp.label)}' ) ``` 2. Strictly validate custom legend colors. Accept only explicitly supported CSS color formats, such as six-digit hexadecimal values: ```python import re COLOR_RE = re.compile(r"^#[0-9A-Fa-f]{6}$") def _validate_color(value: str) -> str: if not COLOR_RE.fullmatch(value): raise ValueError(f"Invalid legend color: {value!r}") return value ``` Apply this validation to both `legend[].fill` and `legend[].stroke`. 3. Do not rely only on generic XML escaping for color fields. Validation against an allowlist is preferable because those fields are intended to contain colors, not arbitrary attribute text. 4. Consider replacing the custom escaping function with the standard library implementation: ```python from html import escape safe_value = escape(value, quote=True) ``` 5. Add regression tests covering: - `` in loop labels. - Double and single quotation marks in legend fields. - SVG event attributes such as `onload`. - Markup-breaking values in `fill` and `stroke`. - Ampersands and angle brackets in every user-controlled text field. 6. Add a restrictive Content Security Policy to generated HTML as defense in depth. For a self-contained document that requires no JavaScript or network resources, an appropriate baseline is: ```html ``` Output encoding and input validation remain mandatory even when a Content Security Policy is present. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (34)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code is clearly a flowchart renderer/layout engine, which is broadly aligned with the visualization part of the description. However, the key declared behavior says it reads SKILL.md or skill definition files and extracts decision/execution structure automatically. This code does not do that. It only consumes an already-structured JSON graph (nodes, edges, loops), validates it, lays it out, and emits HTML/SVG. That is a material description-behavior mismatch because the advertised input source and extraction capability are absent. The extra --json-out debug export is minor but undeclared. Overall, the primary output format matches, but the primary input/parsing capability is materially different.

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 12)May include surrounding context.

md
读取一份 `SKILL.md`,提取结构化数据 `nodes.json`,脚本确定性生成流程图 HTML。

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
读取一份 `SKILL.md`,提取结构化数据 `nodes.json`,脚本确定性生成流程图 HTML。

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.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description and title present the skill in Chinese as the default operating language, while also mixing in English keywords, but nowhere state that the user can choose output language. Under the policy, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a skill whose purpose is to read skill definition files such as SKILL.md and produce a self-contained HTML flowchart. This file instead contains a pre-rendered, hardcoded HTML/SVG visualization for a different subject (HaluCatch), with no logic to read input files or generate diagrams dynamically.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The flowchart’s entry condition is effectively any user invocation of HaluCatch, with no visible gating, exact trigger phrasing, or scope constraints. In an agent-skill context, overly broad activation can cause unintended execution of scanning and downstream report generation on inappropriate targets, increasing the chance of misuse or surprise actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The node for report generation explicitly says output is written to disk, but the workflow does not show any prior disclosure, confirmation, or destination transparency. Silent file creation can leak sensitive analysis results, overwrite user expectations about persistence, or leave artifacts on shared or restricted systems.

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 declares lang="zh-CN" and all user-facing text in the page header and flowchart is presented only in Chinese. This imposes a specific language/locale on users without any visible opt-in, alternative language option, or justification that the skill is region-specific.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest describes a read/parse/visualize tool that reads SKILL.md or skill definition files and outputs a self-contained HTML flowchart. This HTML document instead depicts a workflow that includes generating repair plans and applying fixes to a target skill, which goes beyond merely visualizing execution flow and suggests remediation/modification behavior not covered by the manifest.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Nearly all user-facing labels and subtitles are written in Chinese, and there is no indication that the user may choose another language or locale. This creates a natural-language policy concern because the workflow appears to enforce a specific language without documenting opt-in or a justified locale restriction.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The node label '用户触发 HaluCatch' describes invocation in a generic way without specifying concrete trigger phrases, allowed contexts, or exclusion conditions. In a manifest/JSON workflow description, this can create ambiguity about when the skill should activate versus when it should not.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The embedded documentation presents the skill as a reliability evaluator with multi-stage analysis rather than a flowchart generator. This contradiction undermines transparency and can conceal materially different behavior from what the manifest advertises, which is dangerous in agent environments where users rely on manifests to judge trust and privilege boundaries.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The flowchart documents behavior that goes beyond the manifest’s declared scope of reading a skill file and generating a flowchart. In particular, it describes generating repair plans and applying fixes to a target skill, which can mislead reviewers and users about the actual authority and side effects of the skill, increasing the risk of unauthorized modification if the implementation follows the documented behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The flowchart explicitly includes '应用修复 / AI 修改目标 Skill', indicating automated modification of another skill without any visible warning about code changes, review requirements, rollback, or side effects. In an agent-skill context, silent or under-disclosed code modification is especially risky because it can alter trusted automation artifacts, introduce defects, or be abused to persist unwanted behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The HTML declares lang="zh-CN" and all user-facing titles/subtitles are presented in Chinese, which imposes a specific language/locale on readers. The file does not indicate that this is optional, configurable, or justified as a region-specific artifact, so it conflicts with the policy against forced language selection without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This JSON file presents the skill's title, subtitles, labels, and process text in Chinese, with no indication that the language is optional or region-specific. That creates a natural-language locale policy concern because the skill appears to force a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

All user-facing labels and descriptions in this file are written in Chinese, with no indication that the user can choose another language or that the locale restriction is intentional and documented. Under SQP-3, forcing a specific language without opt-in can violate language or locale policy expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code sets the generated document language to zh-CN in the HTML root element, which imposes a specific locale on all generated output. The file does not offer a language choice or explain why the output must be Chinese, 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
96% confidence
Finding

The user-facing title, subtitle, and node labels are entirely in Chinese, with no indication that other languages are supported or that the user can choose a preferred language. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation presents "English" as the default and links to Chinese as an alternate, which is a natural-language locale choice embedded in the skill materials. Under the policy rule, forcing a specific language without explicit user opt-in can be a locale-policy violation, and this file does not indicate that users may choose their preferred language before interaction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file declares lang="zh-CN" and all visible UI text is in Chinese, which imposes a specific language/locale on users. There is no indication that this is optional, user-selected, or required for a region-specific purpose, so it appears to violate the language-choice policy.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

Line L025 describes an end-to-end operational flow ending in persisted reports, which can be read as describing actual behavior. In reality, the file is inert documentation markup containing a drawing, so the text overstates what the file itself does.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document declares lang="zh-CN", and all user-facing text in the flowchart is Chinese, which imposes a specific language/locale on users. Under the policy, locale constraints should either be optional for the user or clearly justified as region-specific, neither of which is stated in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The file declares lang="zh-CN" and all visible UI text is presented in Chinese, which imposes a specific language/locale on users. There is no indication in the document that the language choice is optional or that the skill is intentionally limited to a China-specific context.

Content

No source excerpt is available for this finding.