Back to skill

Security audit

Weibo Post Details API

Security checks for vulnerabilities and agentic risk

Overview

This skill is a focused JustOneAPI helper for fetching Weibo post details, with expected credentialed network access and no hidden persistence or unrelated behavior found.

Install only if you are comfortable sending a JustOneAPI token to api.justoneapi.com for this Weibo lookup. Prefer a limited, revocable token, avoid sharing logs or screenshots of commands, and rotate the token if command history, process metadata, or URL logs may have exposed 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:23
Finding
API Token Exposed Through Command-Line Arguments and URL Query Parameters<![CDATA[ ## Vulnerability Details **File Location**: `bin/run.mjs:23-31, 71-72, 89, 148-151, 224-234`; `SKILL.md:39, 45`; `generated/operations.json:17-25`; `generated/operations.md:20` **Vulnerability Type**: Credential exposure through process arguments and URL query strings **Risk Level**: Medium ### Complete Vulnerable Code Snippets The operation defines the API token as a query parameter: ```js { "defaultValue": null, "description": "API access token.", "enumValues": [], "location": "query", "name": "token", "required": true, "schemaType": "string" } ``` The token is injected into the parameter collection: ```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; } ``` All query parameters, including the token, are appended to the URL before transmission: ```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); } } ``` The resulting URL is sent to the declared remote API: ```js applyQueryParams(operation, params, url); const requestInit = { headers: { "accept": "application/json", }, method: operation.method, }; response = await fetch(url, requestInit); ``` The documented invocation also expands the secret into a command-line argument: ```bash node {baseDir}/bin/run.mjs --operation "getWeiboDetailsV1" --token "$JUST_ONE_API_TOKEN" --params-json '{"id":"<id>"}' ``` ### Technical Analysis The Skill legitimately requires authentication to call `https://api.justoneapi.c ...[truncated 3278 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Prefer authorization headers** - Change the API contract, where supported, to accept an `Authorization` header rather than a query parameter. - For example: ```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}`, }, }; ``` 2. **Read the credential directly from the environment** - Remove the documented `--token` argument. - Read `process.env.JUST_ONE_API_TOKEN` inside the process so the credential is not placed in the command-line argument vector. - Do not accept `token` through `--params-json`, because that would still expose it through process arguments. 3. **Remove token query serialization** - Mark the credential as a header-based authentication value rather than a normal operation parameter. - Ensure `applyQueryParams()` cannot append credentials or other sensitive fields to URLs. 4. **Apply compensating controls if query authentication is an unavoidable upstream requirement** - Continue using HTTPS. - Configure the API server, gateways, reverse proxies, tracing tools, and access logs to redact or omit the `token` query parameter. - Avoid logging complete request URLs. - Use short-lived, narrowly scoped tokens with quota and billing limits. - Rotate the token promptly after suspected disclosure. - Review redirect behavior and prevent credentials from being forwarded to an unintended destination. 5. **Add regression tests** - Verify that the token is absent from `process.argv`. - Verify that generated request URLs do not contain `token`. - Verify that error output and diagnostic logs never include the credential. ]]>
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
Content
"parameters": [
        {
          "defaultValue": null,
          "description": "API access token.",
          "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": "API access token.",
          "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": "API access token.",
          "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
84% 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 tool scope such as `permissions` or `allowed-tools`. This creates an authorization and transparency gap: a host agent may allow broader execution than intended or users may not be clearly informed that the skill performs outbound network access with a credentialed token.

Static analysis

Detected: suspicious.secret_argv_exposure

Instructions pass high-value credentials through process argv.

Critical
Code
suspicious.secret_argv_exposure
Location
SKILL.md:41