Back to skill

Security audit

数据仓库运维技能

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent data-warehouse helper, but several scripts generate files, executable SQL/Python, and HTML from untrusted input without enough path containment or escaping.

Review this skill before installing. Use it only with trusted inputs or in a sandbox, check generated SQL/Python before deploying, avoid hosting generated HTML reports with untrusted data, and verify output paths so generated files cannot overwrite unintended locations.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cost_optimizer.py:396
Finding

Stored cross-site scripting in generated cost reports

Content
View full analysis
", ">") html += f""" {i} {text}... {q['bytes_formatted']} {q.get('duration_sec', 'N/A')}s {q['user']} """ ``` ### Technical Analysis The `user` or `user_email` field originates in the supplied query-log JSON and is interpolated directly into the generated HTML. No HTML escaping is applied to this value. The query text receives limited replacement of angle brackets, but this is not a general contextual-escaping mechanism. Other input-controlled fields, including `user` and potentially `duration`, are rendered without validation. An attacker can supply a value containing an HTML element with an event handler, such as an image whose `onerror` handler executes JavaScript. The resulting payload is stored in the generated report and runs when the report is opened. ### Attack Path 1. An attacker supplies or modifies a query-log JSON file. 2. A query record contains a malicious `user` or `user_email` value. 3. The operator runs `cost_optimizer.py ...[truncated 692 chars]
Remediation
View remediation
`. - Add a restrictive Content Security Policy that disallows inline scripts and limits script sources. - Add regression tests containing event handlers, quotes, malformed tags, and `` sequences. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/lineage_parser.py:350
Finding

Script-context injection in generated lineage visualizations

Content
View full analysis
const nodesData = {nodes_json}; const edgesData = {edges_json}; const topTables = {top_tables_json}; ``` ### Technical Analysis Table identifiers parsed from attacker-controlled SQL files are included in `nodes`, `edges`, and `top_tables`. These structures are serialized with `json.dumps()` and then embedded directly into an executable inline `` sequence terminates the script element even if it occurs inside a JavaScript string. A crafted SQL identifier can therefore break out of the inline data block and inject HTML or JavaScript. The generated page also assigns table names using `innerHTML`, creating a second unsafe rendering point. ### Attack Path 1. An attacker provides a crafted SQL file containing a malicious table identifier. 2. `SQLLineageParser` extracts that identifier as a source or target table. 3. The identifier is included in the node or table data. 4. `json.dumps()` serializes it without HTML script-context escaping. 5. The serialized value is inserted directly into the report's `
Remediation
View remediation
` element and read it through `textContent`. - Alternatively, encode `<`, `>`, `&`, U+2028, and U+2029 using safe Unicode escapes before embedding JSON. - Validate parsed table identifiers against the supported SQL dialect's identifier grammar. - Replace `innerHTML` assignments with DOM construction and `textContent`. - Add a CSP that prohibits unapproved inline execution. - Test with table identifiers containing closing script tags, quotes, backslashes, and HTML event handlers. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/sla_monitor.py:354
Finding

Stored cross-site scripting in generated SLA dashboards

Content
View full analysis
{ const tr = document.createElement('tr'); tr.innerHTML = ` ${p.name} ${tierLabel} ${p.success_rate}% ${p.failure_rate}% ${p.total_runs} ${p.sla_status === 'COMPLIANT' ? '✅ COMPLIANT' : '❌ VIOLATED'} ${alertCell} `; tb.appendChild(tr); }); ``` ### Technical Analysis The pipeline name is controlled by the input CSV. It is first embedded as JSON inside an executable inline script without script-context escaping. It is then inserted into the document with `innerHTML`. This creates two exploitation opportunities: 1. A closing script-tag sequence can escape from the inline JavaScript block. 2. HTML containing event handlers can execute when assigned through `innerHTML`. The val ...[truncated 882 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/etl_pipeline_builder.py:493
Finding

Arbitrary file write and generated code injection in the ETL pipeline builder

Content
View full analysis
Target: {args.target_platform} Mode: {args.mode} """ ... df["etl_pipeline_name"] = "{args.pipeline_name}" ... with DAG( dag_id="{dag_id}", ``` ```python output_file = os.path.join(args.output, f"{args.pipeline_name}.{ext}") with open(output_file, "w", encoding="utf-8") as f: f.write(content) ``` ```python meta_file = os.path.join(args.output, f"{args.pipeline_name}_metadata.json") with open(meta_file, "w", encoding="utf-8") as f: json.dump(meta, f, indent=2, ensure_ascii=False) ``` ### Technical Analysis `pipeline_name` is used as both a filename and a literal inside generated executable Python. It is not restricted to a basename, checked for traversal components, or escaped as a Python string. If `pipeline_name` is absolute, `os.path.join()` discards the configured output directory. Relative traversal components can likewise escape the intended output location. The same value can break out of generated string literals or the module docstring and inject Python statements that execute when Airflow imports the generated DAG. Source and target table names are also interpolated directly into generated SQL and dbt templates without dialect-aware identifier validation. ### Attack Path 1. An attacker influences the arguments passed to the ETL builder. 2. The attacker supplies a `pipeline_name` containing an absolute path or traversal sequence ...[truncated 891 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/data_quality_checker.py:549
Finding

Arbitrary file write and SQL or YAML injection in the data-quality generator

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/dim_model_generator.py:510
Finding

Arbitrary file write and unsafe DDL generation in the dimensional-model generator

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/lineage_parser.py:291
Finding

Externally hosted report dependencies lack integrity enforcement

Content
View full analysis
``` ```html ``` ### Technical Analysis Generated reports and bundled HTML assets load executable JavaScript from a third-party CDN when opened. Package versions are pinned, which reduces uncontrolled version drift, but no Subresource Integrity hash is supplied. Consequently, the browser has no project-controlled cryptographic verification of the downloaded content. This is a supply-chain exposure rather than evidence that the current dependencies are malicious. Exploitation requires compromise, substitution, or malicious delivery through the external dependency path. ### Attack Path 1. A report is opened while network access is available. 2. The browser requests Chart.js or vis-network from the third-party CDN. 3. The external resource is maliciously substituted or compromised. 4. Because no integrity attribute is present, the browser accepts the modified script. 5. The script executes in the report's browser context. ### Impact Assessment A compromised dependency can execute JavaScript in every report that loads it. The browser-side impact includes report manipulation, data access available to the report origin, and same-origin actions. This does not directly grant server-side or operating-system privileges. ]]>
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • 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
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

声明描述的是一个覆盖数据仓库运维全生命周期的综合技能,而代码只实现了其中较窄的一部分:基于查询日志的成本/性能优化分析与报告生成。它没有执行ETL/ELT、建模、质量校验、治理、血缘、SLA等核心模块,也没有看到对所宣称开源工具链的实际支持。虽然“成本/性能调优”和部分“分区策略”建议与声明有交集,但代码的主功能明显比声明窄,属于描述显著夸大能力范围的情况。

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

md
- 使用 `scripts/lineage_parser.py` 解析 SQL 提取列级血缘

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 182)May include surrounding context.

