Back to skill

Security audit

clawec-amazon-product-search

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed Clawec API integration for Amazon product search, with expected network and API-key use but no hidden persistence or destructive behavior.

Install only if you are comfortable sending Amazon search keywords, selected region, and a Clawec API token to Clawec. Prefer a restricted Clawec API key, avoid running the shell helper on shared systems where other users can inspect process arguments, and rotate the key if you suspect command-line process logs captured it.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/search.sh:10
Finding

Bearer API Key Exposed Through Process Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: scripts/search.sh, lines 10–13
Vulnerability Type: Sensitive credential exposure through process arguments
Risk Level: Medium

bash
curl -s -X POST "https://www.clawec.com/api/aigc/tool/amazon_product_search" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d "$PAYLOAD"

Technical Analysis

The script expands CLAWEC_API_KEY directly into curl's Authorization command-line argument. Consequently, the resulting bearer token may be present in curl's process argument vector while the request is running.

On systems where process metadata is visible to other users, containers, monitoring agents, or diagnostic tools, the expanded header may be recovered through mechanisms such as ps or /proc/<pid>/cmdline. Quoting the variable prevents shell word splitting but does not prevent the expanded secret from entering the child process's argument vector.

Exploitation requires local process-inspection capability and an opportunity to inspect the short-lived curl process. The exposure is therefore environment-dependent, but it can become practical when requests are slow, repeatedly invoked, or observed through continuous process monitoring.

Attack Path

  1. A victim configures a valid CLAWEC_API_KEY and invokes scripts/search.sh.
  2. The shell expands $API_KEY into the curl -H argument.
  3. While curl is running, a local user or monitoring process with permission to inspect the victim's process metadata reads its argument vector.
  4. The observer extracts the bearer token from the Authorization: Bearer ... argument.
  5. The observer reuses the token to submit requests to the ClawEC API under the victim's identity until the token expires or is revoked.

Impact Assessment

A successful attacker obtains the confidentiality and effective privileges of the exposed ClawEC API key. The attacker may authenticate to Cl ...[truncated 386 chars]

Remediation
View remediation

Remediation Suggestions

Avoid placing bearer tokens directly in command-line arguments.

  • Supply the sensitive header through a permission-restricted curl configuration file rather than through -H on the command line.
  • Create any temporary configuration using a restrictive umask, such as 077, and remove it reliably with an EXIT trap.
  • Prefer an in-memory or file-descriptor-based configuration mechanism where supported, so the credential is not persisted longer than necessary.
  • Ensure temporary files are created with collision-resistant tools such as mktemp; do not use predictable paths.
  • Preserve the existing practice of reading the key from CLAWEC_API_KEY rather than hardcoding it.
  • Rotate the API key if process monitoring or logs may already have captured command-line arguments.
  • Restrict the API key to the minimum required endpoints and quota, and configure operating-system process visibility controls where appropriate.
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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill demonstrates shell execution via curl/bash but does not declare any tool scope restrictions such as allowed-tools or permissions. This can cause the agent runtime to grant broader execution capability than intended, increasing the chance of unintended command execution or misuse of shell access during skill invocation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The invocation description is broad enough that the skill may trigger in many generic shopping, research, or product-search contexts without strong user intent confirmation. Over-broad triggers can cause unexpected external API calls and transmission of user-provided search terms to a third party, especially in an autonomous agent setting.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The skill instructs the agent to send user-supplied search keywords and an API bearer token to an external third-party endpoint. External transmission is expected for this skill's purpose, but it still creates data exposure risk and credential-handling risk, especially if users are not clearly informed that their queries leave the local system.

Content

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

调用

bash
curl -s -X POST "https://www.clawec.com/api/aigc/tool/amazon_product_search" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $CLAWEC_API_KEY" \
  -d '{"keyword":"bluetooth headphones","region":"NA"}'

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The output guidance explicitly requires '默认中文摘要' (default Chinese summary), which imposes a language preference without indicating user choice or opt-in. This is a natural-language policy issue because it forces a specific locale behavior rather than adapting to the user's language preference.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/search.sh (reported line 10)May include surrounding context.

sh
PAYLOAD=$(python3 -c 'import json,sys; print(json.dumps({"keyword": sys.argv[1], "region": sys.argv[2]}))' "$KEYWORD" "$REGION")

curl -s -X POST "https://www.clawec.com/api/aigc/tool/amazon_product_search" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d "$PAYLOAD"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This shell script performs an HTTP POST to an external service and transmits user-provided input (keyword, region) along with an API credential, but it provides no visible confirmation, logging, or explanatory comment about the network transmission. For code files, outbound network calls that transmit user or system data should have some form of disclosure unless clearly warned elsewhere, which is not present in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file presents all user-facing documentation exclusively in Chinese, including headings, field descriptions, and usage notes. The policy flags language constraints when a skill forces a specific language without user opt-in or documented justification, and this file does not mention any language choice or region-specific documentation scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The usage and error messages are hard-coded in Chinese (用法, 请设置环境变量) with no opt-in or alternative locale handling. This is a natural-language policy concern because it imposes a specific language on users regardless of their preferences.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.