Back to skill

Security audit

Amazon 标题优化建议

Security checks for vulnerabilities and agentic risk

Overview

This title-optimizer skill exposes broad ARI account operations, paid analysis, and persistent monitoring features that go beyond its title-only description.

Review this carefully before installing. It is not just a title optimizer: it needs an ARI API key and can access ARI account data, consume credits, export reports or reviews, and change ongoing monitoring or confirmation settings. Use it only if you want the broader ARI operations assistant behavior, keep auto-confirm limits conservative, avoid custom ARI_BASE_URL values unless you control an HTTPS endpoint, and verify costs before enabling recurring monitoring or paid analyses.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/ari.py:594
Finding
Mandatory Retrieval of Account-Wide Metadata and Unrelated Alerts Exceeds the Skill's Minimum Required Scope## Vulnerability Details **File Location**: `SKILL.md:21-22`, `SKILL.md:96-99`, `scripts/ari.py:594-611`, and `scripts/ari.py:1499-1505` **Vulnerability Type**: Excessive authenticated data access and violation of least privilege **Risk Level**: Medium ### Code Snippet ```python def cmd_check(args): release = fetch_release() me = request_json("GET", "/api/v1/user/me") if not ok(me): emit(me, args.compact) return balance = request_json("GET", "/api/v1/credits/balance") if not ok(balance): emit(balance, args.compact) return auto = request_json("GET", "/api/v1/user/autoconfirm") emit({"success": True, "data": { "skillVersion": VERSION, "release": release, "user": data_of(me), "balance": data_of(balance), "autoConfirm": data_of(auto) if ok(auto) else None, }, "links": links()}, args.compact) ``` ```python def cmd_alerts(args): if args.mark_read: emit(request_json("POST", "/api/v1/alerts/read"), args.compact) return emit(request_json("GET", "/api/v1/alerts", params={"limit": args.limit}), args.compact) ``` The Skill instructions require `check` at the start of every session and direct the Agent to retrieve alerts after that check. These actions occur even though the declared specialized purpose is to provide Amazon title-optimization recommendations from product details and review evidence. ### Technical Analysis All calls are authenticated using the user's ARI Bearer API key. The `check` command retrieves the user profile, credit balance, and account-level automatic-confirmation policy. The additional `alerts` command retrieves account-wide review alerts that may concern products unrelated to the title-optimization request. Authentication is not bypassed, and the code does not gain operating-system privileges. The security concern is that the Skill directs the Agen ...[truncated 2023 chars]
Remediation
## Remediation Suggestions 1. Remove the instruction to retrieve alerts automatically at the beginning of every session. 2. Invoke `alerts` only when the user explicitly requests alerts or when alerts are directly relevant to the requested workflow. 3. Replace the broad `check` response with a minimal endpoint or response projection that returns only: - Whether authentication is valid - Whether the requested operation is available - The usable balance needed for an imminent paid operation 4. Do not retrieve or return the complete user profile for ordinary title-analysis requests. 5. Query the automatic-confirmation policy only when the Agent is about to perform an operation that could consume credits. 6. Scope product and alert queries to the user-requested ASIN whenever the API supports such filtering. 7. Document each category of account data retrieved and explain when it is necessary. 8. Add tests confirming that a read-only title request does not enumerate unrelated account alerts or retrieve unnecessary profile fields.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ari.py:55
Finding
Custom API Base URLs Can Receive the Reusable Bearer Credential over Plaintext HTTP## Vulnerability Details **File Location**: `scripts/ari.py:55-71`, `scripts/ari.py:302-320`, and `scripts/ari.py:337-350` **Vulnerability Type**: Insufficient transport-security validation for sensitive credentials **Risk Level**: Medium ### Code Snippet ```python def base_url(): override = (os.environ.get("ARI_BASE_URL") or "").strip().rstrip("/") if not override or override == PROD_BASE: return PROD_BASE if (os.environ.get("ARI_ALLOW_CUSTOM_BASE") or "").strip() != "1": emit(error_obj( "ARI_CUSTOM_BASE_BLOCKED", 0, "ARI_BASE_URL points to a non-official address; the request was blocked", "Set ARI_ALLOW_CUSTOM_BASE=1 only for an environment you control.")) raise SystemExit(2) return override ``` The relevant authenticated request logic is: ```python def request_json(method, path, payload=None, params=None): url = base_url() + path data = None if payload is None else json.dumps(payload).encode("utf-8") headers = { "Authorization": "Bearer " + require_key(), "Accept": "application/json", "User-Agent": user_agent(), } if data is not None: headers["Content-Type"] = "application/json" try: req = urllib.request.Request(url, data=data, headers=headers, method=method) with urllib.request.urlopen(req, timeout=TIMEOUT_SEC) as resp: raw = resp.read().decode("utf-8") out = json.loads(raw) if raw else {"success": True, "data": None} return out ``` The streaming request path has the same behavior: ```python def request_sse(path, payload, recovery_hint=None): url = base_url() + path headers = { "Authorization": "Bearer " + require_key(), "Accept": "text/event-stream", "Content-Type": "application/json", "User-Agent": user_agent(), } req = urllib.req ...[truncated 3250 chars]
Remediation
## Remediation Suggestions 1. Parse custom base URLs with `urllib.parse.urlparse` and require the `https` scheme before attaching an Authorization header. 2. If plaintext HTTP is required for local development, permit it only when: - The host is a loopback address such as `127.0.0.1`, `::1`, or `localhost` - A separate development-only flag is set - The restriction is clearly documented 3. Reject URLs containing user-info components, malformed hosts, unsupported schemes, fragments, or ambiguous authority syntax. 4. Consider maintaining an explicit allowlist of trusted custom hosts or requiring a pinned development certificate. 5. Separate endpoint selection from credential transmission. Public requests may use an approved custom endpoint, but authenticated requests should independently verify that the destination is trusted and encrypted. 6. Disable automatic HTTP redirects for authenticated requests or remove the Authorization header whenever a redirect changes the origin. 7. Add regression tests for: - Rejection of `http://external-host` - Rejection of non-HTTP schemes - Authorization-header removal on cross-origin redirects - Explicit loopback-only development behavior 8. Provide a key-revocation procedure in the documentation for users who may have sent a key to an untrusted endpoint.
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 (37)

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill documentation directs use of shell, network, environment-variable, and local file-write capabilities (for CLI execution and API key storage) without any declared permission boundary in the manifest. This creates an under-declared trust surface: a user or platform may believe the skill is narrowly scoped while it can invoke broader local/system capabilities, increasing the risk of unintended command execution, credential handling, or persistence.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared purpose says the skill is only for title diagnosis/suggestions, but the body authorizes a much broader set of account, billing, monitoring, collection, reporting, and operational actions. That mismatch is dangerous because users may invoke what they think is a limited advisory tool while the agent can perform paid actions, change settings, manage subscriptions, and access/export broader account data.

