Back to skill

Security audit

Amazon Products By Category API

Security checks for vulnerabilities and agentic risk

Overview

This is a narrow JustOneAPI wrapper for one Amazon product lookup endpoint, but users should treat the API token carefully because it is passed in ways that may be logged.

Install only if you are comfortable sending a JustOneAPI token and lookup parameters to api.justoneapi.com. Prefer a scoped, rotatable token, avoid running this in shared shells or CI logs, and rotate the token if command lines or request URLs may have been recorded.

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
bin/run.mjs:126
Finding

API Token Exposed Through Process Arguments and URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: bin/run.mjs:126-155, 194-227, 264-276; additionally documented in SKILL.md:48, 54
Vulnerability Type: API credential exposure through command-line arguments and URL query strings
Risk Level: Medium

Vulnerable Code

SKILL.md:48 instructs users to pass the secret as a process argument:

bash
node {baseDir}/bin/run.mjs --operation "getProductsByCategoryV1" --token "$JUST_ONE_API_TOKEN" --params-json '{"categoryId":"<categoryId>"}'

bin/run.mjs:126-155 constructs and sends the request:

javascript
const params = parseParams(args.paramsJson);
applyDefaults(operation, params);
injectToken(operation, params, args.token);
validateRequired(operation, params);

const baseUrl = manifest.baseUrl;
const url = new URL(operation.path, ensureBaseUrl(baseUrl));
applyPathParams(operation, params, url);
applyQueryParams(operation, params, url);

const requestInit = {
  headers: {
    "accept": "application/json",
  },
  method: operation.method,
};

if (operation.requestBody && params.body !== undefined) {
  requestInit.body = JSON.stringify(params.body);
  requestInit.headers["content-type"] = operation.requestBody.contentType || "application/json";
}

let response;
try {
  response = await fetch(url, requestInit);
} catch (error) {
  fail("Network request failed.", {
    cause: error instanceof Error ? error.message : String(error),
    operationId: operation.operationId,
  });
}

bin/run.mjs:194-227 reads the token from the command line and places it into the parameter object:

javascript
function parseArgs(argv) {
  const parsed = { operation: null, paramsJson: "{}", token: null };
  for (let index = 0; index < argv.length; index += 1) {
    const flag = argv[index];
    const value = argv[index + 1];
    if (flag === "--operation") {
      parsed.operation = value;
      index += 1;
...[truncated 4190 chars]
Remediation
View remediation

Remediation Suggestions

  1. Read the credential directly from process.env.JUST_ONE_API_TOKEN instead of accepting it through --token:

    javascript
    const token = process.env.JUST_ONE_API_TOKEN;
    if (!token) {
      fail("JUST_ONE_API_TOKEN is required.");
    }
    
  2. If supported by JustOneAPI, transmit the credential in an authentication header rather than the URL:

    javascript
    const requestInit = {
      method: operation.method,
      headers: {
        accept: "application/json",
        authorization: `Bearer ${token}`,
      },
    };
    
  3. Remove token from the operation's ordinary query-parameter collection so generic parameter processing cannot accidentally serialize it into URLs.

  4. If the upstream API exclusively requires query-string authentication, isolate token insertion from ordinary parameters and treat the resulting URL as sensitive. Never print, persist, or include the complete URL in errors or telemetry.

  5. Configure clients, proxies, gateways, monitoring systems, and API access logs to redact token and equivalent authentication fields.

  6. Reject credentials supplied inside --params-json to ensure callers cannot bypass the safer credential path.

  7. Update SKILL.md to instruct users to set JUST_ONE_API_TOKEN in the environment without passing its value as a command-line argument.

  8. Rotate any token that may already have been exposed through process monitoring, command auditing, CI logs, or URL access logs.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill invokes a network-capable helper (node .../bin/run.mjs) and is explicitly designed to call an external API, but it does not declare any permissions or allowed-tools scope. That omission weakens policy enforcement and reviewability because the runtime/network access the skill needs is implicit rather than explicitly bounded, increasing the chance of unintended or over-broad external access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill requires the API token as a query parameter and then appends all query parameters directly into the request URL. Query-string secrets are commonly exposed in logs, browser/history equivalents, proxy infrastructure, monitoring tools, and error telemetry, making credential leakage more likely than if the token were sent in an Authorization header. In this skill context, the risk is real because the token is sent to a third-party API service and there is no warning or safer transport mechanism for the credential.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The operation requires a token query parameter for an external API service but provides no warning that users will transmit credentials to a third-party endpoint. Putting authentication material in the query string is especially risky because URLs are commonly logged by clients, proxies, servers, browser history, and observability tooling, increasing the chance of credential exposure beyond the intended recipient.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script performs an HTTP request to an external service using parameters that include category selection and authentication data, but there is no confirmation prompt, print/log notice before transmission, or descriptive comment/docstring warning the user. For code files, external data transmission should have some visible disclosure unless clearly communicated elsewhere.

Content

No source excerpt is available for this finding.