Back to skill

Security audit

analysis-toolkit

Security checks for vulnerabilities and agentic risk

Overview

This QC analysis skill is not overtly malicious, but it needs Review because it can persistently modify code/templates, expose an unauthenticated config server, and understates those behaviors.

Install only with Review-level caution. Use a sandboxed workspace, do not run the configuration server on shared or exposed networks, avoid untrusted templates or datasets, and disable or remove runtime Python source generation before relying on this for production analysis.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (7)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/operations/generator.py:58
Finding

Unvalidated Operator Generation Persists Attacker-Controlled Python Code

Content
View full analysis
dict: filepath = os.path.join(_OPERATIONS_DIR, filename) if not os.path.exists(filepath): return {"status": "error", "message": f"文件不存在: {filepath}", "filepath": filepath} mod_name = f"scripts.operations.{filename.replace('.py', '')}" try: mod = importlib.import_module(mod_name) func_name = _extract_func_name(func_code) if func_name and hasattr(mod, func_name): return {"status": "skipped", "message": f"函数 '{func_name}' 已存在于 {filename}", "filepath": filepath} except ImportError: pass try: with open(filepath, "a", encoding="utf-8") as f: f.write("\n\n") f.write(func_code) return {"status": "ok", "message": f"已追加到 {filename}", "filepath": filepath} except IOError as e: return {"status": "error", "message": f"写入失败: {e}", "filepath": filepath} ``` ```python def generate_operator_from_formula( formula: str, operator_name: str, description: str, parameters: list[dict], expression: str, target_file: str = "uncertainty.py", ) -> dict: param_str = ", ".join(f"{p['name']}: {p['type']}" for p in parameters) func_code = ( f"\n\n" f"def {operator_name}({param_str}) -> float:\n" f' """\n' f" {description}.\n" f"\n" f" 公式: {formula}\n" f"\n" f" Parameters\n" f" ----------\n" f"{param_doc}\n" f"\n" f" Returns\n" f" -------\n" f" float\n" f' """\n' f" {expression}\n" ) result = append_function_to_file(target_file, func_code) ``` ### Technical Analysis ...[truncated 1842 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/pipeline/engine.py:32
Finding

User-Controlled Pipeline Targets Can Invoke Unrestricted Internal Functions

Content
View full analysis
Callable: """Resolve the target string to an actual function.""" mod_path, func_name = self.target.rsplit(".", 1) mod = importlib.import_module(f"scripts.{mod_path}") return getattr(mod, func_name) ``` ```python func = step.resolve(context) params = step.resolve_params(context) import inspect sig = inspect.signature(func) filtered_params = {} for pname in sig.parameters: if pname in params: filtered_params[pname] = params[pname] result = func(**filtered_params) ``` ```python def _check_target_functions(context): """Check whether all target functions can be imported.""" pipe = context.get("_pipeline") if not pipe: return None errors = [] for step in pipe.steps: target = step.target try: mod_path, func_name = target.rsplit(".", 1) mod = importlib.import_module(f"scripts.{mod_path}") func = getattr(mod, func_name, None) if func is None: errors.append(f"Target function does not exist: {target}") except ImportError as e: errors.append(f"Target module import failed: {target} → {e}") ``` ### Technical Analysis Pipeline targets are loaded from strings and resolved with `importlib.import_module` and `getattr`. The pre-execution hook verifies only that the module and attribute exist. It does not verify that the function is an approved statistical operator, that it is registered for pipeline use, or that it is safe to expose. Any callable reachable under the `scr ...[truncated 1410 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/pipeline/registry.py:96
Finding

Template Names Permit Path Traversal During Read, Write, and Delete Operations

Content
View full analysis
Pipeline: user_path = os.path.join(_USER_DIR, f"{name}.json") if os.path.exists(user_path): with open(user_path, "r", encoding="utf-8") as f: data = json.load(f) return Pipeline.from_dict(data) default_path = os.path.join(_DEFAULT_DIR, f"{name}.json") if os.path.exists(default_path): with open(default_path, "r", encoding="utf-8") as f: data = json.load(f) return Pipeline.from_dict(data) report_path = os.path.join(_REPORT_DIR, f"{name}.json") if os.path.exists(report_path): with open(report_path, "r", encoding="utf-8") as f: data = json.load(f) return Pipeline.from_dict(data) ``` ```python def save_template(pipeline: Pipeline, overwrite=False) -> str: path = os.path.join(_USER_DIR, f"{pipeline.name}.json") if os.path.exists(path) and not overwrite: raise FileExistsError(...) with open(path, "w", encoding="utf-8") as f: json.dump(pipeline.to_dict(), f, ensure_ascii=False, indent=2) return path ``` ```python def delete_template(name: str) -> bool: path = os.path.join(_USER_DIR, f"{name}.json") if os.path.exists(path): os.remove(path) return True return False ``` ```python for base_dir in [_USER_DIR, _REPORT_DIR]: path = os.path.join(base_dir, f"{report_name}.json") if os.path.exists(path): with open(path, "r", encoding="utf-8") as f: data = json.load(f) ``` ### Technical Analysis Template and report names are concatenated into filesystem paths without rejecting absolute paths, path separators, or `..` components. The code does not normalize the final path an ...[truncated 1348 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/reporting/serve_config.py:283
Finding

Unauthenticated Configuration Service Is Exposed on All Network Interfaces

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/reporting/renderer.py:140
Finding

Generated HTML Reports Contain Stored HTML and Script Injection

Content
View full analysis
... {title} ...

{title}

{md_html} {chart_section} """ ``` ```python def _md_to_html(md_text): lines = md_text.strip().split("\n") html_parts = [] in_table = False for line in lines: if line.startswith("|") and line.endswith("|"): cells = [c.strip() for c in line.strip("|").split("|")] ... html_parts.append("" + "".join(f"{c}" for c in cells) + "") else: ... if line.startswith("### "): html_parts.append(f"

{line[4:]}

") elif line.startswith("## "): html_parts.append(f"

{line[3:]}

") elif line.strip(): html_parts.append(f"

{line}

") ``` ```python def data_table(data: dict, title: str = "Detailed data", fields: list = None, decimals: int = 4) -> str: rows_html = "" for f in fields: val = data.get(f) if val is None: continue rows_html += f"{f}{_fmt(val, decimals) if isinstance(val, float) else val}\n" return f"""

{title}

{rows_html}
MetricValue
""" ``` ```python rows = "" for a in alerts: rows += f"{a.get('组别', '')}{a.get('增长率', '')}⚠ {a.get('预警', '')}\n" ``` ```python ...[truncated 1773 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/reporting/renderer.py:113
Finding

Reports Execute Unpinned Third-Party JavaScript from a Remote CDN

Content
View full analysis
' chart_section = f"""
""" ``` ```python body_html = "\n".join(body_parts) js_include = '' if chart_js_needed else "" ``` ### Technical Analysis Generated reports load `chart.js` from jsDelivr without an exact version and without a Subresource Integrity hash. The effective JavaScript executed by the report can therefore change after the Skill has been audited. This is not a direct Python remote-code execution primitive, but it is remote code execution in the browser context of the generated report. It also contradicts the Skill's claims that it operates offline and performs no network access. Opening a report discloses network metadata such as the viewer's IP address, request timing, and user-agent information to the CDN. ### Attack Path 1. The Skill generates a report containing a chart section. 2. The report includes `https://cdn.jsdelivr.net/npm/chart.js`. 3. A user opens the report while connected to a network. 4. The browser contacts jsDelivr and retrieves the current package response. 5. The retrieved third-party JavaScript executes in the report's browser context. 6. A CDN, package, DNS, or network-path compromise can alter the executed dependency. ### Impact Assessment A c ...[truncated 346 chars]
Remediation
View remediation