Description-Behavior Mismatch

High
Confidence
96% confidence
Finding
The documented workflow spans far beyond title optimization into VOC generation, reporting, watch management, alerts, competitor analysis, exports, and operations workflows. This scope drift materially increases the attack and abuse surface because a narrowly named skill can trigger broad account-affecting and potentially chargeable actions users would not reasonably expect.

Context-Inappropriate Capability

High
Confidence
94% confidence
Finding
Advertising and keyword-planning functionality is explicitly included even though the skill claims not to be used for ad operations or full listing work. This mismatch can lead to unauthorized business recommendations and paid analytical actions outside the user's expected scope, especially in a skill marketed as title-only optimization.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
The operations-review workflows broaden the tool from title diagnosis into general product operations and health checks. In context, this is dangerous because it normalizes execution of broader workflows under a narrow label, which can cause unintended actions, fees, or access to unrelated product/account data.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
The file closes by claiming a fixed title-focused entry point, but earlier sections authorize many unrelated analyses and management operations. Contradictory documentation like this reduces informed consent and makes it easier for an agent to justify broader actions than the user expects, especially when paid or state-changing commands are available.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The skill metadata says it is only for Amazon title diagnosis and optimization suggestions, but this code exposes broad product-operations workflows that can run paid, stateful analyses beyond that scope. Scope expansion is dangerous because users and calling agents may grant trust and credentials under narrow expectations, while the implementation can perform materially different actions and incur charges.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The file includes monitoring, competitor management, alerts, leaderboard queries, exports, workbench actions, and other account-affecting features unrelated to the declared title-optimizer purpose. In an agent context this is risky because hidden surplus capabilities increase the chance of unintended paid actions, state changes, and data access outside what the user reasonably authorized.

Context-Inappropriate Capability

Medium
Confidence
86% confidence
Finding
Local file export is not justified by the declared title-diagnosis-only scope and writes data to arbitrary local paths supplied by the caller. In an agent setting, this expands the skill from analysis into filesystem side effects, which can leak sensitive review/report data into unintended locations or be abused to overwrite user files the process can access.

