Back to skill

Security audit

finding-affiliate-marketers-on-social-media

Security checks for vulnerabilities and agentic risk

Overview

This skill matches its Apify-based social-media research purpose, but it needs review because it exposes the Apify token in example URLs and under-explains external data sharing.

Review before installing or using. Use a dedicated low-privilege Apify token, avoid putting tokens in URLs or shell history, prefer header-based authentication or a managed secret store, and do not submit confidential campaign, competitor, or personal data unless Apify use is approved for that data. Expect the current workflow to be Instagram-focused despite the broader description.

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

Apify API Token Exposed in URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 75-83
Vulnerability Type: Credential exposure through command-line URL query parameters
Risk Level: Medium

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~instagram-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["#affiliate[niche]", "#[niche]code", "use code [NICHE]", "#commissioned"], "maxItems": 100}'

Wait for SUCCEEDED. Fetch dataset:

bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN"

Technical Analysis

The documented REST fallback expands the APIFY_TOKEN environment variable directly into two request URLs. Although HTTPS protects the URL while it is transmitted over the network, placing credentials in query parameters creates additional exposure surfaces that are not present when an authorization header is used.

The expanded URL can be visible in the local process argument list while curl is running. Query strings may also be retained by HTTP access logs, gateways, proxies, monitoring systems, error reports, or debugging telemetry. Personnel or systems with access to those records could recover the bearer credential.

Authentication to Apify is required for the Skill's declared social-media scraping functionality. However, transmitting the credential through URL parameters exceeds the minimum-risk implementation necessary because Apify API authentication can instead be supplied through an HTTP authorization header.

Attack Path

  1. A user follows the REST fallback instructions with APIFY_TOKEN set in the environment.
  2. The shell expands $APIFY_TOKEN into the URL passed as a command-line argument to curl.
  3. A local user with sufficient process-inspection access, or a party with access to proxy, gateway, monitoring, or service logs containing query strings, observes the expanded URL.
  4. The party extracts th ...[truncated 947 chars]
Remediation
View remediation

Remediation Suggestions

Remove the API token from every URL and supply it through an authorization header instead:

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 '{"searchTerms": ["#affiliate[niche]", "#[niche]code", "use code [NICHE]", "#commissioned"], "maxItems": 100}'

Retrieve the dataset using the same header-based authentication pattern:

bash
curl \
  "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items" \
  -H "Authorization: Bearer $APIFY_TOKEN"

Additional hardening measures:

  • Use a dedicated token with the narrowest permissions supported for actor execution and dataset retrieval.
  • Do not enable shell tracing or verbose HTTP logging around authenticated commands.
  • Configure gateways, proxies, and monitoring systems to redact authorization data and sensitive query parameters.
  • Avoid printing the token or expanded authenticated commands in diagnostic output.
  • Rotate the token if URLs containing it may already have been captured in process telemetry or infrastructure logs.
  • Ensure any referenced helper script reads the token securely and never places it in command-line arguments or output. The referenced scripts/run_actor.js was not present in the audited project and therefore could not be inspected.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill sends search terms and retrieved social-media data to Apify-operated third-party services, but the description does not warn users about this data disclosure. In a recruitment or competitor-monitoring context, queries may contain sensitive business intelligence, brand names, or campaign details that users may not realize are being transmitted externally.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The inputs table says the required input is startUrls containing Instagram profile/hashtag/location/audio/reels URLs, which describes generic URL-based scraping. But the later actor examples for this skill use searchTerms to discover affiliate marketers by niche and promo-language patterns, creating an active contradiction between the documented interface and the intended behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description states the skill finds affiliate marketers on both Instagram and TikTok using apidojo's scrapers. However, the executable guidance in the workflow, MCP example, and REST fallback only invokes apidojo~instagram-scraper, with no corresponding TikTok execution path, so the documented behavior does not match the claimed cross-platform scope.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

This skill explicitly instructs users to POST search terms to an external Apify API endpoint, which transmits potentially sensitive marketing research queries off-platform. Because the use case includes competitor affiliate monitoring and recruitment targeting, the transmitted terms may reveal confidential strategy or business intent to a third party.

Content

Scanner excerpt · SKILL.md (reported line 80)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 '{"searchTerms": ["#affiliate[niche]", "#[niche]code", "use code [NICHE]", "#commissioned"], "maxItems": 100}'

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 81)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 '{"searchTerms": ["#affiliate[niche]", "#[niche]code", "use code [NICHE]", "#commissioned"], "maxItems": 100}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

Fetching dataset items from the Apify API sends and retrieves collected result data through a third-party service and includes the token in the request URL. This creates both privacy exposure for the harvested social-media data and credential exposure risk via logs, browser history, shell history, or intermediary monitoring.

Content

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

Wait for SUCCEEDED. Fetch dataset:

bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN"

Step 3: Classify Results

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill requires an APIFY_TOKEN and demonstrates usage patterns that place the token into shell commands and URLs, but it does not warn about secure secret handling. Tokens embedded in command history, logs, process listings, or shared terminal transcripts can be exposed and then abused to run actors or access datasets.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.