Back to skill

Security audit

building-journalist-outreach-list-from-twitter

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it advertises, but it should be reviewed because it can collect broad Twitter/X contact data and includes Apify REST examples that may expose the user’s API token.

Install only if you are comfortable sending Twitter/X search criteria and selected usernames to Apify for scraping and enrichment. Prefer MCP or safer API calls using authorization headers, avoid enabling follower/following/retweeter collection unless you specifically need it, set strict maxItems limits, and treat exported contact lists as personal/professional data that should be retained carefully.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:114
Finding

Apify API Token Exposed Through Tweet Scraper Command-Line URL

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 114–122
Vulnerability Type: Credential exposure through process arguments and URL logging
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": ["[TOPIC] journalist", "[TOPIC] reporter", "writing about [TOPIC]"],
    "maxItems": 300
  }'

Technical Analysis

The REST fallback inserts APIFY_TOKEN into the request URL. When the shell expands this environment variable, the resulting credential may be exposed in the curl process arguments. Depending on the operating-system configuration, other local users or processes may be able to inspect those arguments through process-monitoring facilities.

URLs are also commonly captured by shell tracing, debugging output, HTTP proxies, monitoring systems, and request logs. Query parameters are therefore unsuitable for transmitting long-lived API credentials. Although the destination is the declared Apify API and there is no evidence of intentional credential exfiltration, this implementation unnecessarily broadens the token's exposure.

Attack Path

  1. A user sets APIFY_TOKEN and executes the documented REST fallback.
  2. The shell expands $APIFY_TOKEN into the URL passed to curl.
  3. A local process observer, enabled shell trace, proxy, or URL-logging system captures the expanded command or request URL.
  4. An attacker extracts the token from the token query parameter.
  5. The attacker reuses the token against the Apify API within the permissions and quotas assigned to the victim's account.

Impact Assessment

Successful exploitation could allow unauthorized use of the affected Apify token. The attacker could invoke actors, consume account resources or credits, and access API operations available to that token. The precise scope ...[truncated 150 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~tweet-scraper/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "searchTerms": ["[TOPIC] journalist", "[TOPIC] reporter", "writing about [TOPIC]"],
    "maxItems": 300
  }'

Additionally:

  • Disable shell tracing while commands involving credentials are executed.
  • Ensure logs and diagnostic output redact authorization headers.
  • Use a narrowly scoped token where supported.
  • Rotate any token believed to have appeared in process captures, proxy logs, or debugging output.
  • Avoid placing credentials directly in command-line arguments whenever a protected credential file or secret manager is available.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:139
Finding

Apify API Token Exposed Through User Scraper Command-Line URL

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 139–143
Vulnerability Type: Credential exposure through process arguments and URL logging
Risk Level: Medium

Vulnerable Code

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~twitter-user-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"usernames": ["[username1]", "[username2]"]}'

Technical Analysis

This REST fallback expands APIFY_TOKEN directly into a URL query parameter. The expanded URL can become visible in the curl process argument list and may also be retained by shell tracing, HTTP proxies, observability platforms, or URL-oriented logs.

API credentials should be sent through authorization headers rather than query parameters. The command targets the documented Apify service, so the reviewed content does not demonstrate intentional exfiltration; nevertheless, the credential-handling pattern creates an avoidable disclosure risk.

Attack Path

  1. A user exports a valid APIFY_TOKEN.
  2. The user runs the documented profile-enrichment REST command.
  3. The shell places the expanded token in the URL supplied as a curl argument.
  4. An attacker with access to process information or relevant logs obtains the URL.
  5. The attacker extracts and replays the token against Apify API endpoints.
  6. Unauthorized operations are performed within the token's assigned privileges and usage limits.

Impact Assessment

Exposure could permit unauthorized consumption of Apify resources, execution of actors, and access to other API functionality authorized for the token. Financial charges, quota exhaustion, and exposure of Apify-hosted run data may be possible depending on the account and token permissions. The issue does not itself grant local-system privileges or access beyond the compromised Apify credential.

Remediation
View remediation

Remediation Suggestions

Pass the token in an authorization header and omit it from the URL:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~twitter-user-scraper/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"usernames": ["[username1]", "[username2]"]}'

Further hardening should include:

  • Redacting authorization data from application and proxy logs.
  • Preventing shell tracing around commands that handle secrets.
  • Restricting token permissions and usage limits where supported.
  • Rotating credentials after any suspected logging or process-list exposure.
  • Using a secret manager or protected credential file rather than embedding secrets in command arguments.
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 (9)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill is advertised as building a targeted journalist outreach list, but its exposed inputs allow broader scraping modes that are not necessary for that purpose. This scope mismatch increases the chance of over-collection and repurposing the skill for generalized Twitter intelligence gathering beyond the user's stated need.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Follower, following, and retweeter extraction enables collection of relationship graphs and engagement networks for arbitrary accounts or tweets, which is not justified by the stated outreach-list function. That materially expands surveillance capability and can be used to profile people beyond journalists themselves.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Allowing a user-supplied JavaScript customMapFunction introduces arbitrary transformation logic that exceeds the stated purpose of returning a fixed outreach list schema. In practice, this can facilitate data manipulation, hidden exfiltration-oriented formatting, or repurposing scraped data in ways the skill does not transparently describe.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow sends search terms and collected Twitter usernames to Apify through MCP or REST, but it does not disclose that this data is being transmitted to a third party. That omission prevents informed consent and may expose user research topics or compiled contact targets to external processing.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The REST fallback explicitly transmits search terms to an external Apify endpoint, which is a real external data transfer. In this skill context, the danger is not mere connectivity but the lack of disclosure and consent around sending potentially sensitive research interests and targeting criteria to a third party.

Content

Scanner excerpt · SKILL.md (reported line 115)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 '{

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 116)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": ["[TOPIC] journalist", "[TOPIC] reporter", "writing about [TOPIC]"],

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This REST call sends collected usernames to Apify for profile enrichment, which is a substantive transfer of targeted account data to a third party. In a contact-list-building skill, that becomes more sensitive because the usernames are already filtered into a professional targeting set, making the dataset more valuable and potentially more privacy-relevant.

Content

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~twitter-user-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"usernames": ["[username1]", "[username2]"]}'

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs saving scraped Twitter data to local CSV/JSON files without warning the user that contact data will be written to disk. This can create unintended persistence of personal or sensitive professional profile data and increases the chance of mishandling or unauthorized local access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The example input sets tweetLanguage to en, which imposes a language constraint in natural-language configuration. The skill does not present this as optional or ask the user to choose a language/locale, so it can exclude non-English results without user opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.