Back to skill

Security audit

finding-instagram-creators-by-location

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Apify-based Instagram location research workflow, with a notable token-handling caution but no evidence of hidden or malicious behavior.

Install only if you are comfortable using Apify and sending Instagram location scrape requests to that service. Prefer the MCP or helper script path, use a narrowly scoped Apify token, avoid the REST fallback with token in the URL, and do not provide private or sensitive location targets unless appropriate for your use case.

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

Apify API Token Exposed Through URL Query Parameter

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 93–95
Vulnerability Type: Credential exposure through a URL query parameter
Risk Level: Medium

Vulnerable code snippet:

bash
# REST API fallback:
curl -X POST   "https://api.apify.com/v2/acts/apidojo~instagram-location-scraper/runs?token=$APIFY_TOKEN"   -H "Content-Type: application/json"   -d '{"locationIds": ["[LOCATION_ID]"], "maxItems": 100}'

Technical Analysis

The documented REST fallback expands APIFY_TOKEN directly into the request URL. Although HTTPS protects the URL while it is transmitted over the network, URL query strings are commonly recorded by local process inspection tools, shell debugging output, HTTP clients, reverse proxies, API gateways, monitoring platforms, and server access logs.

Credentials should not be included in URLs because URLs are frequently retained and propagated as operational metadata. An authenticated URL may consequently remain accessible after the request has completed. Any user or service that can inspect the relevant process arguments or logs could recover the token.

Attack Path

  1. A user follows the documented REST fallback while APIFY_TOKEN contains a valid credential.
  2. The shell expands $APIFY_TOKEN into the curl command's URL.
  3. The complete authenticated URL is exposed to a process observer, diagnostic system, proxy, API gateway, or logging platform.
  4. An attacker with access to that source extracts the value of the token query parameter.
  5. The attacker submits requests to the Apify API using the recovered token.
  6. The attacker can use the token until it expires or is revoked, subject to the token's assigned permissions and account limits.

Impact Assessment

Successful exploitation compromises the confidentiality of the Apify API token. The attacker may invoke actors, consume account resources, incur usage charges, and access other Apify resources authorized for t ...[truncated 191 chars]

Remediation
View remediation

Remediation Suggestions

Remove the token from the URL and transmit it through the Apify API authorization header instead:

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

Additional hardening measures:

  • Use a narrowly scoped token with only the permissions required to run the designated actor.
  • Prevent command tracing and verbose diagnostics from printing authorization headers.
  • Redact authorization data in client, proxy, gateway, and monitoring logs.
  • Store the token in an approved secret manager or protected environment variable rather than source files.
  • Rotate the token if the documented query-parameter command has already been used in an environment where URLs or process arguments may have been retained.
  • Configure expiration and usage monitoring where supported, and investigate unexpected actor runs or account consumption.
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 96)May include surrounding context.

REST API fallback:

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

Step 3: Score Creator Quality

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 96)May include surrounding context.

REST API fallback:

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

Step 3: Score Creator Quality