Context-Inappropriate Capability

High
Confidence
95% confidence
Finding
The skill can modify user/account behavior through autoconfirm settings, enabling future paid operations to proceed with reduced or no confirmation. That is outside a title-diagnosis role and is especially dangerous in agent-driven use because it changes consent semantics for subsequent actions, potentially causing silent charges.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The documented behavior is far broader than the declared skill purpose. A skill advertised as a title optimizer but documented to perform review collection, paid analysis, monitoring, exports, alerts, and operations workflows creates a severe scope mismatch that can mislead users and host agents into invoking capabilities they did not intend to authorize. In an agent setting, this increases the chance of over-privileged actions, unexpected billing, and data access beyond the user’s expectation.

Context-Inappropriate Capability

High
Confidence
96% confidence
Finding
The file documents ongoing monitoring, alerts, exports, scheduling, and operations workflows that are unjustified for a title-diagnosis skill. These capabilities materially expand the action surface from one-shot analysis into persistent and potentially chargeable operations, which is dangerous because users may grant trust based on the narrow title-optimization label while the skill performs broader account-affecting tasks. The context makes this more dangerous because the document repeatedly normalizes automatic execution and recurring actions.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
The top of the document presents an 'Amazon review intelligent assistant' while the declared skill metadata says 'amazon-title-optimizer.' This contradiction undermines informed consent and makes it difficult for users, reviewers, and calling agents to understand what the skill actually does, which can conceal risky capabilities behind a safer-looking name. While this is less severe than direct code execution, it is still a meaningful security and trust issue in an agent ecosystem.

Vague Triggers

Medium
Confidence
83% confidence
Finding
The natural-language trigger examples are broad enough to overlap with ordinary conversation about Amazon reviews and trends, increasing the chance of accidental invocation. Because this skill can perform collection, analysis, and potentially paid operations, over-broad trigger phrasing raises the risk of unintended execution from benign user requests.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
1. 运行 `check`,确认账户、邮箱验证状态和可用积点。
2. 用户要 VOC / 评论分析报告时,默认运行 `voc <ASIN> --site <站点>`。
   **返回里有 `autoConfirmed: true` 就说明已经直接生成了**(1.4.5 起:服务端对前几次小额
   付费操作免确认,用户先拿到结果再谈钱),此时把报告讲给用户,并转述 `autoConfirmNote`
   (本次扣了多少、还剩几次免确认、之后会先问)。**不要在拿到结果后再补问「要不要生成」。**
3. 返回 `confirmationRequired: true` 才需要用户确认:报出 `totalCredits` 与余额,
Confidence
95% confidence
Finding
The workflow instructs the agent to proceed with chargeable report generation when the backend returns auto-confirmation, without obtaining a fresh, action-specific confirmation from the user. In a skill already suffering from scope mismatch, this makes unintended paid execution more dangerous because normal conversational requests may directly trigger billable actions.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
1. 运行 `check`,确认账户、邮箱验证状态和可用积点。
2. 用户要 VOC / 评论分析报告时,默认运行 `voc <ASIN> --site <站点>`。
   **返回里有 `autoConfirmed: true` 就说明已经直接生成了**(1.4.5 起:服务端对前几次小额
   付费操作免确认,用户先拿到结果再谈钱),此时把报告讲给用户,并转述 `autoConfirmNote`
   (本次扣了多少、还剩几次免确认、之后会先问)。**不要在拿到结果后再补问「要不要生成」。**
3. 返回 `confirmationRequired: true` 才需要用户确认:报出 `totalCredits` 与余额,
   用户同意后运行 `voc <ASIN> --site <站点> --confirm`。该命令会自动补齐采集、等待任务完成、
Confidence
94% confidence
Finding
This step couples analysis requests to automatic collection, waiting, report generation, and archival, creating a largely autonomous paid workflow. The danger is amplified by the skill’s broad trigger language and mislabeled purpose, which together can cause users to incur charges or create persistent account artifacts without fully informed consent.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
用户只说自然语言。网页是补充视图(图表、分享链接、海报),不是把人送走的地方。

**确认与扣点**
- 报价返回 `autoConfirm: true` 时直接生成,不要再问「要不要」。生成后一句话交代:本次扣了多少、
  还剩几次免确认(或「免费版小额不问」)。策略由服务端决定:免费版小额不问;付费版前几次不问,之后先问。
