Back to skill

Security audit

amazon-sorftime-research-reviews-skill

Security checks for vulnerabilities and agentic risk

Overview

The skill’s review-analysis purpose is coherent, but it needs Review because it reads a local API key, sends it in URL-based requests, persists raw review data, and provides unsafe shell-command examples for user-supplied inputs.

Install only if you are comfortable with the agent reading the Sorftime key from the local .mcp.json file, sending requests to Sorftime, and saving raw review/product data locally. Prefer a revised version that validates ASIN/site before any shell command, uses managed secrets or header-based auth, redacts credentials from tool traces, and lets users control raw-data retention.

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:67
Finding

Unvalidated command arguments can enable shell and JSON injection

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 67–81 and 100–103
Vulnerability Type: Command injection through unsafe command construction
Risk Level: High

Vulnerable Code

bash
REPORT_DIR="D:/amazon-mcp/reports/review-analysis/{ASIN}_{站点}_20260315"
mkdir -p "$REPORT_DIR/data"
bash
API_KEY="从.mcp.json中获取的密钥"
curl -s -X POST "https://mcp.sorftime.com?key=${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"product_detail","arguments":{"amzSite":"US","asin":"ASIN"}}}' \
  > "$REPORT_DIR/data/raw_product_sse.txt"
bash
curl -s -X POST "https://mcp.sorftime.com?key=${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"product_reviews","arguments":{"amzSite":"US","asin":"ASIN","reviewType":"Negative"}}}' \
  > "$REPORT_DIR/data/raw_reviews_sse.txt"

Technical Analysis

The skill instructs an agent to incorporate the user-supplied ASIN and site into shell commands and JSON request bodies. It does not require validation before command construction. ASIN validation is only discussed later as troubleshooting after an API error.

Quoting a generated path does not make textual command generation safe. If an agent directly replaces {ASIN} or {站点} with input containing shell syntax such as command substitution, that syntax can remain active inside a double-quoted assignment. Quotes embedded in an input can also terminate the single-quoted JSON passed to curl, potentially exposing the surrounding shell command to injection.

This vulnerability depends on the agent implementing the documented examples by textual substitution, which is the execution model explicitly described by the skill.

Attack Path

  1. An attacker invokes the skill with a malicious value in the ASIN or site argument.
  2. The agent substitutes the argum ...[truncated 1184 chars]
Remediation
View remediation

Remediation Suggestions

  1. Validate every argument before constructing paths, JSON, or shell commands:

    • Require ASIN values to match ^[A-Za-z0-9]{10}$.
    • Require the site to be one of the documented fixed values: US, GB, DE, FR, IN, CA, JP, ES, IT, MX, AE, AU, BR, or SA.
    • Reject control characters, whitespace, quotes, path separators, and shell metacharacters.
  2. Do not perform textual substitution into executable shell snippets. Use structured tool arguments or a subprocess API with an argument array and shell=False.

  3. Construct request bodies with a JSON serializer. If Bash is unavoidable, use a safe tool such as:

    bash
    jq -n \
      --arg site "$SITE" \
      --arg asin "$ASIN" \
      '{jsonrpc:"2.0",id:1,method:"tools/call",params:{name:"product_detail",arguments:{amzSite:$site,asin:$asin}}}'
    
  4. Create output paths through a filesystem API rather than generated shell commands. Resolve the resulting path and verify that it remains under the intended report root.

  5. Add explicit failure behavior: if validation fails, stop processing before any directory creation, API request, or command execution.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:57
Finding

Sorftime API credential is transmitted in a URL query parameter

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 57–60, 77–78, and 100
Vulnerability Type: Sensitive credential exposure through URL-based authentication
Risk Level: Medium

Vulnerable Code

python
# 使用 Read 工具读取配置文件
Read("D:/amazon-mcp/.mcp.json")

# 从 JSON 中提取 API 密钥
# 格式: "url": "https://mcp.sorftime.com?key={API_KEY}"
bash
API_KEY="从.mcp.json中获取的密钥"
curl -s -X POST "https://mcp.sorftime.com?key=${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"product_detail","arguments":{"amzSite":"US","asin":"ASIN"}}}' \
  > "$REPORT_DIR/data/raw_product_sse.txt"
bash
curl -s -X POST "https://mcp.sorftime.com?key=${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"product_reviews","arguments":{"amzSite":"US","asin":"ASIN","reviewType":"Negative"}}}' \
  > "$REPORT_DIR/data/raw_reviews_sse.txt"

Technical Analysis

The skill retrieves an API key from a local configuration file and interpolates it into the query string of each Sorftime request. Although HTTPS protects the request while in transit, query strings are commonly retained in operational records, including reverse-proxy logs, server access logs, diagnostic traces, command histories, process telemetry, and tool execution records.

