Back to skill

Security audit

Reddit Post Details API

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but it handles the JustOneAPI token in a way that can expose the credential through command-line process data and URL query logs.

Review this skill before installing if the JustOneAPI token has meaningful account access or paid quota. Prefer a version that reads the token from a protected environment source and sends it in an authorization header; if this API only supports query-token authentication, use a narrowly scoped token, avoid logging full URLs or process arguments, and rotate the token if it may have been exposed.

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

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

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:39,47; bin/run.mjs:31-38,59,206-213; generated/operations.json:16-24; generated/operations.md:20-24
Vulnerability Type: Sensitive credential exposure
Risk Level: Medium

The Skill accepts the JustOneAPI access token as a command-line argument and transmits it as a URL query parameter.

Vulnerable Code

SKILL.md:39

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

SKILL.md:47

markdown
- Pass the token with `--token "$JUST_ONE_API_TOKEN"`; do not paste token values into chat messages, screenshots, or logs.

bin/run.mjs:31-38

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

bin/run.mjs:59

js
injectToken(operation, params, args.token);

bin/run.mjs:206-213

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

The token is subsequently processed as a query parameter:

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

Supplying a secret through --token causes the shell to expand the environment variable ...[truncated 3338 chars]

Remediation
View remediation

Remediation Suggestions

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

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

    Use the exact header scheme required by JustOneAPI if it differs from Bearer.

  2. Read the token directly from the environment. Avoid documenting or requiring --token, which places the secret in the process argument vector.

  3. Reject alternate token injection. Reject token in --params-json so callers cannot accidentally place credentials in serialized arguments or override the controlled credential source:

    js
    if (Object.prototype.hasOwnProperty.call(params, "token")) {
      fail("Do not provide token in --params-json.");
    }
    
  4. Do not log credential-bearing URLs. Ensure request, proxy, gateway, monitoring, and exception logging either omits query strings or redacts security-sensitive parameter names.

  5. If the backend only supports query authentication, document this constraint explicitly, request support for header-based authentication, disable URL logging wherever possible, use narrowly scoped short-lived tokens, and rotate any token that may already have entered logs.

  6. Update all generated metadata and documentation. Keep bin/run.mjs, generated/operations.json, generated/operations.md, and SKILL.md consistent with the hardened authentication mechanism.

  7. Apply server-side least privilege. Scope tokens to only the required Reddit post-detail operation where the service supports operation-level permissions, and enforce expiration, rotation, rate limits, and anomaly monitoring.

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

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The API design requires an access token to be sent as a query parameter, which is an unsafe credential handling pattern. Query parameters are commonly logged by servers, proxies, browser histories, monitoring tools, and error traces, increasing the chance of token disclosure and subsequent unauthorized API access.

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 · bin/run.mjs (reported line 20)May include surrounding context.

js
| Name | In | Required | Type | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `token` | `query` | yes | `string` | n/a | Access token for this API service. |
| `postId` | `query` | yes | `string` | n/a | The unique identifier of the Reddit post (e.g., 't3_1q4aqti'). |

### Request body

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
| Name | In | Required | Type | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `token` | `query` | yes | `string` | n/a | Access token for this API service. |
| `postId` | `query` | yes | `string` | n/a | The unique identifier of the Reddit post (e.g., 't3_1q4aqti'). |

### Request body

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
96% confidence
Finding

The skill defines the API access token as a query parameter and later appends all query parameters directly to the request URL. Query-string credentials are commonly exposed through logs, proxies, browser/history mechanisms, monitoring systems, and error telemetry, increasing the chance of credential disclosure even when HTTPS is used.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.