Back to skill

Security audit

Instagram User Published Posts API

Security checks for vulnerabilities and agentic risk

Overview

The skill performs the advertised Instagram posts lookup, but it handles the JustOneAPI token in ways that can expose the credential.

Review this carefully before installing. Use only a restricted or short-lived JustOneAPI token if possible, avoid running it on shared systems where process arguments may be visible, and be aware that the token may appear in URL logs handled by infrastructure. Use the retrieved Instagram data only where lawful and consistent with Instagram and JustOneAPI terms.

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

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

Content
View full analysis

Vulnerability Details

File Location: bin/run.mjs:29-37, 78-89, 180-222; related usage guidance in SKILL.md:38-45
Vulnerability Type: Sensitive credential exposure
Risk Level: Medium

Vulnerable Code

The API manifest defines the access token as a query parameter:

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

The token is accepted from a command-line argument, inserted into the parameter object, appended to the request URL, and transmitted:

js
const params = parseParams(args.paramsJson);
applyDefaults(operation, params);
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);

const requestInit = {
  headers: {
    "accept": "application/json",
  },
  method: operation.method,
};
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;
}

function validateRequired(operation, params) {
  const missing = [];
  for (const parameter of operation.parameters) {
    if (parameter.required && params[parameter.name] === undefined) {
      missing.push(parameter.name);
    }
  }
  if (operation.requestBody?.required && params.body === undefined) {
    missing.push("body");
  }
  if (missing.length) {

...[truncated 3898 chars]
Remediation
View remediation

Remediation Suggestions

  1. Read the credential directly from process.env.JUST_ONE_API_TOKEN rather than accepting it through --token.
  2. Transmit the token in the API's supported authentication header, preferably:
    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}`,
      },
    };
    
  3. Remove token from the operation's query-parameter definition and reject token when supplied through --params-json.
  4. If the upstream API supports only query-string authentication, request header-based authentication support from the provider. Until then, explicitly document the residual logging risk and configure all clients, proxies, gateways, and servers to redact the token parameter.
  5. Ensure diagnostic and error handling never prints request URLs, headers, environment values, or parameter objects containing credentials.
  6. Update SKILL.md, generated/operations.json, and generated/operations.md so their authentication instructions match the hardened implementation.
  7. Rotate tokens that may already have appeared in process captures, request logs, or observability systems, and restrict token permissions and lifetime where supported.
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 (7)

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

The API access token is passed as a query parameter, which is commonly exposed in logs, browser history, intermediary proxies, analytics systems, and referrer data. Even over HTTPS, placing credentials in the URL increases the risk of accidental disclosure and subsequent unauthorized API use.

Content

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

json
"parameters": [
        {
          "defaultValue": null,
          "description": "Access token for the 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 the API service. |
| `username` | `query` | yes | `string` | n/a | The Instagram username whose published posts are to be retrieved. |
| `paginationToken` | `query` | no | `string` | n/a | Token used for retrieving the next page of results. |

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 the API service. |
| `username` | `query` | yes | `string` | n/a | The Instagram username whose published posts are to be retrieved. |
| `paginationToken` | `query` | no | `string` | n/a | Token used for retrieving the next page of results. |

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill invokes a network-capable helper (node .../run.mjs) and calls an external API, but it does not declare any explicit tool scope such as permissions or allowed-tools. This weakens policy enforcement and reviewability because the runtime may permit broader network behavior than the manifest makes visible, increasing the risk of unintended outbound requests or misuse of the provided API token.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill defines the API access token as a query parameter and automatically appends it to the URL. Query-string secrets are commonly exposed through logs, browser/history equivalents, proxies, observability tooling, and upstream infrastructure, so the token may be disclosed outside the intended trust boundary even when HTTPS is used.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly supports collecting and building a historical record of another user's published Instagram posts for monitoring and auditing, but it provides no warning about privacy, terms-of-service, retention, or appropriate-use constraints. Even though the posts may be public, documenting surveillance-style collection without safeguards can enable misuse, over-collection, or non-compliant data handling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The natural-language descriptions repeatedly hard-code Instagram-specific behavior as the only supported context. While this is not a severe issue, it can be interpreted as a locale/platform constraint presented without any explicit opt-in or justification in the file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.