- 用户说「以后别问了 / 50 以内直接做」→ 运行 `autoconfirm 50`;说「以后每次先问我」→ `autoconfirm off`;
  说「恢复默认」→ `autoconfirm default`。这是唯一需要你代用户设置的东西,设完复述一句当前规则。
Confidence
95% confidence
Finding
Directly generating outputs on `autoConfirm: true` delegates consent to a server-side policy rather than the current user interaction. That is risky in this context because the skill can do more than its declared title-optimization role, so an apparently simple request can become an immediate billable operation without an unambiguous ask-to-act moment.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
**确认与扣点**
- 报价返回 `autoConfirm: true` 时直接生成,不要再问「要不要」。生成后一句话交代:本次扣了多少、
  还剩几次免确认(或「免费版小额不问」)。策略由服务端决定:免费版小额不问;付费版前几次不问,之后先问。
- 用户说「以后别问了 / 50 以内直接做」→ 运行 `autoconfirm 50`;说「以后每次先问我」→ `autoconfirm off`;
  说「恢复默认」→ `autoconfirm default`。这是唯一需要你代用户设置的东西,设完复述一句当前规则。
- 报价需要确认时,只说两个数:这次多少积点、余额多少,然后等用户一个「好」。采集是**固定单价**:直接说「15 积点/页 × 3 页 = 45 积点」,不要说成「预计 / 最多」——价格不会浮动;商品评论不够这么多页时只收实际采到的页数,差额自动退回(`pricingNote` 已写好这句)。不要罗列参数。
Confidence
93% confidence
Finding
The same instruction also allows disabling confirmations (`autoconfirm off`/`default` changes) through conversation, which is an account policy mutation rather than ordinary analysis. Persistent changes to confirmation policy materially increase risk because later paid commands may execute with less friction and less user awareness.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
**确认与扣点**
- 报价返回 `autoConfirm: true` 时直接生成,不要再问「要不要」。生成后一句话交代:本次扣了多少、
  还剩几次免确认(或「免费版小额不问」)。策略由服务端决定:免费版小额不问;付费版前几次不问,之后先问。
- 用户说「以后别问了 / 50 以内直接做」→ 运行 `autoconfirm 50`;说「以后每次先问我」→ `autoconfirm off`;
  说「恢复默认」→ `autoconfirm default`。这是唯一需要你代用户设置的东西,设完复述一句当前规则。
- 报价需要确认时,只说两个数:这次多少积点、余额多少,然后等用户一个「好」。采集是**固定单价**:直接说「15 积点/页 × 3 页 = 45 积点」,不要说成「预计 / 最多」——价格不会浮动;商品评论不够这么多页时只收实际采到的页数,差额自动退回(`pricingNote` 已写好这句)。不要罗列参数。
Confidence
93% confidence
Finding
The same instruction also allows disabling confirmations (`autoconfirm off`/`default` changes) through conversation, which is an account policy mutation rather than ordinary analysis. Persistent changes to confirmation policy materially increase risk because later paid commands may execute with less friction and less user awareness.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
说「恢复默认」→ `autoconfirm default`。这是唯一需要你代用户设置的东西,设完复述一句当前规则。
- 报价需要确认时,只说两个数:这次多少积点、余额多少,然后等用户一个「好」。采集是**固定单价**:直接说「15 积点/页 × 3 页 = 45 积点」,不要说成「预计 / 最多」——价格不会浮动;商品评论不够这么多页时只收实际采到的页数,差额自动退回(`pricingNote` 已写好这句)。不要罗列参数。

