Back to skill

Security audit

finding-twitter-spaces-hosts-by-topic

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Twitter Spaces discovery workflow, but it needs review because it documents unsafe Apify token handling and broad scraping controls.

Review before installing. Use it only for non-sensitive Twitter/X research, keep Apify tokens narrowly scoped, avoid the REST examples that put tokens in URLs, prefer header-based authentication or the MCP/helper path if it protects secrets, and rotate any token already used in query-string 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:98
Finding

Apify API Token Exposed in URL Query Strings

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 98–107
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": ["Twitter Spaces [TOPIC]", "join my Space [TOPIC]", "hosting a Space about [TOPIC]", "upcoming Space [TOPIC]"], "maxItems": 100}'
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 URL query parameters. Although transmitting an authentication credential to Apify is necessary for the declared scraping functionality, embedding it in URLs is unnecessary and increases exposure.

Expanded URLs may be retained in shell history, process inspection output, proxy and server access logs, observability platforms, debugging traces, and error reports. HTTPS protects the request in transit but does not prevent credential disclosure through these endpoints and records.

Attack Path

  1. A user follows the REST fallback and executes one of the documented commands.
  2. The shell expands $APIFY_TOKEN into the command-line URL.
  3. The resulting URL is captured in shell history, process telemetry, access logs, monitoring data, or diagnostics.
  4. An attacker or unauthorized operator obtains access to one of those records.
  5. The attacker extracts and reuses the token against the Apify API.
  6. The attacker performs any actions allowed by the token until it is revoked, rotated, or expires.

Impact Assessment

A disclosed token may allow unauthorized use of the victim's Apify account within the token's granted permissions. Potential consequences include running actors, consuming paid resources, accessing available run results or datasets, exposing data ...[truncated 203 chars]

Remediation
View remediation

Remediation Suggestions

Remove credentials from all URL query parameters and supply the token through an 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": ["Twitter Spaces [TOPIC]", "join my Space [TOPIC]", "hosting a Space about [TOPIC]", "upcoming Space [TOPIC]"], "maxItems": 100}'

Apply equivalent header-based authentication when retrieving dataset items:

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

Additional hardening measures:

  • Use the narrowest token permissions supported by Apify.
  • Store the token in a protected environment variable or secret manager rather than source files.
  • Avoid verbose shell tracing while executing authenticated commands.
  • Ensure logs and error reports redact authorization credentials.
  • Rotate tokens previously used in URL query strings where those URLs may have been recorded.
  • Document token revocation and incident-response procedures.
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 (5)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a skill that finds Twitter Spaces hosts by topic and returns host-centric outputs like frequency signals, co-host network, and audience size indicators. However, the inputs exposed in the file are generic tweet-search parameters such as tweet language, replies, mentions, geotagging, media filters, and a custom map function, which align with broad tweet scraping rather than a purpose-built Spaces-host discovery workflow.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The skill instructs sending user-supplied search terms and an API token to an external third-party service via REST. External transmission is inherent to the skill's function, but it still creates data exposure risk because queries, topics of interest, and credentials are sent off-platform to Apify.

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": ["Twitter Spaces [TOPIC]", "join my Space [TOPIC]", "hosting a Space about [TOPIC]", "upcoming Space [TOPIC]"], "maxItems": 100}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

This line references the external Apify endpoint used to run the scraper, confirming third-party data transmission. In context this is expected behavior, but it is still a real security concern because organizational search intent and operational metadata leave the local 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": ["Twitter Spaces [TOPIC]", "join my Space [TOPIC]", "hosting a Space about [TOPIC]", "upcoming Space [TOPIC]"], "maxItems": 100}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

Fetching dataset items from the external Apify endpoint extends the external data flow and may expose scraped results, metadata, and tokenized access outside the local trust boundary. The risk is moderate because this is normal for the service, but it still enlarges the external attack and privacy surface.

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

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest says the skill returns concrete fields including host handle, Space topic focus, frequency signals, co-host network, and audience size indicators. The documented output format instead uses placeholder columns like '[Key Field]' and '[Metric 1]', which does not reflect the claimed host-specific return structure and contradicts the stated intent of the skill.

Content

No source excerpt is available for this finding.