Back to skill

Security audit

monitoring-trending-topics-twitter-by-niche

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its Twitter/X trend-monitoring purpose, but it handles an Apify API token in an unsafe REST fallback and should be reviewed before use.

Use this only if you are comfortable sending the chosen Twitter/X search terms to Apify. Prefer the MCP or a trusted runner that keeps the token in secure headers or a secret store, avoid the REST fallback as written, set a clear maxItems limit, and do not use sensitive internal watchlists without approval.

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

Apify API Token Exposed in URL Query Strings

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 99-108
Vulnerability Type: API credential exposure through URL query parameters
Risk Level: Medium

Vulnerable Code

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": ["[NICHE]", "#[niche]trending", "[NICHE] breaking"], "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 places APIFY_TOKEN in the query string of two HTTPS URLs. Authentication is necessary for the Skill's declared remote scraping functionality, but placing the credential in a URL is not necessary and does not follow least-disclosure practices.

Although HTTPS protects the URL while it is in transit, URLs can still be captured by process inspection, HTTP client diagnostics, reverse proxies, monitoring systems, application telemetry, and server access logs. Such records frequently receive broader access and longer retention than dedicated secret stores. The literal shell command may also be copied into scripts, support records, or execution logs after variable expansion.

The Skill does not intentionally send the token to an unrelated domain: both requests target Apify. The vulnerability is the insecure credential transport mechanism rather than unauthorized third-party exfiltration.

Attack Path

  1. A user configures a valid APIFY_TOKEN and follows the documented REST fallback.
  2. The shell expands the token into the request URL.
  3. The complete URL is exposed to a process monitor, diagnostic trace, proxy, telemetry collector, or Apify-side access log.
  4. An attacker or unauthorized operator with access to one of those records extracts the token.
  5. The attacker submits authenticated requests to the ...[truncated 843 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the token from every URL and transmit it through an HTTP authorization header supported by Apify:

    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": ["[NICHE]", "#[niche]trending", "[NICHE] breaking"], "maxItems": 100}'
    
    bash
    curl \
      "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items" \
      -H "Authorization: Bearer $APIFY_TOKEN"
    
  2. Ensure execution wrappers redact authorization headers and environment variables from debug output, errors, and telemetry.

  3. Avoid shell tracing such as set -x while handling credentials.

  4. Store the token in a restricted secret manager or protected environment configuration rather than plaintext project files.

  5. Use a narrowly scoped token with only the permissions required to invoke the designated actor and retrieve its output.

  6. Rotate any token previously used in URL query strings if those requests may have entered logs, proxy records, or diagnostic systems.

  7. Configure log retention and redaction controls to remove historical token query parameters.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says the skill returns trending topics, tweet velocity, engagement signals, and top voices in the trend. However, the concrete operational steps and examples only invoke the Apify tweet scraper and retrieve dataset items; the later 'classification' and 'score' sections are formulas/instructions, not executable code that computes or returns those outputs.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest description says the skill triggers when the user asks to 'track what's being discussed in an industry on X right now,' 'see what topics are trending in a specific community,' or 'identify breaking trends before they hit mainstream media.' These phrases are broad natural-language requests without clear boundaries or exclusion conditions, which increases the chance of unintended invocation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill instructs the agent to create local output files and send authenticated requests to a third-party API without clearly requiring user confirmation or warning that search terms and API tokens will be transmitted externally. In an agent setting, this can lead to unexpected data egress or filesystem writes, especially if user-supplied queries contain sensitive internal terms.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

This skill explicitly sends user-provided search terms and an APIFY_TOKEN to an external service via a REST request. Even if this is expected functionality, it is security-relevant because sensitive topics, internal watchlists, or proprietary monitoring queries could be transmitted off-platform, and placing tokens in the URL increases exposure through logs and shell history.

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": ["[NICHE]", "#[niche]trending", "[NICHE] breaking"], "maxItems": 100}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The documented use of api.apify.com confirms reliance on an external third-party endpoint for processing the query. In a skill ecosystem, external transmission is a real security concern when users may assume analysis is local, and any sensitive search terms or metadata could leave the trusted environment.

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": ["[NICHE]", "#[niche]trending", "[NICHE] breaking"], "maxItems": 100}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

Fetching dataset items from the third-party API is another external transmission/data retrieval step that can expose run identifiers, result contents, and associated authentication material to logging and monitoring surfaces. While normal for this integration, it remains a true security issue if done without clear consent and secure token handling.

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

Static analysis

No suspicious patterns detected.