Back to skill

Security audit

TikTok User Search API

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent TikTok user-search API wrapper, but it handles the JustOneAPI token in ways that can expose it through URLs and process arguments.

Review before installing if you are sensitive about API credential exposure. Use a scoped or short-lived JustOneAPI token if available, avoid running this where process command lines or full URLs are logged, and rotate the token if it may have been captured in logs. I found no evidence of hidden hosts, persistence, destructive actions, or unrelated data access.

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

Warning
Location
bin/run.mjs:18
Finding

API Token Exposed in URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: bin/run.mjs, lines 18–24, 88–107, and 237–245
Vulnerability Type: API credential disclosure through URL query parameters
Risk Level: Medium

Vulnerable Code

js
{
  "defaultValue": null,
  "description": "Security token for API access.",
  "enumValues": [],
  "location": "query",
  "name": "token",
  "required": true,
  "schemaType": "string"
}
js
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);
js
function applyQueryParams(operation, params, url) {
  for (const parameter of operation.parameters.filter((item) => item.location === "query")) {
    const value = params[parameter.name];
    if (value === undefined) {
      continue;
    }
    appendValue(url.searchParams, parameter.name, value);
  }
}

Technical Analysis

The operation manifest classifies the API token as a query parameter. applyQueryParams consequently appends the token to url.searchParams, and the resulting URL is passed directly to fetch.

HTTPS protects the request from passive network interception, but it does not prevent the complete URL from being recorded after TLS termination. Query strings are commonly retained by API gateway logs, reverse proxies, server access logs, application performance monitoring systems, debugging tools, and observability platforms.

Transmitting an authentication secret to ...[truncated 1481 chars]

Remediation
View remediation

Remediation Suggestions

  1. Change the API authentication contract to use an HTTP header, preferably:
    http
    Authorization: Bearer TOKEN_VALUE
    
  2. Remove the token parameter from operation.parameters so it cannot be processed by applyQueryParams.
  3. Add the authorization header directly to requestInit.headers.
  4. Ensure application, proxy, gateway, and telemetry configurations redact authentication headers.
  5. Update generated/operations.json, generated/operations.md, and SKILL.md to document header-based authentication.
  6. Rotate any token that may already have been retained in URL or access logs.
  7. If the upstream API only supports query authentication, explicitly document the residual risk, disable query-string logging wherever possible, and apply automated redaction for the token parameter.

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:43
Finding

API Token Exposed Through Process Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 43 and 51; bin/run.mjs, lines 143–168 and 193–205
Vulnerability Type: API credential disclosure through process arguments
Risk Level: Low

Vulnerable Code

bash
node {baseDir}/bin/run.mjs --operation "searchUserV1" --token "$JUST_ONE_API_TOKEN" --params-json '{"keyword":"<keyword>"}'
js
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;
      continue;
    }
    if (flag === "--params-json") {
      parsed.paramsJson = value;
      index += 1;
      continue;
    }
    if (flag === "--token") {
      parsed.token = value;
      index += 1;
      continue;
    }
    fail(`Unknown argument "${flag}".`);
  }
  return parsed;
}
js
function injectToken(operation, params, cliToken) {
  const tokenParam = operation.parameters.find((parameter) => parameter.name === "token");
  if (!tokenParam || params.token !== undefined) {
    return;
  }
  if (!cliToken) {
    fail("--token is required for this operation.", {
      operationId: operation.operationId,
    });
  }
  params.token = cliToken;
}

Technical Analysis

The documented invocation expands JUST_ONE_API_TOKEN into the --token command-line argument. The Node.js process then receives the plaintext token in process.argv.

Environment-variable expansion does not keep the value out of the resulting process argument vector. Depending on operating-system policy and runtime environment, command lines may be visible to other local users, privileged processes, container administrators, process-monitoring agents, crash diagnostics, or observability software. Comma ...[truncated 1545 chars]

Remediation
View remediation

Remediation Suggestions

  1. Read the credential directly from process.env.JUST_ONE_API_TOKEN:
    js
    const token = process.env.JUST_ONE_API_TOKEN;
    
  2. Remove --token from the documented invocation and preferably from the argument parser.
  3. If CLI token support must remain for compatibility, mark it as deprecated and explicitly warn that it may expose credentials through process inspection.
  4. Reject credentials supplied inside --params-json to prevent alternate accidental exposure.
  5. Avoid printing the token in diagnostics, exception messages, request URLs, or debug output.
  6. Rotate credentials suspected of having been captured by process-monitoring or command-history systems.
  7. Combine this change with header-based API authentication so the environment-sourced token is not subsequently inserted into a URL.
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 (3)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill requires the API token as a query parameter and automatically injects it into the request URL. Query-string secrets are commonly exposed through logs, browser/history layers, proxies, monitoring systems, and upstream services, making credential leakage more likely even when HTTPS is used. In this skill context, the risk is real because the token is an authentication secret for a third-party API and the code provides no warning or safer alternative.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The script performs an HTTP request to an external API endpoint using user-supplied parameters, but there is no visible confirmation prompt, print/log disclosure before sending, or comment/docstring warning about the network transmission. For code files, network calls that transmit user or system data should include some form of user disclosure unless clearly warned elsewhere.

Content

No source excerpt is available for this finding.