md
- 使用 `scripts/lineage_parser.py` 解析 SQL 提取列级血缘

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill instructs the agent to read reference files and generate outputs/reports, implying file read/write behavior, but it declares no explicit tool scope or permissions boundary. This can lead to over-privileged execution in hosts that infer or grant broader filesystem access than the skill actually needs, 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
83% confidence
Finding

The workflow says to execute whenever a user raises a data-warehouse-related need, but it lacks explicit non-invocation boundaries and safety checks. In agent environments, ambiguous routing rules can cause unnecessary activation and downstream actions on files or generated outputs without sufficient user intent verification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The output convention says reports should "优先使用中文标签(中国用户默认)", which imposes a language/locale preference in the skill behavior. There is no accompanying opt-in, user choice, or clear region-specific compliance justification, so this is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger list includes many broad, common terms, which can cause the skill to activate in conversations that are only loosely related to data warehousing. Over-triggering is dangerous because it increases the chance that the agent will load files, generate artifacts, or take domain-specific actions in the wrong context, potentially exposing data or producing unauthorized changes.

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 declares lang="zh-CN", which hard-codes a specific language/locale for the skill output. The file does not indicate that this locale is optional, user-selected, or required for a region-specific purpose, so it conflicts with the policy against forcing a language without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document declares zh-CN and all visible UI labels, placeholders, and headings are presented in Simplified Chinese. This creates a natural-language locale policy concern because the skill does not offer any user-selectable language option or indicate that Chinese is an opt-in or region-specific requirement.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · assets/sla_dashboard.html (reported line 71)May include surrounding context.

