Back to skill

Security audit

tracking-sports-team-fan-sentiment-twitter

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Apify/Twitter sentiment workflow, but users should protect their Apify token and avoid sensitive search terms.

Install only if you are comfortable sending the chosen Twitter search terms to Apify and handling the returned tweet data locally. Use a limited Apify token where possible, avoid confidential watchlists or sensitive terms, and prefer an Authorization header over token-in-URL curl commands.

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

API Token Exposed Through URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 110–119
Vulnerability Type: Credential exposure through URL query parameters
Risk Level: Medium

The REST API fallback embeds the APIFY_TOKEN environment variable directly into request URLs:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["[TEAM_NAME]", "#[TeamHashtag]", "[TEAM_NAME] game"], "maxItems": 100}'

After the Actor run succeeds, the dataset retrieval command repeats the same unsafe pattern:

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

Technical Analysis

The Skill legitimately requires network access to Apify, and transmitting an authentication token to that service is necessary for its declared Twitter-sentiment functionality. The defect is the token's placement in the URL query string rather than in an authorization header.

HTTPS encrypts the request in transit, but it does not prevent the expanded URL from being exposed at endpoints or intermediary operational layers. Depending on the environment, the token may appear in:

  • Process arguments visible to local process-inspection tools.
  • Shell tracing and command-execution logs.
  • HTTP client diagnostics and error reports.
  • Reverse-proxy, gateway, monitoring, or server access logs.
  • Command history if users substitute a literal token instead of retaining the variable reference.

Thus, the behavior exceeds the minimum necessary exposure of the credential even though the destination itself is relevant to the Skill.

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 request URL.
  3. A local process observer, diagnostic system, proxy, gateway, or server-side logger records the complete ...[truncated 1058 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove token=$APIFY_TOKEN from every URL.

  2. Use Apify's supported HTTP authorization header, subject to verification against its current API documentation. For example:

    bash
    curl -X POST \
      "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs" \
      -H "Authorization: Bearer $APIFY_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"searchTerms": ["[TEAM_NAME]", "#[TeamHashtag]", "[TEAM_NAME] game"], "maxItems": 100}'
    
    bash
    curl \
      "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items" \
      -H "Authorization: Bearer $APIFY_TOKEN"
    
  3. Ensure command tracing and verbose HTTP logging are disabled when credentials are used.

  4. Redact authorization headers and tokens from application, proxy, and monitoring logs.

  5. Store the token in a managed secret store or protected environment variable rather than source files or command history.

  6. Use a least-privilege Apify token restricted to only the resources required by this Skill, if supported.

  7. Rotate any token that may already have been captured in URLs or operational logs.

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 (4)

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

This command sends user-supplied search terms and the APIFY_TOKEN to an external API endpoint. While external transmission is expected for this skill's functionality, it is still a real security/privacy concern because queries may contain sensitive monitoring targets and the token is exposed to command-line usage patterns and remote service processing.

Content

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["[TEAM_NAME]", "#[TeamHashtag]", "[TEAM_NAME] game"], "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 100)May include surrounding context.

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["[TEAM_NAME]", "#[TeamHashtag]", "[TEAM_NAME] game"], "maxItems": 100}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

Fetching the dataset from Apify is another external transmission point and may return collected tweet data to the local environment without any warning about data handling, retention, or downstream storage. This can expose scraped content, search context, and account-linked usage patterns if used in regulated or sensitive monitoring scenarios.

Content

Scanner excerpt · SKILL.md (reported line 107)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
91% confidence
Finding

The skill instructs users to run an external actor, transmit query parameters to Apify, and optionally save outputs to local files, but it does not clearly warn that user-provided search terms and retrieved data will leave the local environment and may be written to disk. This creates a transparency and privacy risk, especially if users include sensitive search terms, internal watchlists, or store results in unsecured locations.

Content

No source excerpt is available for this finding.