Back to skill

Security audit

Amazon Serp Analysis

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent Amazon market-analysis purpose, but it uses raw network, database, and shell commands with weak scoping and input handling, so it should be reviewed before installation.

Install only if you are comfortable with the skill sending Amazon search URLs and keywords to the configured scraper, using optional marketplace/database tools, and running a local listing-grader script. Prefer environments where ClickHouse access is read-only and scoped, ASINs are validated as ten alphanumeric characters before script execution, and ambiguous market-analysis requests require confirmation before scraping.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:99
Finding

Command Injection Through Unvalidated ASIN Shell Argument

Content
View full analysis
/scripts/grade.py ``` ### Technical Analysis The Skill instructs the agent to substitute an ASIN obtained from scraper results directly into a shell command. Neither the ASIN nor the script path is quoted, validated, or passed through an argument-safe process execution interface. Although legitimate Amazon ASINs consist of ten alphanumeric characters, the workflow does not enforce this format. If the scraper response is compromised, manipulated, or otherwise contains an attacker-controlled ASIN value, shell metacharacters such as `;`, `&&`, command substitutions, or redirection operators could be interpreted by the shell. For example, an unsafe substituted value conceptually equivalent to: ```text B000000000; attacker_command ``` would cause the shell to treat the appended text as a separate command rather than as an argument to `grade.py`. ### Attack Path 1. The agent scrapes an Amazon SERP through the configured scraping service. 2. A compromised service, manipulated response, or malicious upstream data supplies a crafted value in `parsed.results[].asin`. 3. The agent selects that result as one of the top five organic products. 4. The crafted value is substituted into the documented `uv run ... grade.py ` shell template. 5. The shell interprets embedded metacharacters and executes an attacker-selected command. 6. The injected command runs with the same operating-system privileges and environment access as the agent process. ### Impact Assessment Successful exploitation may provide arbitrary command execution under the agent's operating-system identity. The resulting scope can include: - Reading files accessible to the agent account. - Accessing environment variables and locally available credential ...[truncated 362 chars]
Remediation
View remediation
&2 exit 1 fi uv run "$AMAZON_LISTING_JUDGE_DIR/scripts/grade.py" "$ASIN" ``` Additional hardening measures: 1. Use an argv-based process API rather than constructing a command string for shell evaluation. 2. Do not invoke a shell unless shell functionality is strictly required. 3. Resolve the grading script from a trusted, fixed installation directory. 4. Quote all shell variables, including file-system paths. 5. Do not trust scraper output merely because a field is named `asin`. 6. Run the grading process with least privilege, a minimal environment, and restricted file-system and network access. 7. Log validation failures without recording sensitive environment values. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:68
Finding

SQL Injection Through Unparameterized Seed Keyword

Content
View full analysis
%' AND date >= today() - INTERVAL 90 DAY GROUP BY search_term ORDER BY total_clicks DESC LIMIT 10 ``` ### Technical Analysis The Skill places the user-supplied seed keyword directly inside a quoted SQL pattern. It does not require parameter binding, escaping, character validation, or a structured query interface. If the agent performs literal replacement of ``, a seed containing a quote can terminate the intended SQL string. Additional SQL syntax may then alter predicates, access unintended records, invoke supported database functions, or introduce other statements where the MCP client and database configuration permit them. The exact exploitability and maximum effect depend on the ClickHouse MCP implementation, whether multiple statements are accepted, and the database identity's permissions. Nevertheless, the documented construction is unsafe because untrusted input is allowed to modify SQL syntax rather than being handled solely as data. ### Attack Path 1. A user supplies a specially crafted seed keyword containing a quote and SQL syntax. 2. The workflow reaches the optional ClickHouse brand-analytics query. 3. The agent replaces `` directly in the SQL template. 4. The crafted quote terminates the intended `ILIKE` string literal. 5. The remaining attacker-controlled text changes the query's structure. 6. ClickHouse executes the altered query using the permissions assigned to the MCP database identity. ### Impact Assessment Potential impact includes: - Reading brand-analytics records outside the intended keyword scope. - Bypassing intended query filters. - Causing expensive queries and resource consumption. - Triggeri ...[truncated 412 chars]
Remediation
View remediation
= today() - INTERVAL 90 DAY GROUP BY search_term ORDER BY total_clicks DESC LIMIT 10 ``` Bind `seed` through the client or MCP parameter mechanism rather than replacing text in the query. Additional hardening measures: 1. Configure the ClickHouse MCP identity as read-only. 2. Restrict that identity to the required database, table, columns, and query operations. 3. Disable multiple statements if the client supports that control. 4. Apply query time, memory, row, and result-size limits. 5. If parameter binding is unavailable, use a database-supported literal-escaping function and reject control characters; manual replacement should only be a last resort. 6. Record query failures without logging credentials or sensitive database content. 7. Treat the seed as untrusted even when it appears to be an ordinary product keyword. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger list includes broad phrases such as '市场分析', '竞争分析', and 'niche analysis', which can cause the skill to activate for loosely related user requests. In this skill's context, unintended activation is risky because activation can lead to external scraping requests and optional downstream tool usage without the user explicitly asking for those operations.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

The skill sends data to an external scraping API using curl and includes a credential ($CLAW_KEY) in the request, creating an external data transmission path. While external scraping is central to the skill's purpose, it still introduces confidentiality and governance risks if user-supplied keywords, derived queries, or associated metadata are sent to third-party infrastructure without clear consent and boundary controls.

Content

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

Scrape Amazon search results for the seed keyword:

bash
curl -s -X POST "$CLAW_API_BASE/api/scrape" \
  -H "Content-Type: application/json" \
  -d '{
    "claw_key": "'"$CLAW_KEY"'",

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill instructs the agent to execute a local script from another skill via uv run .../grade.py <ASIN>, which expands capabilities from data analysis into arbitrary local code execution. Because the path is external to this skill and depends on local environment state, a compromised or replaced amazon-listing-judge skill could run unintended code under the agent's privileges.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The required output format is entirely specified in Chinese and directs the model to present the full analysis using Chinese headings and labels. This imposes a specific language choice without indicating that the user can choose their preferred language or locale.

Content

No source excerpt is available for this finding.