Back to skill

Security audit

amazon-research-reviews-skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is broadly a review-analysis tool, but it needs review because it can run unsafe local code paths, auto-install a package, and persist review data in generated files.

Review before installing. Use it only on non-sensitive or anonymized review datasets, run it in an isolated environment, avoid Excel mode unless dependencies are preinstalled, and inspect output directories because prompts and reports may contain raw review content. Do not pass attacker-controlled or unusual filenames until the Python path-interpolation issue is fixed.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (5)

T01 · Skill Instruction Hijacking

Error
Location
utils/analyzer_controller.sh:185
Finding

Untrusted Review Content Is Embedded Directly into Agent Prompts

Content
View full analysis
"$prompt_file" ``` The receiving prompt contains the following direct substitution point: ```text # Input Data {reviews_json} ``` ### Technical Analysis Review content is attacker-controlled or otherwise untrusted data. The controller serializes this content and substitutes it directly into an instruction prompt without a trust-boundary marker, escaping strategy, or an explicit instruction that text inside reviews must never be treated as agent instructions. JSON serialization protects the shell and JSON structure, but it does not protect the language-model instruction boundary. A review can contain text such as instructions to ignore the tagging task, reveal other context, produce falsified output, or invoke available tools. The Skill grants the hosting agent `Bash`, `Read`, `Write`, and `Edit` capabilities, so successful instruction confusion may have consequences beyond inaccurate classification if the host executes model-generated directions. The scripts shown prepare prompt files rather than invoking the model directly. Exploitation therefore depends on the documented main Skill workflow subsequently submitting those prompts to an agent. ### Attack Path 1. An attacker publishes or supplies a product review containing adversarial instructions. 2. The review is imported into the input CSV. 3. `csv_reader.sh` extracts the review ...[truncated 988 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
utils/tagging_core.sh:212
Finding

Arbitrary Python Execution Through Interpolated File Paths

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
utils/csv_processor.py:48
Finding

Unpinned Dependency Is Installed Automatically at Runtime

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
utils/html_generator.sh:41
Finding

Generated HTML Can Contain Unsanitized Script and Malicious Links

Content
View full analysis
Remediation
View remediation
`, SVG event handlers, image error handlers, encoded URL schemes, malformed tags, and quote-breaking link targets. ]]>

T08 · Insecure Dependencies

Note
Location
templates/report.html:7
Finding

Generated Reports Load Third-Party JavaScript Without Integrity Verification

Content
View full analysis
``` ### Technical Analysis Every generated report using this template loads executable JavaScript from a third-party CDN when opened with network access. Although the package version is specified, the response is not protected by a Subresource Integrity hash. The browser therefore trusts whatever bytes are returned by the CDN endpoint at viewing time. A CDN compromise, upstream artifact replacement, network-control failure, or configuration issue could change the code that executes after the Skill itself has been audited. The report also ceases to be fully self-contained and may fail when opened offline. ### Attack Path 1. The Skill generates an HTML report from `templates/report.html`. 2. A user opens the report in a browser with network access. 3. The browser requests Chart.js from `cdn.jsdelivr.net`. 4. If the CDN response has been maliciously altered, the browser receives attacker-controlled JavaScript. 5. Because no integrity hash is present, the browser executes the altered response in the report’s page context. ### Impact Assessment Compromised remote JavaScript can read and modify report content, falsify charts or conclusions, make network requests, and perform any action allowed to scripts in the document’s browser context. It does not directly grant operating-system privileges, and browser sandboxing limits local-file access, but it compromises the confidentiality and integrity of the viewed report. ]]>
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (47)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

该代码的核心功能非常明确:读取 CSV 样本、构造一段提示词,指导外部 AI 判断 rating/title/content 三类列的索引,并解析返回的 JSON。它属于数据预处理/字段识别工具,而不是完整的评论分析系统。虽然提示词中提到“电商评论数据”,与宣称场景有弱相关,但这只是为后续处理识别列结构,不构成所声明的深度分析能力。代码中也没有任何 AskUserQuestion、标签体系、画像、VOC、报告生成或看板相关实现,因此描述与实际行为存在明显且实质性的偏差。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