The full credential also becomes part of the generated command text. Any system that records tool calls or command diagnostics may therefore retain the secret. Using curl -s only suppresses ordinary progress output; it does not prevent the URL from being captured elsewhere.

The destination is the service associated with the credential, so the evidence does not establish unrelated credential exfiltration. The vulnerability is the unnecessary exposure of the credential across logging and telemetry surfaces.

Attack Path

  1. The agent ...[truncated 1001 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace query-string authentication with an HTTP authorization header, if supported by Sorftime:

    bash
    curl -sS -X POST "https://mcp.sorftime.com" \
      -H "Authorization: Bearer ${API_KEY}" \
      -H "Content-Type: application/json" \
      --data-binary "$REQUEST_BODY"
    
  2. Prefer the platform’s dedicated secret or MCP credential mechanism instead of reading a general configuration file into the agent context.

  3. Prevent commands, URLs, errors, and tool traces from displaying credentials. Apply redaction to values named key, api_key, token, or Authorization.

  4. Restrict filesystem permissions on .mcp.json to the account that requires it.

  5. Ensure the remote service and intermediary infrastructure redact authentication data from access logs and diagnostic telemetry.

  6. Rotate the existing API key if commands containing it may already have been logged. Apply minimum service-side permissions, quotas, and expiration to replacement credentials.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (13)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill is presented as a review-analysis capability, but its documented workflow also accesses local configuration files and writes multiple raw and derived artifacts to disk. This creates an integrity and scope-expansion problem: a user invoking review analysis would not reasonably expect local credential access and persistent storage of fetched content unless those behaviors are explicitly declared and consented to.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instructions explicitly direct reading .mcp.json to extract an API key, even though the skill's stated purpose is narrow product-review analysis. Accessing local credential material is highly sensitive because it expands the skill from content analysis into secret handling, and a compromised or modified skill could reuse that credential for unrelated outbound requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The workflow requires saving raw API responses and generated analysis artifacts to local files, but it does not warn the user that review data and related content will be persisted on disk. This increases data-retention and unintended disclosure risk, especially because raw responses may contain more information than is needed for the final report.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The instructions require storing full raw review/API response data in persistent files for reuse, even though those responses may contain user-generated text and other unnecessary details. Persistent retention of raw third-party content increases privacy, leakage, and secondary-use risk because later tools, users, or processes may access more data than needed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs reading an API key from .mcp.json and then embedding it into outbound network requests without any user-facing warning or consent around credential use and third-party transmission. This is dangerous because it combines secret access with external transmission, increasing the chance of unauthorized use, accidental leakage, or misuse if the skill is altered or the destination is not strictly controlled.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The skill performs external transmission to mcp.sorftime.com using a locally sourced API key and user-supplied product parameters, while also saving responses to disk. In context, outbound API calls are functionally relevant to review analysis, but they remain security-sensitive because they expose a secret to a third party and create a channel through which modified skill logic could exfiltrate additional data.

Content

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

bash
# 获取产品详情并保存原始SSE响应
API_KEY="从.mcp.json中获取的密钥"
curl -s -X POST "https://mcp.sorftime.com?key=${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"product_detail","arguments":{"amzSite":"US","asin":"ASIN"}}}' \
  > "$REPORT_DIR/data/raw_product_sse.txt"

Ssd 3

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The report template calls for including direct customer review quotations in generated outputs, which republishes user-provided content into new artifacts. Even if the reviews are public on Amazon, copying verbatim text into local reports can expand distribution, increase privacy/compliance risk, and preserve sensitive or offensive details unnecessarily.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The document is presented primarily in Chinese and labels the English content as templates embedded within a Chinese-language skill, with no indication that users can choose their preferred language. This can violate a language/locale policy where skills should not force a specific language unless the constraint is explicit and justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest states the skill should be invoked when the user uses the /review-analysis command, but the design document repeatedly documents /review-analyse as the trigger syntax. This is an active contradiction in documented intent and can cause users or agents to invoke the wrong command.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The workflow explicitly stores raw review responses and parsed review content to local files without any notice about retention, minimization, or handling of potentially sensitive user-generated text. Even if Amazon reviews are public, bulk collection and persistent storage can create unnecessary privacy, compliance, and data governance risk, especially when intermediate raw files may contain more metadata than needed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest description is in Chinese and the rest of the skill content consistently assumes Chinese-language interaction and outputs, but does not indicate that users may choose another language. This can violate a language/locale policy when a skill effectively forces one language without explicit opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file is written entirely in Chinese and provides no indication that language selection is optional or that the skill is intentionally limited to a Chinese-language workflow. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The manifest describes a skill focused on deep analysis of Amazon reviews and generating suggestions/templates, but the document specifies additional operational steps including fetching product details via API and persisting multiple intermediate files and a report. While some data retrieval is expected for review analysis, the documented scope materially expands into product-detail collection and staged file pipeline behavior not reflected in the manifest description.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.