Back to skill

Security audit

analyzing-competitor-instagram-content-strategy

Security checks for vulnerabilities and agentic risk

Overview

The skill is a straightforward Instagram competitor-analysis guide that uses Apify as disclosed, with a token-handling caution in one fallback command.

Install only if you intend to use Apify for Instagram analysis. Use a narrowly scoped APIFY_TOKEN, avoid pasting tokens directly into commands, prefer MCP or a helper that keeps credentials out of URLs, and be aware that scraped handles and resulting datasets are sent to and stored by Apify according to its service behavior.

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
SKILL.md:86
Finding

Apify API Token Exposed in URL Query String

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:86
Vulnerability Type: Credential exposure through a URL query parameter
Risk Level: Medium

Complete Code Snippet:

bash
curl -X POST   "https://api.apify.com/v2/acts/apidojo~instagram-scraper/runs?token=$APIFY_TOKEN"   -H "Content-Type: application/json"   -d '{"usernames": ["competitor_handle"], "maxItems": 50}'

Technical Analysis

The documented REST fallback places APIFY_TOKEN in the request URL. When the shell expands this environment variable, the resulting command contains the plaintext credential in its command-line arguments.

URLs may be captured by shell history, process inspection utilities, terminal session recording, HTTP client diagnostics, monitoring platforms, proxies, gateways, and server access logs. Query strings are especially likely to be logged as part of the request target. HTTPS protects the request in transit but does not prevent credential disclosure through these endpoints and local operational records.

Attack Path

  1. A user follows the documented fallback command with APIFY_TOKEN set.
  2. The shell expands $APIFY_TOKEN into the query string.
  3. The complete URL is exposed to one or more local or remote logging and observation mechanisms.
  4. An attacker with access to such records extracts the token.
  5. The attacker submits authenticated requests to Apify using the compromised token.
  6. The attacker consumes resources or accesses actor runs and data within the token's granted permissions.

Exploitation depends on an attacker having access to a process view, command record, terminal capture, proxy log, server log, or similar telemetry containing the expanded URL.

Impact Assessment

Disclosure grants the attacker the same Apify API privileges assigned to the token. Depending on its scope, this may permit execution of actors, consumption of paid platform resources, access to run metadata or datasets, and ...[truncated 151 chars]

Remediation
View remediation

Remediation Suggestions

Remove the token from the URL and transmit it in an authorization header:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~instagram-scraper/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"usernames":["competitor_handle"],"maxItems":50}'

In addition:

  • Use a narrowly scoped token with only the permissions required for actor execution.
  • Prevent command tracing and debug logs from recording authorization headers.
  • Store the token in a protected secret manager or environment configuration rather than source files.
  • Redact credentials from terminal recordings, CI logs, HTTP diagnostics, and monitoring telemetry.
  • Rotate any token previously used with the query-string example if its disclosure cannot be ruled out.
  • Review Apify usage and audit records for unauthorized actor runs or data access.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 86)May include surrounding context.

REST API fallback:

bash
curl -X POST   "https://api.apify.com/v2/acts/apidojo~instagram-scraper/runs?token=$APIFY_TOKEN"   -H "Content-Type: application/json"   -d '{"usernames": ["competitor_handle"], "maxItems": 50}'

Step 2: Content Classification

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 86)May include surrounding context.

REST API fallback:

bash
curl -X POST   "https://api.apify.com/v2/acts/apidojo~instagram-scraper/runs?token=$APIFY_TOKEN"   -H "Content-Type: application/json"   -d '{"usernames": ["competitor_handle"], "maxItems": 50}'

Step 2: Content Classification

Static analysis

No suspicious patterns detected.