**新手(`check` 返回 `autoConfirm.mode` 为 `first_runs` / `free_small`,或问"然后呢")**
- 报告讲完只推一个下一步,附接口返回的成本,不写死月费用。用户同意再 `schedule --set weekly`。
- 不解释命令名,不列功能清单。用户问「还能做什么」时按他的产品状态给一条建议,不超过三句。
Confidence
86% confidence
Finding
The workflow encourages the agent to recommend and then execute recurring weekly schedule enrollment after report delivery, based on product state and returned cost. Because this moves from one-off analysis into persistent monitoring/subscription behavior, it increases the chance of users being nudged into ongoing paid or stateful actions not implied by a title-optimizer skill.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
| `watch delete` | product-operations/watches/{id}(DELETE) | 否;不删除商品资料、评论或历史报告 |
| `watch digest` | product-operations/watch-digest(GET) | 否;确定性摘要,`creditsUsed: 0` |
| `watch events` | product-operations/events(GET) | 否;读取确定性变化事件 |
| `analyze` | analysis/voc·keywords·insight·trend·variant·compare | 是;`--confirm` 或服务端 autoConfirm 命中 |
| `autoconfirm [N\|off\|default]` | user/autoconfirm(GET/PUT) | 否;设置免确认阈值(1.4.5) |
| `deepdive` | products + charts + reviews + reports + VOC quote/analysis | 默认否;`--confirm` 才分析 |
| `reports` / `report` | reports | 否 |
Confidence
83% confidence
Finding
The documentation explicitly allows `analyze` to run when server-side `autoConfirm` rules are met, meaning a paid operation may execute without an explicit per-action confirmation from the user. In an agent setting, this can lead to unintended billable actions or analysis runs if the agent treats quote-like steps as non-executing.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
| `watch digest` | product-operations/watch-digest(GET) | 否;确定性摘要,`creditsUsed: 0` |
| `watch events` | product-operations/events(GET) | 否;读取确定性变化事件 |
| `analyze` | analysis/voc·keywords·insight·trend·variant·compare | 是;`--confirm` 或服务端 autoConfirm 命中 |
| `autoconfirm [N\|off\|default]` | user/autoconfirm(GET/PUT) | 否;设置免确认阈值(1.4.5) |
| `deepdive` | products + charts + reviews + reports + VOC quote/analysis | 默认否;`--confirm` 才分析 |
| `reports` / `report` | reports | 否 |
| `alerts` | alerts(`--mark-read` 时 alerts/read) | 否 |
Confidence
88% confidence
Finding
This duplicate finding points to the same risk: `autoconfirm` introduces stateful authorization weakening for future paid operations. In a tool-using agent, persistent confirmation bypass settings can convert later high-level requests into unintended charges.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
| `watch digest` | product-operations/watch-digest(GET) | 否;确定性摘要,`creditsUsed: 0` |
| `watch events` | product-operations/events(GET) | 否;读取确定性变化事件 |
| `analyze` | analysis/voc·keywords·insight·trend·variant·compare | 是;`--confirm` 或服务端 autoConfirm 命中 |
| `autoconfirm [N\|off\|default]` | user/autoconfirm(GET/PUT) | 否;设置免确认阈值(1.4.5) |
| `deepdive` | products + charts + reviews + reports + VOC quote/analysis | 默认否;`--confirm` 才分析 |
| `reports` / `report` | reports | 否 |
| `alerts` | alerts(`--mark-read` 时 alerts/read) | 否 |
Confidence
88% confidence
Finding
This duplicate finding points to the same risk: `autoconfirm` introduces stateful authorization weakening for future paid operations. In a tool-using agent, persistent confirmation bypass settings can convert later high-level requests into unintended charges.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
voc B0... --site amz_us 是完整 VOC 的入口:先取得报价,已有足够评论时使用当前分析价格;
数据不足时合并采集与分析费用。符合服务端免确认规则且总额不超过上限时可能直接生成,
返回 autoConfirmed。否则返回 confirmationRequired,取得用户同意后追加 --confirm,
自动完成必要采集、等待、分析和归档。只读询价应使用 quote / collect 报价入口。

`collect --asin B0... --site amz_us --pages 3` 只返回报价;确认后追加
Confidence
91% confidence
Finding
This section states that VOC may directly generate and charge under server-side auto-confirm rules, automatically completing collection, waiting, analysis, and archiving. In the context of an agent skill, that creates a concrete path for autonomous paid execution beyond mere information retrieval.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
先调用 `quote --type ...`。报价字段:
`type, basePrice, price, sampledReviews, totalReviews, balance, sufficient`,
另有(1.4.5):`autoConfirm`(true = 服务端首次体验策略允许免确认直接生成)、
`autoConfirmMaxCredits`(免确认单次上限,采集 + 报告合计)、`autoConfirmRemaining`(还剩几次)、
`autoConfirmNote`、`webUrl`(该产品的网页报告页)。`sampleCap` / `degraded` 表示 Free 样本封顶与轻量模型。
`voc` / `analyze` 在 autoConfirm 命中时会直接生成,返回 `autoConfirmed: true` 与 `autoConfirmNote`,
Confidence
84% confidence
Finding
Exposing `autoConfirm` in quote results is not dangerous by itself, but in this context it signals that the agent may treat a quote response as authorization to proceed. That weakens the boundary between estimate and execution for billable operations.

Static analysis

No suspicious patterns detected.