other

Warning
Location
references/permissions.md:7
Finding

Declared Permission Profile Contradicts Actual File, Network, and Deletion Behavior

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (125)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
81% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Local JSON persistence, template CRUD, CLI management, and applying preconfigured standards constitute a stateful configuration-management system, not just a stateless analysis helper. In an agent environment, this can create persistent side effects, configuration drift, or accidental overwrite of user-maintained templates.

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

md
> 📚 **渐进式加载**:本技能采用渐进式 MD 体系,`SKILL.md` 为入口(≤230行),详细内容拆分到 `references/*.md` 按需加载。

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

append_function_to_file appends arbitrary generated function text directly into an existing Python module, which is a self-modifying behavior that can persist attacker-influenced code inside the project. Because the content is not sanitized or structurally validated, any compromise of the formula-to-code generation path can become durable arbitrary code execution on later import or invocation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

This function accepts externally derived inputs such as operator_name, parameters, expression, and target_file, then turns them into Python source code and writes that code into the skill's source tree before registering it for later use. In a quality-control/data-analysis toolkit, self-extending code generation is not required for normal operation and creates a strong code-injection and persistence primitive if an upstream LLM or user-controlled formula description is influenced by an attacker.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

_resolve_operator_gaps 的文档与注释多次表述“自动生成缺失算子”“逐个尝试生成”,会让调用方认为系统会补全缺失操作符。实际上函数只是检查 find_gaps、拼装 status='generated' 的详情并返回,既没有调用生成器,也没有写入算子注册表,文档意图与真实行为直接矛盾。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
77% confidence
Finding

The skill metadata explicitly declares low sensitivity and omits an explicit tool scope, yet the described capability surface includes local file read/write and possibly network-related behavior via external data directories, report generation, template management, and referenced server/config components. Without a strict permissions or allowed-tools declaration, an agent may invoke broader capabilities than users expect, increasing the risk of unintended file access or modification.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger list includes broad statistical and reporting terms that could activate the skill for many unrelated user requests. Overbroad routing is dangerous because this skill appears to include side-effecting capabilities such as file/template management; accidental invocation can therefore cause unintended reads, writes, or misleading outputs in contexts outside its intended domain.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The positive trigger examples are phrased as generic everyday analytics requests like making reports, regression, prediction, or grouped analysis, which can match many unrelated tasks. In the context of a skill with potential file, template, and server side effects, loose triggering increases the chance of misrouting and unintended privileged behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger list includes highly generic terms such as "预测", "PCA", and "ANOVA", which can cause the skill to activate outside its intended quality-control context. Overly broad activation increases the chance of unintended routing, user confusion, and inappropriate use of domain-specific guidance in unrelated requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill reference content is written in Chinese and provides no indication that another language is supported or that the user can opt into this locale. Under the policy, forcing a specific language without user choice or explicit justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file presents the interface specification entirely in Chinese and frames it as universal guidance, which can amount to a language/locale constraint for users or downstream skill behavior. There is no indication that other languages are supported or that Chinese is an optional, context-specific choice.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L005 明确写明“所有场景函数的入参统一为以下三种类型之一,没有例外”,将输入限制为 DataFrame、array-like 或 dict。 但后文函数签名和示例又大量使用标量参数,如 L179-L189 的 force_zero、degree、sigma、slope、standard,以及 L219-L224 的 spiked、blank,和 L331-L337 还明确接受“单值”,这与前述“没有例外”直接矛盾。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

该文件全文以中文给出技能标题、说明和示例,没有提供语言选择、用户偏好说明或区域限定 justification。按 SQP-3,这构成自然语言层面的语言/locale 强制约束风险,因为技能文档默认要求使用特定语言而未提供 opt-in。

Content

No source excerpt is available for this finding.