Back to skill

Security audit

finding-brand-ambassador-candidates

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for finding social media ambassador candidates, but it documents unsafe token handling and an optional JavaScript execution surface that users should review carefully.

Install only if you are comfortable using Apify to process Instagram and TikTok data. Use a least-privilege Apify token, avoid the documented query-string token fallback, prefer an Authorization header, and do not use customMapFunction unless you understand how the Apify actor executes 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
SKILL.md:76
Finding

Apify API Token Exposed in URL Query String

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 76
Vulnerability Type: API credential exposure through a URL query parameter
Risk Level: Medium

Vulnerable Code

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

Technical Analysis

The REST fallback embeds APIFY_TOKEN in the request URL. When the shell expands the environment variable, the secret becomes part of the curl command-line argument and request target.

URL-based credentials may be exposed through local process inspection, shell or terminal diagnostics, HTTP client debugging, proxy and gateway logs, monitoring systems, and server access logs. Query strings are commonly retained more broadly than authorization headers. Anyone who obtains the token can authenticate to Apify with the permissions assigned to that token.

Attack Path

  1. A user follows the documented REST API fallback while APIFY_TOKEN is set.
  2. The shell expands $APIFY_TOKEN into the URL passed as a command-line argument to curl.
  3. A local observer, diagnostic collector, proxy, gateway, or logging system records the command or request URL.
  4. An attacker obtains the token from the captured URL.
  5. The attacker reuses it against the Apify API to perform operations authorized for that token.

Impact Assessment

Successful exploitation compromises the privileges associated with the exposed Apify token. Depending on its configured scope, an attacker could consume paid platform resources, start actor runs, access associated Apify resources or run data, and cause financial or operational impact. This does not directly grant host-system privileges unless the compromised Apify account or its actors separately provide such capabilities.

Remediation
View remediation

Remediation Suggestions

Pass the token through an authorization header rather than the query string:

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

Additional hardening measures:

  • Use a least-privilege Apify token scoped only to the resources required by this Skill.
  • Avoid printing request headers or enabling verbose HTTP diagnostics where secrets could be recorded.
  • Redact credentials from application, proxy, gateway, and CI/CD logs.
  • Store the token in a protected secret manager or environment variable rather than source-controlled files.
  • Rotate the existing token if the documented command has already been used in an environment where command lines or URLs may have been logged.
  • Review Apify account activity and billing for unauthorized actor runs.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This finding is the core security issue: the skill exposes caller-controlled JavaScript execution unrelated to its business purpose. In agent/tooling contexts, code-execution surfaces are especially dangerous because they can be chained with secrets in the environment, network access, filesystem access, or downstream tool permissions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The manifest says the skill finds brand ambassador candidates on Instagram and TikTok, but the explicit input schema only defines startUrls as Instagram URLs and omits a TikTok-specific input path. The workflow later switches to keyword-based actor runs for both platforms, which does not match the documented input contract and creates a semantic mismatch between claimed usage and actual described operation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Allowing a caller-supplied customMapFunction introduces arbitrary JavaScript transformation capability into a skill whose stated purpose is only social-media candidate discovery. If that function is executed by the underlying actor/runtime, an attacker could abuse it to alter outputs, access unexpected data in the execution context, or perform unauthorized actions depending on sandboxing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The markdown instructs the user to run Instagram and TikTok scrapers and send queries/results to Apify, but it does not include any warning about privacy considerations, platform terms, or that third-party scraping will process external account data. Because this behavior affects user data handling and external systems, the skill description should disclose it explicitly.

Content

No source excerpt is available for this finding.

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

REST API fallback:

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

Step 2: Score Ambassador Fit

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

REST API fallback:

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

Step 2: Score Ambassador Fit

Static analysis

No suspicious patterns detected.