Back to skill

Security audit

AI广告投手 Ad Trader

Security checks for vulnerabilities and agentic risk

Overview

The skill largely matches its advertising-analysis purpose, but its generated HTML reports can run unsafe content from imported datasets and load remote chart code when opened.

Install only if you are comfortable using a Chinese-language local ad-analysis tool and treat generated HTML reports as sensitive business documents. Use trusted datasets, review or sanitize campaign and creative names before generating reports, avoid opening reports made from untrusted files, and be aware that reports load Chart.js from jsDelivr unless the code is changed to bundle or integrity-pin the dependency.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/report.py:378
Finding

Stored HTML and Script Injection Through Imported Campaign and Creative Names

Content
View full analysis
{tier_name.replace('_', ' ')} {plan.get('name', '')} ¥{plan.get('budget', 0):,.0f} {plan.get('roas', 0)} ¥{plan.get('cpa', 0):.1f} {tier_data.get('rule', '')} """) ``` ```python # scripts/report.py:398-409 rows.append(f""" {rank_icon} {c.get('name', '')} ¥{c.get('cost', 0):,.0f} {c.get('ctr', 0)}% {c.get('cvr', 0)}% ¥{c.get('cpa', 0):.1f} {roas} {c.get('score', 0)}分 """) ``` ```python # scripts/report.py:423-434 rows.append(f""" {c.get('name', '')} {c.get('impressions', 0):,} {c.get('ctr', 0)}% {c.get('cvr', 0)}% ¥{c.get('cpa', 0):.1f} {c.get('roas', 0)} {c.get('active_days', 0)}天 {level} """) ``` ### Technical Analysis Campaign and creative names originate in user-supplied CSV, JSON, or ...[truncated 2311 chars]
Remediation
View remediation
{html_text(plan.get("name", ""))} ``` 2. Prefer a mature template engine such as Jinja2 with automatic escaping enabled rather than constructing the full report through Python f-strings. 3. Treat HTML text, HTML attributes, URLs, CSS, and JavaScript as separate output contexts. Do not reuse a generic sanitizer across these contexts. 4. Continue using JSON serialization for chart data, but also ensure that serialized content cannot terminate the enclosing script element. A safer design is to place serialized data in an `application/json` element and parse its text content. 5. Add a restrictive Content Security Policy that blocks inline and unexpected remote scripts. CSP should be defense in depth rather than a replacement for output encoding. 6. Add regression tests using payloads containing: - `` sequences - Encoded and mixed-case variants 7. Escape generated recommendation messages as well, because `scripts/optimizer.py` includes creative names in recommendation strings that are later inserted into report markup. ]]>

T03 · Remote Payload Retrieval and Execution

Warning
Location
scripts/report.py:77
Finding

Generated Reports Execute an Integrity-Unprotected Remote JavaScript Dependency

Content
View full analysis
``` ### Technical Analysis Every generated HTML report instructs the viewer's browser to download and execute Chart.js from jsDelivr. Although the dependency version is pinned to `4.4.0`, the script element does not specify a Subresource Integrity hash. Consequently, the executable content used by the report is not completely represented by the audited project. Its effective behavior depends on the response returned by an external package CDN when the report is opened. A compromised CDN response, package-distribution incident, or equivalent supply-chain failure could substitute malicious JavaScript. The external request also means that opening an otherwise local report causes undeclared network communication with a third party. ### Attack Path 1. The Skill generates an HTML report containing the remote script element. 2. The victim opens the report while network access is available. 3. The browser requests Chart.js from jsDelivr. 4. An attacker compromises or influences the externally served response through a CDN or package supply-chain incident. 5. Because no integrity hash is present, the browser accepts the modified response. 6. The substituted JavaScript executes with the same document-level privileges as the legitimate charting library. ### Impact Assessment A successfully substituted dependency can execute arbitrary JavaScript in every affected report opened while the malicious response is served. It could: - Read and alter the report's advertising data and analysis results. - Falsify visualizations, warnings, and recommendations. - Send report information to remote systems. - Make additional network requests. - Display ...[truncated 354 chars]
Remediation
View remediation
``` The integrity value must be generated from and verified against the exact distributed artifact. 3. Document that opening a report performs an outbound request to jsDelivr and provide an offline report option. 4. Add a restrictive Content Security Policy that permits scripts only from explicitly approved sources and disallows unexpected script execution. 5. Pin and periodically review the exact third-party artifact, including its provenance, checksum, license, and known vulnerabilities. 6. Consider generating static charts or embedding a locally verified script when portability is required. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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 (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

声明描述的是一个覆盖端到端广告投放分析与优化的综合助手,包含多平台数据统一分析、HTML交互式报告和异常告警等较完整能力。而实际代码仅是 optimizer.py 单个模块,功能集中在预算分配、出价优化、素材疲劳检测和A/B测试,且通过命令行读取文件后输出JSON结果。它确实与广告优化场景相关,且部分符合“预算优化/素材诊断/投放分析”的子能力,但没有看到报表生成、HTML可视化、异常告警、多平台适配逻辑,也不足以支撑“全流程助手”这一更宽泛声明。故属于描述明显大于实际代码能力的能力不匹配。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The markdown explains that users can import CSV/Excel/JSON advertising datasets and later generate reports, but it does not warn that such files may contain sensitive campaign, revenue, or performance data. For markdown files, missing disclosures about behaviors affecting user data or privacy should be flagged when the skill description omits them.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

Because this is a markdown file, vague trigger analysis applies. Several listed triggers are generic task phrases that could overlap with normal conversation about advertising work, and the README does not specify activation boundaries, exclusions, or context constraints.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises file-based workflows such as importing data files and generating reports, but it does not declare any explicit tool scope or permissions. In agent environments, missing scope declarations can cause overly broad default access or make review and enforcement of file read/write behavior impossible, increasing the risk of unintended local file access or file overwrite.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Overly broad trigger phrases can cause the skill to activate in routine advertising conversations where the user did not intend file analysis or report-generation behavior. In a skill that appears to involve file read/write operations, ambiguous activation expands the chance of unintended data handling, confusing tool invocation, or accidental exposure/modification of user content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains natural-language strings that present the tool exclusively in Chinese, including the module docstring and command help text. The policy requires avoiding forced language or locale constraints unless the skill offers a user choice or clearly documents a justified region-specific limitation, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring presents the skill’s purpose entirely in Chinese, and the CLI usage and output strings elsewhere in the file also assume Chinese-language operation. Under the language/locale policy, forcing a specific language without user opt-in or 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
95% confidence
Finding

The CLI help, error text, and printed result labels are all user-facing strings in Chinese only. Because the file does not provide any language selection or explain a required Chinese-only context, this violates the language/locale policy for natural-language content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module title and descriptive text are written entirely in Chinese, and the CLI usage/help and runtime messages are also only provided in Chinese. This creates a language/locale constraint for users without any opt-in or alternative locale, which matches the policy category for forced language behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The command-line usage string and error output are emitted only in Chinese, with no mechanism for user language selection. For a general-purpose skill, this is a natural-language policy issue because it forces one locale without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Natural-language strings throughout the file, including the module description, CLI usage, and generated HTML, are fixed in Chinese, and the HTML lang attribute is explicitly set to zh-CN. There is no option for user language selection or documentation justifying a mandatory Chinese-only locale, which matches the language/locale policy concern in SQP-3.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code includes a chart labeled '转化量趋势' and a comment indicating conversion trend handling, but conv_values is never populated and the chart uses cost_values with an inline // placeholder comment. This is an active contradiction between the chart/comment intent and the actual rendered data, which can mislead users about what the report shows.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
70% confidence
Finding

Natural-language policy violations include forcing a specific language without user opt-in. This README presents all instructions and trigger guidance only in Chinese, with no indication that users may choose another language or that the locale restriction is intentional and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file presents all instructional content in a single language and does not indicate that Chinese is an intentional locale-specific requirement or that users may opt into another language. Under the policy criteria, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This markdown file contains user-facing natural-language content exclusively in Chinese, which can amount to a language/locale constraint without explicit opt-in. The policy allows fixed locale only when clearly documented and justified, but this file does not state that it is intended only for Chinese-speaking users or a China-specific audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. This markdown file presents all instructions in Chinese only and does not indicate that the skill is region-specific or that users may opt into another language, which can violate a policy requiring language choice or justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The generated HTML loads Chart.js from a third-party CDN at runtime, which introduces an external supply-chain and privacy exposure. Opening the report can leak access metadata to the CDN and makes report integrity depend on a remote resource that could be unavailable or tampered with.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This code performs a file write operation by creating an HTML report at the provided or generated path. Although the script prints a success message after completion, there is no prior disclosure in the function flow warning that it will create or overwrite a local file, and the operation is safety-relevant for SQP-2 because it modifies the filesystem.

Content

No source excerpt is available for this finding.