Back to skill

Security audit

Kuaishou Video Search API

Security checks for vulnerabilities and agentic risk

Overview

This skill is a narrowly scoped Kuaishou video search connector, but users should treat its API token handling carefully.

Install only if you are comfortable sending search keywords and your JustOneAPI token to JustOneAPI. Use a narrowly scoped token if available, avoid logging command lines or full request URLs, and rotate the token if it may have appeared in process telemetry or URL logs.

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:183
Finding
API Token Exposed Through Command-Line Arguments and URL Query Parameters<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:42-50`, `bin/run.mjs:183-195`, `bin/run.mjs:231-249`, `generated/operations.json:17-25`, and `generated/operations.md:19-23` **Vulnerability Type**: Credential exposure through process arguments and URL query parameters **Risk Level**: Medium ### Vulnerable Code The documented invocation passes the secret as a command-line argument: ```bash node {baseDir}/bin/run.mjs --operation "searchKuaishouVideoV2" --token "$JUST_ONE_API_TOKEN" --params-json '{"keyword":"<keyword>"}' ``` The implementation accepts that command-line token and adds it to the parameter object: ```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; } ``` Every parameter declared as a query parameter, including `token`, is then appended to the URL: ```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); } } function appendValue(searchParams, name, value) { if (Array.isArray(value)) { for (const item of value) { appendValue(searchParams, name, item); } return; } if (value && typeof value === "object") { searchParams.append(name, JSON.stringify(value)); return; } searchParams.append(name, String(value)); } ``` The generated operation manifest explicitly classifies the access token as a query parameter: ```json { "defaultValue": null, "description": "Access token for this API service.", "enumValues": [], "location": "query", " ...[truncated 2938 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Use authorization headers where supported** - Change the API contract to accept the credential through an `Authorization` header, such as: ```js const requestInit = { method: operation.method, headers: { accept: "application/json", authorization: `Bearer ${token}`, }, }; ``` - Remove `token` from `operation.parameters` so it cannot be appended to the URL. 2. **Read credentials directly from the environment** - Replace the `--token` interface with direct access to `process.env.JUST_ONE_API_TOKEN`. - Fail safely when the environment variable is absent. - Do not include the token value in validation errors or diagnostic output. 3. **If query-based authentication is mandated by the upstream API** - Continue using HTTPS, but document that query-string authentication is an upstream constraint. - Configure clients, proxies, gateways, access logs, and observability tools to remove or redact the `token` parameter. - Never log the constructed `URL` object or complete request URL. - Read the token from the environment rather than exposing it through process arguments. - Use narrowly scoped, short-lived tokens where the service supports them. - Rotate and revoke tokens suspected of appearing in historical process telemetry or URL logs. 4. **Harden documentation and generated artifacts** - Replace the documented `--token "$JUST_ONE_API_TOKEN"` command with an environment-only invocation. - Update `generated/operations.json` and `generated/operations.md` if header authentication becomes available. - Explicitly warn operators to redact query parameters from infrastructure logs if the upstream endpoint cannot be changed. 5. **Add regression controls** - Add tests confirming that credentials never appear in command-line examples, standard output, standard error, or logged URLs. - Add secret-redaction checks for request diagnostics ...[truncated 31 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (7)

Credential Access

High
Category
Privilege Escalation
Content
"parameters": [
        {
          "defaultValue": null,
          "description": "Access token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"parameters": [
        {
          "defaultValue": null,
          "description": "Access token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"parameters": [
        {
          "defaultValue": null,
          "description": "Access token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill invokes a network-capable helper (`node .../bin/run.mjs`) that sends user-supplied query data and an API token to an external service, but it does not declare an explicit tool scope such as `permissions` or `allowed-tools`. This weakens policy enforcement and user transparency because the runtime may permit outbound network access without a clearly documented restriction boundary, increasing the chance of unintended or unauthorized external calls.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The skill defines the API access token as a query parameter and automatically appends it to the request URL. Query-string credentials are commonly exposed through logs, browser/history equivalents, proxy infrastructure, monitoring systems, and error reports, which increases the chance of credential leakage even when HTTPS is used.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill requires an access token to be supplied as a query parameter, which is risky because URLs are commonly logged by clients, proxies, gateways, browser histories, and monitoring systems. Even if HTTPS is used, placing secrets in the query string increases accidental exposure compared with using an Authorization header or other secret-handling mechanism.

Vague Triggers

Low
Confidence
77% confidence
Finding
This is a manifest-style JSON file, so vague-trigger checks apply. The skill is described only as searching Kuaishou videos by keyword, without any explicit trigger phrases, scope limits, or negative examples to clarify when the skill should or should not activate, which can make invocation criteria overly broad in agent routing contexts.

Static analysis

No suspicious patterns detected.