Back to skill

Security audit

Amazon Keyword Research

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent Amazon research purpose, but its bundled script can execute unintended local code from a crafted keyword and its install/network behavior is under-scoped.

Review carefully before installing. Do not use this version with untrusted or externally supplied keywords, and prefer waiting for a fixed release that passes keyword values to Python as arguments, pins the install source, avoids global install by default, narrows triggers, and clearly discloses third-party keyword transmission.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/research.sh:36
Finding
User-Controlled Keyword Enables Arbitrary Python Code Execution<![CDATA[ ## Vulnerability Details **File Location**: `scripts/research.sh`, lines 36, 42, and 64 **Vulnerability Type**: Python code injection through unsafe interpolation **Risk Level**: High ### Vulnerable Code ```bash ENCODED_KW=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$KEYWORD'))") ``` The same vulnerable pattern is used when encoding expanded search terms: ```bash for prefix in "" "best " "cheap " "top "; do SEARCH_TERM="${prefix}${KEYWORD}" ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('${SEARCH_TERM}'))") ``` It is repeated during alphabet expansion: ```bash for letter in a b c d e f g h i j k l m n o p q r s t u v w x y z; do SEARCH_TERM="${KEYWORD} ${letter}" ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('${SEARCH_TERM}'))") ``` ### Technical Analysis The script embeds the user-controlled `KEYWORD` and derived `SEARCH_TERM` values directly inside source code passed to `python3 -c`. Shell quoting does not make this safe at the Python-language layer. A keyword containing a single quote and additional Python syntax can terminate the string passed to `urllib.parse.quote` and inject arbitrary Python statements. For example, a keyword shaped like the following can escape the intended Python string: ```text '); __import__("os").system("<attacker-command>"); # ``` After interpolation, the injected statement is parsed as part of the Python program. The unused `ENCODED_KW` assignment at line 36 is independently exploitable because command substitution executes the Python process even though its result is never subsequently used. The flaw is reached through the Skill's normal documented workflow, which instructs the Agent to pass a user-requested Amazon research keyword directly to this script. ### Attack Path 1. An attacker submits an Amazon research request containing a keyword crafted as Python syntax. 2. The Agent follows `SKILL.md` and invokes `scripts/research.sh` with tha ...[truncated 1053 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Never place user-controlled data inside source code supplied to `python3 -c`. Pass the value as a positional argument instead: ```bash ENCODED=$(python3 -c \ 'import sys, urllib.parse; print(urllib.parse.quote(sys.argv[1]))' \ "$SEARCH_TERM") ``` Apply this pattern to every encoding operation. The assignment to `ENCODED_KW` should be removed because it is unused. Additional hardening should include: 1. Enable strict shell behavior: ```bash set -euo pipefail ``` 2. Treat the keyword strictly as data and quote every shell expansion. 3. Validate the marketplace and impose a reasonable maximum keyword length. 4. Consider performing URL encoding with `curl --data-urlencode` rather than dynamically invoking Python. 5. Add regression tests covering single quotes, double quotes, semicolons, newlines, command substitutions, and Python metacharacters. 6. Run the Skill in a sandbox with restricted filesystem access, minimal environment variables, and limited outbound networking. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:13
Finding
Unpinned Global Installation from a Mutable Third-Party Source<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 13–15 **Vulnerability Type**: Unpinned third-party installation and supply-chain exposure **Risk Level**: Medium ### Vulnerable Code ```bash npx skills add nexscope-ai/Amazon-Skills --skill amazon-keyword-research -g ``` ### Technical Analysis The documented installation command references `nexscope-ai/Amazon-Skills` without an immutable release version, commit identifier, or integrity checksum. Consequently, the content installed by this command can change after the audited version has been reviewed. The `-g` option requests global installation, expanding the scope of any compromised or unexpectedly modified content. The documentation provides no verification or review step before activation. This is not a `curl | bash` issue: the audited project contains no command that pipes a remote HTTP response into a shell. The `curl` calls in `scripts/research.sh` only issue HTTPS requests to Amazon autocomplete endpoints and parse the returned JSON. The risk here instead arises from the mutable, unpinned installation source. ### Attack Path 1. The upstream repository, publisher account, release process, or referenced branch is compromised or modified. 2. Malicious or vulnerable content is added under the same mutable repository identifier. 3. A user follows the documented `npx skills add` command. 4. The installer retrieves the current upstream content rather than the exact audited revision. 5. The altered Skill is installed globally and may later execute when triggered by an Agent request. ### Impact Assessment The precise impact depends on the behavior and permissions of the installer and the subsequently installed Skill. A malicious upstream revision could potentially: - Install unreviewed scripts into a globally available Skill location. - Execute under the installing user's privileges when the Skill is invoked. - Read or modify files available to that user. - Access credentials expos ...[truncated 321 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin installation to an immutable, reviewed commit or cryptographically identified release. 2. Publish and verify a checksum or signed provenance record for the Skill package. 3. Avoid global installation by default; prefer a project-local or otherwise isolated installation. 4. Document how users can inspect the retrieved Skill files before enabling execution. 5. Use protected, signed releases and restrict publisher-account access with multi-factor authentication. 6. Maintain a lockfile or equivalent manifest recording the exact installed revision. 7. Clearly distinguish installation of the audited release from installation of the latest mutable upstream state. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The code accurately supports one portion of the description: retrieving Amazon autocomplete/long-tail keyword suggestions across 12 marketplaces without an API key. However, it does not implement competitor analysis, competition landscape evaluation, seasonal demand analysis, market opportunity assessment, keyword comparison logic, or any broader seller decision support. Its primary actual function is limited to collecting autocomplete suggestions via Amazon completion endpoints with simple prefix and alphabet expansion. Because the declared description substantially overstates the implemented analytical capabilities, this is a material description-behavior mismatch.

Vague Triggers

High
Confidence
98% confidence
Finding
The trigger guidance is extremely broad, directing activation for many direct and vague phrases like 'is this a good product to sell?' even when the user does not explicitly request keyword research. Overbroad triggers can cause unintended invocation of shell/network-enabled behavior, leading to unnecessary external requests, scope creep, and reduced user control over what tools are used.

External Script Fetching

High
Category
Supply Chain
Content
for prefix in "" "best " "cheap " "top "; do
  SEARCH_TERM="${prefix}${KEYWORD}"
  ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('${SEARCH_TERM}'))")
  RESULT=$(curl -s "https://completion.${DOMAIN}/api/2017/suggestions?mid=${MKT}&alias=aps&prefix=${ENCODED}" 2>/dev/null)
  if [ -n "$RESULT" ]; then
    echo "$RESULT" | python3 -c "
import sys, json
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
for prefix in "" "best " "cheap " "top "; do
  SEARCH_TERM="${prefix}${KEYWORD}"
  ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('${SEARCH_TERM}'))")
  RESULT=$(curl -s "https://completion.${DOMAIN}/api/2017/suggestions?mid=${MKT}&alias=aps&prefix=${ENCODED}" 2>/dev/null)
  if [ -n "$RESULT" ]; then
    echo "$RESULT" | python3 -c "
import sys, json
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill instructs use of both shell execution (`<skill>/scripts/research.sh`) and networked data collection (`web_search`, `web_fetch`) but does not declare any explicit tool scope or permissions. That creates an authorization gap where the runtime may grant broader-than-expected capabilities, making accidental or unsafe tool use harder to constrain or audit.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding
The installation command uses `npx skills add ...` without pinning a specific package or version, which exposes users to supply-chain risk from upstream changes or a compromised package at install time. Because `npx` fetches and executes code dynamically, an unexpected update could alter behavior or execute malicious code on the host.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The script sends the user-supplied keyword directly to Amazon autocomplete endpoints, which is a real privacy issue because search terms may contain sensitive business ideas, product plans, or accidental personal data. There is no explicit consent, warning, or redaction before transmitting the input to a third party, and the skill’s purpose makes such disclosure likely during normal use.

Static analysis

No suspicious patterns detected.