该代码块的核心作用是文件处理和数据管道辅助,而非声明中的“深度分析工具”。虽然代码中定义了22个标签列,并支持合并 batch*_tags.json 后导出带标签 CSV,但标签本身并不是在此代码中生成的;代码只是读取、分批、合并和统计现有数据。统计能力也仅限情感分布、评分分布、平均评分等基础汇总,不能等同于VOC洞察、用户画像、竞品分析或可视化看板。另一个明显差异是声明要求通过 AskUserQuestion 先收集分析数量,但此代码完全是命令行参数驱动,没有该交互约束。因此,描述显著夸大了实际能力,属于实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code chunk is a low-level support utility for reading CSV review data, not the described end-user analytical skill itself. Its behavior is limited to file handling and data extraction: encoding detection/conversion, delimiter detection, column name matching, counting records, and exporting review text/title/rating/id fields as JSON. Those are relevant support functions for a review-analysis pipeline, so they are not harmful or unrelated; however, the declared description promises substantial AI-driven analytical capabilities and workflow constraints that are not present in the supplied code. Because the actual code’s primary purpose is data ingestion/preprocessing rather than review analysis, the description does not accurately represent what this chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

声明描述的是一个较完整的电商评论深度分析工具,覆盖评论分析、用户画像、VOC、机会点、可视化看板和竞品研究。实际代码则明显只是后处理/报告生成辅助脚本:它对输入的已标注评论数据做基础统计、按 info_score 选样本、拼装 prompt、验证报告章节以及抽取嵌入式 JSON。它并不执行评论采集、AI 标签生成、22维分析、可视化看板生成或竞品分析。虽然其中的统计、画像汇总和洞察报告支持与声明部分相关,但从主要用途和能力范围看,代码仅覆盖声明中的一小部分,且缺少若干核心宣称能力,因此描述与代码行为存在实质不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The supplied code does not implement the declared end-user skill behavior. Its primary purpose is narrow and mechanical: merge an existing CSV with already-tagged JSON results and output an augmented CSV. While this may be a supporting utility for a larger review-analysis system, the code chunk itself does not analyze reviews, generate insights, create dashboards, or collect user input about analysis quantity. Therefore the declared description materially overstates and misrepresents what this specific code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

代码实际功能较窄,主要是评论“打标”基础设施:读取评论JSON、套用 prompt 模板、支持批处理、校验AI返回JSON、合并结果、导出CSV。虽然这与“评论分析”大方向相关,但与声明中的核心卖点相比明显不一致。声明强调的是完整的深度分析产品能力(22维标签、用户画像、VOC洞察、可视化看板、竞品/市场研究),而本代码仅提供底层 tagging 和结果落盘能力,缺少这些高层分析与展示功能。此外,声明中的执行约束“必须通过 AskUserQuestion 收集分析数量后再执行分析”在代码中没有任何体现。因此该描述对当前代码块的能力有明显夸大,构成描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

从该代码片段可见,其功能集中在测试与验收:验证目录和文件是否存在、脚本是否可执行、python3/jq 是否安装、prompt 模板是否含占位符、示例 CSV 是否存在。虽然这些检查与一个评论分析技能的开发配套有关,但它们只是支持性的测试/部署准备逻辑,不是声明中的核心业务能力。按照评估标准,当前片段的主要目的与声明的主要目的存在实质差异,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The description presents a full-featured AI review analytics skill, but this code chunk only serializes/deserializes review records between JSON and CSV using a fixed schema of review fields and 22 tag columns. The presence of tag field names aligns superficially with the declared domain, but the code does not generate those tags or analyze text; it merely reads existing data and reshapes it. It also lacks any trigger handling, external platform access, visualization, or mandatory user-question step. Therefore the actual behavior is materially narrower and different in primary purpose from the declared description.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill metadata says analysis must only proceed after collecting the analysis quantity via AskUserQuestion, but the controller silently falls back to a default of 100. This bypasses an expected user-consent/control step and can trigger unintended processing of user-supplied data, which is especially risky in an agent workflow where tool behavior must match declared constraints.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Installing Python packages during file processing is not justified by the stated skill purpose and creates an unsafe side effect unrelated to parsing reviews. It introduces supply-chain exposure, network dependency, and privilege-bound changes to the runtime environment merely by opening an Excel file.

Content

No source excerpt is available for this finding.

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
99% confidence
Finding

