Back to skill

Security audit

Douban Movie Subject Details API

Security checks for vulnerabilities and agentic risk

Overview

This is a narrow Douban lookup skill for JustOneAPI, with the main caution that its API token is passed through the command line and URL query string.

Install only if you trust JustOneAPI with the token and the Douban lookup use case. Use a revocable, least-privileged token if available, avoid logging command lines or full request URLs, and rotate the token if you suspect process lists, shell tooling, proxies, or server logs captured it.

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:224
Finding

API Access Token Exposed Through Command-Line Arguments and URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: bin/run.mjs:17-27, bin/run.mjs:65-67, bin/run.mjs:139-159, bin/run.mjs:173-185, and bin/run.mjs:224-233
Vulnerability Type: Sensitive credential exposure
Risk Level: Medium

The Skill legitimately requires a JustOneAPI access token, but it accepts that token through a command-line argument and transmits it as a URL query parameter.

Relevant operation declaration from bin/run.mjs:17-27:

js
{
  "defaultValue": null,
  "description": "Access token for this API service.",
  "enumValues": [],
  "location": "query",
  "name": "token",
  "required": true,
  "schemaType": "string"
}

Relevant request construction from bin/run.mjs:65-67:

js
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);

Command-line token handling from bin/run.mjs:139-159:

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;
}

Token injection from bin/run.mjs:173-185:

js
function injectToken(operation, params, cliToken) {
  const tokenParam = operation.parameters.find((parameter) => parameter.name === "token");
  if (!tokenParam || params.token !==
...[truncated 3864 chars]
Remediation
View remediation

Remediation Suggestions

  1. Use an authorization header where supported. Remove token from the query-parameter manifest and send it in a request header:

    js
    const token = args.token || process.env.JUST_ONE_API_TOKEN;
    if (!token) {
      fail("JUST_ONE_API_TOKEN is required.");
    }
    
    const requestInit = {
      headers: {
        accept: "application/json",
        authorization: `Bearer ${token}`,
      },
      method: operation.method,
    };
    

    Confirm the exact authentication scheme required by JustOneAPI before deploying this change.

  2. Read the credential directly from the environment. Prefer process.env.JUST_ONE_API_TOKEN over a --token argument so the secret is not included in the process argument vector. If compatibility requires --token, deprecate it and clearly warn users about process-list exposure.

  3. Prevent credential injection through general parameters. Reject token inside --params-json and maintain authentication data separately from ordinary operation parameters.

  4. If query authentication is mandated by the upstream API, apply compensating controls.

    • Configure clients, gateways, reverse proxies, and application servers to redact the token query parameter.
    • Disable complete-URL logging for this endpoint.
    • Ensure errors and telemetry never serialize the final URL.
    • Restrict access to logs and define short retention periods.
    • Use narrowly scoped, short-lived, and readily revocable tokens where the service supports them.
  5. Add automated regression tests. Verify that tokens do not appear in process invocation examples, standard output, standard error, telemetry, or logged request URLs.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (4)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · bin/run.mjs (reported line 20)May include surrounding context.

js
"parameters": [
        {
          "defaultValue": null,
          "description": "Access token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · generated/operations.json (reported line 15)May include surrounding context.

json
"parameters": [
        {
          "defaultValue": null,
          "description": "Access token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · generated/operations.md (reported line 19)May include surrounding context.

md
"parameters": [
        {
          "defaultValue": null,
          "description": "Access token for this API service.",
          "enumValues": [],
          "location": "query",
          "name": "token",

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill invokes a network-capable helper (node .../bin/run.mjs) and requires an API token, but it does not declare any explicit tool restrictions such as permissions or allowed-tools. This creates a governance gap: an agent runtime may permit broader tool or network access than intended, making it harder to enforce least privilege and increasing the chance of unintended external requests or misuse of the tokenized integration.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.