html
function render() {
  document.getElementById('meta').textContent = '分析周期: ' + SLA_DATA.analysis_period_days + ' 天 | 生成时间: ' + new Date(SLA_DATA.generated_at).toLocaleString();
  const g = SLA_DATA.global;
  const pList = Object.entries(SLA_DATA.pipelines);
  
  document.getElementById('summaryCards').innerHTML = `
    <div class="card"><div class="lbl">管道总数</div><div class="val">${g.total_pipelines}</div></div>

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · assets/sla_dashboard.html (reported line 85)May include surrounding context.

html
function render() {
  document.getElementById('meta').textContent = '分析周期: ' + SLA_DATA.analysis_period_days + ' 天 | 生成时间: ' + new Date(SLA_DATA.generated_at).toLocaleString();
  const g = SLA_DATA.global;
  const pList = Object.entries(SLA_DATA.pipelines);
  
  document.getElementById('summaryCards').innerHTML = `
    <div class="card"><div class="lbl">管道总数</div><div class="val">${g.total_pipelines}</div></div>

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · assets/sla_dashboard.html (reported line 86)May include surrounding context.

html
function render() {
  document.getElementById('meta').textContent = '分析周期: ' + SLA_DATA.analysis_period_days + ' 天 | 生成时间: ' + new Date(SLA_DATA.generated_at).toLocaleString();
  const g = SLA_DATA.global;
  const pList = Object.entries(SLA_DATA.pipelines);
  
  document.getElementById('summaryCards').innerHTML = `
    <div class="card"><div class="lbl">管道总数</div><div class="val">${g.total_pipelines}</div></div>

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · assets/sla_dashboard.html (reported line 92)May include surrounding context.

html
function render() {
  document.getElementById('meta').textContent = '分析周期: ' + SLA_DATA.analysis_period_days + ' 天 | 生成时间: ' + new Date(SLA_DATA.generated_at).toLocaleString();
  const g = SLA_DATA.global;
  const pList = Object.entries(SLA_DATA.pipelines);
  
  document.getElementById('summaryCards').innerHTML = `
    <div class="card"><div class="lbl">管道总数</div><div class="val">${g.total_pipelines}</div></div>

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · assets/sla_dashboard.html (reported line 102)May include surrounding context.

html
function render() {
  document.getElementById('meta').textContent = '分析周期: ' + SLA_DATA.analysis_period_days + ' 天 | 生成时间: ' + new Date(SLA_DATA.generated_at).toLocaleString();
  const g = SLA_DATA.global;
  const pList = Object.entries(SLA_DATA.pipelines);
  
  document.getElementById('summaryCards').innerHTML = `
    <div class="card"><div class="lbl">管道总数</div><div class="val">${g.total_pipelines}</div></div>

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The title and the entire document content are presented in Chinese, with only a partial English gloss in the title, and there is no indication that users may choose another language. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The document title and section text are primarily written in Chinese, with only limited English glosses, which imposes a language choice on users. The file does not offer an alternative language selection or explain that the skill is intended only for a Chinese-speaking audience or region-specific context.

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 report is explicitly fixed to Chinese locale and language via lang="zh-CN" and Chinese-only user-facing text. The policy for natural-language violations applies to all file types and says locale constraints should not be forced unless the skill offers a choice or clearly documents a justified region-specific constraint, which this file does not do.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language descriptions and CLI/help text in Chinese, starting with the module docstring and continuing throughout the interface. Because the policy requires avoiding forced language/locale without user opt-in, the lack of any language selection or justification is a natural-language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The module docstring presents the skill description entirely in Chinese, and the command-line help strings throughout the file are also Chinese-facing. This can violate a language/locale policy when the skill imposes a specific language experience without explicit user opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code includes natural-language interface text in Chinese in the module docstring and later CLI/help output, but provides no opt-in or alternate locale selection. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The generated HTML unconditionally loads JavaScript from third-party CDNs (jsDelivr) for vis-network and Chart.js, even though the tool’s core function is local SQL lineage parsing. If the CDN, dependency, or transport path is compromised, opening the generated local HTML executes attacker-controlled script in the user’s browser, creating a supply-chain risk and potentially exposing local data rendered in the page.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

模块级说明宣称该分区策略推荐器支持 Databricks,但实际 Databricks DDL 生成逻辑只处理 YEAR/MONTH/DAY,忽略了前面推荐逻辑可能产出的 HOUR 粒度。对带有 real_time 查询模式的 Databricks 输入,代码会推荐 HOUR,却无法输出对应 DDL,形成文档/意图与实现的不一致。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The module docstring and all user-facing descriptions are written exclusively in Chinese, and the generated report/output strings are also Chinese-only. For an all-file-types language policy check, this is a locale/language constraint presented without any explicit user opt-in or choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains pervasive user-facing strings in Chinese, including the module description and the generated dashboard HTML with lang="zh-CN". The policy allows locale constraints only when user opt-in is offered or the constraint is clearly documented and justified, neither of which appears here.

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 declares lang="zh-CN", and the visible UI text is predominantly Chinese, which indicates a fixed language/locale choice. Under the policy rules, forcing a specific language without user opt-in can be a natural-language policy violation when no alternative or justification is provided in the file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.