The code invokes a shell command to install a package at runtime with os.system("pip install openpyxl -q"). This causes unexpected system modification and executes an external command in the host environment, which is unnecessary for normal review-processing logic and expands supply-chain and command-execution risk if the environment, pip configuration, or package sources are compromised.

Content

Scanner excerpt · utils/csv_processor.py (reported line 52)May include surrounding context.

python
import openpyxl
        except ImportError:
            print("📦 正在安装 openpyxl...")
            os.system("pip install openpyxl -q")
            import openpyxl

        print(f"🔄 检测到 Excel 文件,正在转换为 CSV...")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Nearly all user-facing instructions and invocation examples are presented only in Chinese, and the file does not indicate that the skill is China-specific or offer an opt-in language/locale choice. Under the policy, forcing a specific language without user choice can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The invocation examples and trigger phrases are broad enough to match ordinary user requests such as '评论分析' or '竞品分析', which can cause the skill to activate outside the user's specific intent. In an agent environment, over-broad activation increases the chance of unintended file access, analysis, and downstream actions without sufficiently explicit consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README states that the skill reads review CSVs and writes multiple reports into an output directory, but it does not warn about local file creation, overwriting risks, or the possibility that review data may contain sensitive or personal information. This omission can lead users to run the skill on sensitive datasets without understanding persistence, exposure, or retention implications.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Forcing Chinese output without user choice can override the user's language preference and degrade transparency, usability, and accuracy for non-Chinese users. In agent settings, rigid language constraints may also interfere with proper review, safety messaging, or downstream integrations expecting a different locale.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The prompt expands a review-analysis skill into business strategy generation by requiring moat/vulnerability analysis, execution directives, and ROI recommendations. This exceeds the stated scope of comment analysis and can cause the agent to produce prescriptive business decisions that are unsupported, overconfident, or inconsistent with user intent, increasing the risk of unsafe downstream automation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The prompt is written entirely in Chinese and instructs the model to return output in a fixed Chinese schema, with no opt-in or alternative locale path. 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.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The instruction explicitly sets the assistant role and output behavior in Chinese ('你是一个专业电商评论分析AI'), which imposes a specific language/locale by default. The file does not offer user opt-in, alternative language handling, or a documented region-specific justification, so it matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger keywords include broad, common business phrases such as 评论分析, 竞品分析, 用户洞察, 产品优化, and 市场调研, which can cause the skill to activate in contexts where the user did not intend to invoke file-reading and report-generation behavior. This increases the risk of unintended execution paths, especially because the skill is allowed to use Bash, Read, Write, and Edit and can create output artifacts automatically.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill describes generating outputs under output/{产品名}_{日期}/ but does not prominently warn users up front that it will read local review files and write multiple new artifacts, including CSV, Markdown, and HTML files. This can lead to user surprise and unauthorized or unintended data handling, particularly when processing potentially sensitive review datasets or when operating in environments where filesystem side effects must be explicitly disclosed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The HTML root element sets lang="zh-CN", and the report content throughout the template is written in Chinese, which imposes a specific language/locale by default. Under the policy, locale restrictions should either be optional for the user or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Ssd 1

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Untrusted CSV headers and sample rows are inserted verbatim into an LLM prompt, so an attacker can place prompt-injection text inside the CSV data to manipulate the model's column-selection output or reasoning. In this skill, the model's answer influences downstream processing of review data, so poisoned inputs can cause misclassification, incorrect extraction, privacy leakage, or operational disruption.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest presents this skill as an AI-powered e-commerce review analysis tool with 22-dimension tagging, user profiling, VOC insights, and dashboard generation. In contrast, this code only reads a local CSV sample, builds a prompt asking an external AI/human to identify rating/title/content column indexes, and returns that prompt; it does not perform the claimed review analysis functions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The tool prints CSV-derived sample rows and a full prompt intended for external AI analysis, which may expose review text, user identifiers, or other sensitive business data to logs, terminals, or downstream operators. In this skill context, e-commerce review datasets can contain personal data or confidential market information, so disclosure risk is real even if only a sample is shown.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest explicitly states the agent must use AskUserQuestion to collect the analysis quantity before running. This command-line entrypoint proceeds directly from provided arguments to reading files, generating prompts, saving outputs, and parsing AI responses without any such interaction or quantity collection step.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.