Back to skill

Security audit

monitoring-instagram-brand-mentions

Security checks for vulnerabilities and agentic risk

Overview

This Instagram monitoring skill is purpose-aligned but should be reviewed because it sends social-media data to Apify and documents an API-token pattern that can expose credentials.

Review this skill before installing if your Instagram monitoring involves personal data, regulated brands, competitors, or confidential campaigns. Use approved Apify/vendor controls, avoid the documented token-in-URL REST command, prefer an authorization header or MCP/runner flow, limit exported fields, and set a retention/deletion policy for saved CSV or JSON results.

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

Apify API Token Exposed Through URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 84
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": 100}'

Technical Analysis

The documented REST fallback places APIFY_TOKEN in the request URL. When the shell expands the environment variable, the credential becomes part of both curl's process arguments and the outgoing request URI.

Although HTTPS protects the request from passive network interception, it does not prevent credential disclosure through:

  • Local process inspection while curl is running.
  • HTTP access logs and request telemetry that record full URLs.
  • Reverse-proxy, API gateway, monitoring, or diagnostic logs.
  • Shell tracing, command-recording systems, or copied diagnostic output.

URLs are routinely retained and propagated more broadly than authorization headers. Using a reusable API token in a query parameter therefore unnecessarily increases its exposure.

Attack Path

  1. A user configures a valid APIFY_TOKEN and executes the documented REST fallback.
  2. The shell expands $APIFY_TOKEN into the command-line URL.
  3. A local user with process-inspection access, or a logging and monitoring component that records request URIs, captures the full URL.
  4. The attacker extracts the reusable token from the token query parameter.
  5. The attacker submits authenticated requests to Apify using the stolen token, subject to the token's assigned permissions and account controls.

Impact Assessment

Successful exploitation may permit unauthorized use of the victim's Apify account within the token's privilege scope. Potential consequences include running actors at the victim's expense, consuming account resources, and accessing data or actor functi ...[truncated 268 chars]

Remediation
View remediation

Remediation Suggestions

Remove the token from the query string 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 '{"keywords":["#[brand]","#[brand]review"],"maxItems":100}'

Additional hardening measures:

  1. Grant the token only the minimum permissions required for this actor workflow.
  2. Avoid enabling shell tracing or verbose HTTP diagnostics around commands that handle credentials.
  3. Redact authorization data from application, proxy, and monitoring logs.
  4. Store the token in a protected secret manager or environment configuration with restrictive access controls.
  5. Rotate any token previously used in URL form if relevant URLs may have been logged or exposed.
  6. Review Apify account activity and billing for unauthorized actor runs.
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 (6)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill encourages collecting and analyzing public Instagram posts, captions, and author handles through a third-party scraper without warning users about privacy, platform-policy, or data-handling implications. Even when data is public, aggregating and profiling individuals through an external service can create compliance, consent, and reputational risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation states the skill "Classifies mentions by sentiment and type," but this file only provides procedural guidance and heuristic rules, not executable code that performs classification. The manifest also says the skill returns basic post fields, while the body documentation expands behavior into sentiment analysis, advocate/critic identification, and brand health reporting that are not actually implemented here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The instructions explicitly support exporting scraped Instagram data to local CSV/JSON files without warning about secure storage, retention, or secondary sharing risks. Persisting social data locally increases the chance of unauthorized access, accidental disclosure, or long-term retention beyond the original user intent.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
81% confidence
Finding

This skill transmits user-supplied monitoring inputs and scraped-output workflow data to an external third-party service endpoint, which is a real data-boundary crossing. In context, external transmission is the core function of the skill, but it still carries security and privacy risk because brand-monitoring queries and associated social data are processed outside the local trust boundary.

Content

Scanner excerpt · SKILL.md (reported line 84)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 '{"keywords": ["#[brand]", "#[brand]review"], "maxItems": 100}'

Run for each hashtag cluster. Merge results and deduplicate by postUrl.

External Transmission

Medium
Category
Data Exfiltration
Confidence
81% confidence
Finding

This skill transmits user-supplied monitoring inputs and scraped-output workflow data to an external third-party service endpoint, which is a real data-boundary crossing. In context, external transmission is the core function of the skill, but it still carries security and privacy risk because brand-monitoring queries and associated social data are processed outside the local trust boundary.

Content

Scanner excerpt · SKILL.md (reported line 84)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 '{"keywords": ["#[brand]", "#[brand]review"], "maxItems": 100}'

Run for each hashtag cluster. Merge results and deduplicate by postUrl.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The workflow says Step 1 builds hashtags, Step 2 runs the scraper, Step 3 classifies mentions, Step 4 identifies advocates/critics, and Step 5 delivers a report. Immediately after, the document labels "Step 1 & 2" as running the scraper and later labels classification as "Step 2," which contradicts the earlier workflow and obscures what the skill actually does.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.