Back to skill

Security audit

Keyapi Amazon Ecommerce

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a KeyAPI data runner, but it is broader than its Amazon-only description and handles API tokens in ways users should review before installing.

Review this before installing. Use it only if you trust KeyAPI and the publisher, set KEYAPI_TOKEN through your environment or a secure secret store instead of the interactive prompt, do not commit any .env file, and avoid setting KEYAPI_SERVER_URL unless you intentionally want to send your token to that specific MCP server. Expect local API response caches under .keyapi-cache.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run.js:59
Finding

Bearer Token Can Be Transmitted to an Arbitrary Server

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run.js:254
Finding

API Token Is Entered Visibly and Persisted in Plaintext

Content
View full analysis
{ rl.close(); const token = answer.trim(); if (!token) { reject(new Error("No token entered. Set KEYAPI_TOKEN and try again.")); return; } const envPath = join(ROOT, ".env"); writeFileSync(envPath, `KEYAPI_TOKEN=${token}\n`, "utf8"); log(`[token] Saved to ${envPath} — future runs will load it automatically`); process.env.KEYAPI_TOKEN = token; resolve(token); }); ``` ### Technical Analysis The interactive prompt uses `readline.question`, which does not suppress terminal echo. The API token can therefore remain visible in the terminal and may be captured by screen recording, terminal logging, or nearby observers. The token is subsequently written to a plaintext `.env` file in the project root. `writeFileSync` does not specify a restrictive file mode, so protection depends on the process umask and existing file permissions. The reviewed project also contains no `.gitignore` that excludes `.env`, increasing the risk of accidental source-control inclusion. Persistent token storage is a convenience feature rather than a strict requirement for querying the API. Automatically persisting the token without an explicit opt-in or restrictive permissions exceeds the minimum secret-handling behavior necessary for the declared functionality. ### Attack Path 1. A user starts the runner without setting `KEYAPI_TOKEN`. 2. The runner prompts for the token using an echoing terminal input method. 3. The token is exposed on screen and may be captured through terminal history systems, session recording, shoulder surfing, or remote-support software. 4. The runner writes the token to `/.env` in plaintext. 5. Another local us ...[truncated 683 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
package.json:5
Finding

Dependency Graph Is Not Reproducibly Pinned

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (31)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The description presents an Amazon e-commerce analytics skill, but the supplied code does not implement Amazon-specific product/search/category/review/deals/seller functionality. Instead, it is a generic command-line client for a remote KeyAPI MCP server, able to list available tools, inspect schemas, and call arbitrary tools for different platforms. The code explicitly defaults to the TikTok platform and includes TikTok-specific image handling, with examples for TikTok and YouTube. While the runner could theoretically be used to access Amazon-related tools if such tools exist on the server, that behavior is not evidenced in this code chunk, and the primary purpose materially differs from the declared Amazon-focused description.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/run.js --platform amazon --list-tools

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The runner script’s documented behavior and examples target TikTok/YouTube influencer and social-media tooling, which materially conflicts with the skill manifest claiming Amazon e-commerce functionality. This kind of capability mismatch is dangerous because it can mislead users, reviewers, or higher-level agents into sending data or credentials to an unexpected service and invoking tools outside the declared trust boundary.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.js (reported line 45)May include surrounding context.

js
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, "..");

// ── .env loader ───────────────────────────────────────────────────────────────

(function loadDotenv() {
  const envPath = join(ROOT, ".env");

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.js (reported line 106)May include surrounding context.

js
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, "..");

// ── .env loader ───────────────────────────────────────────────────────────────

(function loadDotenv() {
  const envPath = join(ROOT, ".env");

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.js (reported line 247)May include surrounding context.

js
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, "..");

// ── .env loader ───────────────────────────────────────────────────────────────

(function loadDotenv() {
  const envPath = join(ROOT, ".env");

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.js (reported line 48)May include surrounding context.

js
// ── .env loader ───────────────────────────────────────────────────────────────

(function loadDotenv() {
  const envPath = join(ROOT, ".env");
  if (!existsSync(envPath)) return;
  for (const line of readFileSync(envPath, "utf8").split("\n")) {
    const m = line.match(/^\s*([A-Z_][A-Z0-9_]*)\s*=\s*(.*)$/);

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/run.js (reported line 248)May include surrounding context.

js
// ── .env loader ───────────────────────────────────────────────────────────────

(function loadDotenv() {
  const envPath = join(ROOT, ".env");
  if (!existsSync(envPath)) return;
  for (const line of readFileSync(envPath, "utf8").split("\n")) {
    const m = line.match(/^\s*([A-Z_][A-Z0-9_]*)\s*=\s*(.*)$/);

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

The script interactively prompts for an API token and persists it to a plaintext .env file in the skill directory. Storing credentials unencrypted in a project-local file increases the chance of accidental disclosure through source control, backups, shared workspaces, or other local processes, especially because the skill already shows signs of functionality mismatch that weaken trust in intended scope.

Content

Scanner excerpt · scripts/run.js (reported line 240)May include surrounding context.

js
// ── MCP client ────────────────────────────────────────────────────────────────

/** Prompt for KEYAPI_TOKEN interactively and persist it to .env */
async function promptToken() {
  if (!process.stdin.isTTY) {
    throw new Error(

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

This code writes the supplied KEYAPI_TOKEN directly into a plaintext .env file under the project root, creating a persistent local credential artifact. If the repository is shared, synced, backed up, or accidentally committed, the token can be exposed and reused for unauthorized API access.

Content

Scanner excerpt · scripts/run.js (reported line 262)May include surrounding context.

js
reject(new Error("No token entered. Set KEYAPI_TOKEN and try again."));
        return;
      }
      const envPath = join(ROOT, ".env");
      writeFileSync(envPath, `KEYAPI_TOKEN=${token}\n`, "utf8");
      log(`[token] Saved to ${envPath} — future runs will load it automatically`);
      process.env.KEYAPI_TOKEN = token;