Back to skill

Security audit

Twitter Agent

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly coherent, but it can immediately publish live public Twitter/X posts from your account without a confirmation or dry-run step.

Review this skill carefully before installing. Use it only with an account you are comfortable delegating public posting rights to, protect and rotate the API tokens, consider adding a dry-run or explicit approval step before publishing, and pin the tweepy dependency before production use.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:20
Finding
Unpinned Tweepy Dependency Creates Supply-Chain Risk## Vulnerability Details **File Location**: `SKILL.md:20-23` and `README.md:18` **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: Medium The Skill installs Tweepy without a version constraint or package-integrity verification. **Complete vulnerable code snippets:** `SKILL.md:20-23` ```yaml install: - id: tweepy kind: pip package: tweepy ``` `README.md:18` ```markdown 3. **Python 3** and `tweepy` (`pip3 install tweepy`) ``` ### Technical Analysis Both installation methods resolve whichever Tweepy release the configured Python package index currently considers appropriate. The project does not provide a reviewed version pin, lockfile, package hash, or index restriction. Consequently, the code installed at deployment time may differ from the dependency version originally reviewed. This is a supply-chain hardening weakness rather than evidence that the current Tweepy package is malicious. Exploitation would require compromise of the package, its maintainer account, the package index, or the dependency-resolution path. If that occurred, package installation or import-time code could execute under the same account as the OpenClaw Agent. The exposure is security-relevant because the scripts import Tweepy after Twitter credentials have been supplied through the environment. The dependency is also entrusted with OAuth credentials during client construction: ```python client = tweepy.Client( consumer_key=CONSUMER_KEY, consumer_secret=CONSUMER_SECRET, access_token=ACCESS_TOKEN, access_token_secret=ACCESS_TOKEN_SECRET, ) ``` ### Attack Path 1. An attacker compromises a future Tweepy distribution, its publishing account, the configured package index, or the dependency-resolution channel. 2. A user installs or reinstalls the Skill using the unpinned `tweepy` declaration or `pip3 install tweepy`. 3. The installer resolves and executes the compromised pac ...[truncated 1097 chars]
Remediation
## Remediation Suggestions 1. Pin Tweepy to an explicitly reviewed version in both metadata and documentation, for example: ```yaml install: - id: tweepy kind: pip package: tweepy==REVIEWED_VERSION ``` 2. Generate a lockfile or requirements file containing cryptographic hashes and install with hash enforcement: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 3. Pin and hash all transitive dependencies, not only Tweepy. 4. Use an approved package index or internal artifact mirror and require TLS certificate validation. 5. Run installation and execution as an unprivileged, isolated user. Avoid system-wide or privileged `pip` installation. 6. Restrict the Skill process to only the credentials and filesystem paths needed for Twitter operations. 7. Establish a dependency-update process that reviews release notes, source changes, provenance, and package hashes before updating the pinned version. 8. Keep the dependency declaration in `SKILL.md` and the command in `README.md` synchronized so users cannot bypass the pin by following manual instructions.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (21)

Credential Access

High
Category
Privilege Escalation
Content
|---|---|---|
| `TW_CONSUMER_KEY` | API Key | developer.x.com → App → OAuth 1.0a Keys |
| `TW_CONSUMER_SECRET` | API Key Secret | developer.x.com → App → OAuth 1.0a Keys |
| `TW_ACCESS_TOKEN` | Access Token | developer.x.com → App → Generate (Read+Write) |
| `TW_ACCESS_TOKEN_SECRET` | Access Token Secret | developer.x.com → App → Generate (Read+Write) |
| `TWITTER_TOKEN` | 6551 API Token | [6551.io/mcp](https://6551.io/mcp) |
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
|---|---|---|
| `TW_CONSUMER_KEY` | API Key | developer.x.com → App → OAuth 1.0a Keys |
| `TW_CONSUMER_SECRET` | API Key Secret | developer.x.com → App → OAuth 1.0a Keys |
| `TW_ACCESS_TOKEN` | Access Token | developer.x.com → App → Generate (Read+Write) |
| `TW_ACCESS_TOKEN_SECRET` | Access Token Secret | developer.x.com → App → Generate (Read+Write) |
| `TWITTER_TOKEN` | 6551 API Token | [6551.io/mcp](https://6551.io/mcp) |
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
|---|---|---|
| `TW_CONSUMER_KEY` | API Key | developer.x.com → App → OAuth 1.0a Keys |
| `TW_CONSUMER_SECRET` | API Key Secret | developer.x.com → App → OAuth 1.0a Keys |
| `TW_ACCESS_TOKEN` | Access Token | developer.x.com → App → Generate (Read+Write) |
| `TW_ACCESS_TOKEN_SECRET` | Access Token Secret | developer.x.com → App → Generate (Read+Write) |
| `TWITTER_TOKEN` | 6551 API Token | [6551.io/mcp](https://6551.io/mcp) |
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The code chunk is narrowly focused on publishing a tweet, optionally with an attached image, via Twitter/X credentials from environment variables. The declared description presents a broader automation agent for AI+Crypto social engagement, including replies, quote tweets, hot-topic retrieval, and Claude-based generation. None of those broader agent behaviors appear in this code. Additionally, the code supports image upload, which is not mentioned in the description. This is a material description/behavior mismatch because the declared primary purpose is a multi-function automation agent, while the actual code only performs direct tweet posting.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The declared description presents a broader AI-powered crypto Twitter automation agent with multiple capabilities: posting tweets, replying, quote tweeting trending content, fetching hot topics from external integrations, and generating content with Claude. The supplied code chunk only performs one narrow function: quote tweeting a specified tweet with provided text using Twitter/X credentials from environment variables. It does not fetch trending content, does not integrate with opentwitter/opennews, does not call Claude or any model, and does not implement general tweet posting or reply behavior. While quote tweeting is one part of the declared description, the actual code is materially narrower than the declared purpose, so this is a description-behavior mismatch.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The README clearly markets autonomous posting, replying, and quote-tweeting on a user's account, but it does not prominently warn that the skill can publish public content on the user's behalf. In an agent context, this can lead to unintended reputational damage, spam, or policy violations if users install or invoke it without understanding the level of delegated authority.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The README enumerates multiple sensitive API credentials and notes they are stored locally, but it does not emphasize that these tokens grant account access and must be protected as secrets. Users may underestimate the risk of storing or sharing configuration files, increasing the chance of account takeover or abuse if the tokens are exposed.

Session Persistence

Medium
Category
Rogue Agent
Content
## Rate Limits (Free Tier)

- 1,500 tweets/month write limit
- Recommended: ≥10 min between posts, ≥5 min between replies
- Avoid replying to the same account many times in a short window
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill requests sensitive environment credentials and instructs execution of scripts, but it does not declare an explicit tool scope such as allowed-tools or permissions. This weakens least-privilege boundaries and makes the operational surface less transparent to users and enforcement systems.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill instructs users to post tweets, replies, and quote tweets without clearly warning that these actions are live and publicly attributable to the account. In a social-media automation context, this increases the risk of accidental irreversible posting, reputational damage, and misuse of a privileged account.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The workflow sends requests with a bearer token and query data to a third-party service, but the markdown does not clearly disclose that account-linked data and search inputs leave the local environment. This can expose sensitive operational metadata and create privacy, compliance, or trust issues for users.

External Transmission

Medium
Category
Data Exfiltration
Content
### Step 1 — Fetch trending tweets (via 6551 opentwitter)

```bash
curl -s -X POST "https://ai.6551.io/open/twitter_search" \
  -H "Authorization: Bearer $TWITTER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"keywords": "AI crypto", "minLikes": 500, "product": "Top", "maxResults": 10}'
Confidence
94% confidence
Finding
The skill explicitly instructs outbound HTTP POST requests to an external domain using a bearer token, which constitutes external transmission of potentially sensitive data. In this context the behavior is expected for the feature, but it still creates real exposure if users are not aware of third-party processing or if the external service is compromised.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
This script performs a real external action by posting to Twitter/X immediately with whatever text and optional image path it is given, using live credentials from environment variables, without any confirmation, dry-run mode, or guardrail. In an automation-agent context, that increases the risk of unintended, spammy, reputationally damaging, or prompt-influenced posts being published to a public account.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script performs a state-changing action against the Twitter/X API by posting a quote tweet immediately from command-line input, with no confirmation, dry-run mode, or policy checks. In an automation-agent context, this increases the risk of unintended posting, reputational harm, and misuse if upstream inputs are malformed, manipulated, or triggered without sufficient review.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The natural-language docstring is entirely in Chinese and presents the script's usage in that language only. Under the policy criteria, forcing a specific language without opt-in or a documented region-specific justification is a locale-policy issue.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
This code makes a live API call that publishes a reply on the user's Twitter/X account, which is an external side-effecting operation. The file includes no confirmation prompt and no user-facing warning beyond a minimal usage string, so the posting action can occur without explicit disclosure at execution time.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The guideline "Write in English" imposes a language policy in natural language. Because the skill does not offer language selection or make the restriction explicitly optional, it can conflict with the requirement to avoid forcing a specific language without user opt-in.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The natural-language usage text is presented only in Chinese, which imposes a specific language on users without indicating that other languages are supported. Under the language/locale policy, user-facing language constraints should be optional, justified, or clearly documented as region-specific.

Natural-Language Policy Violations

Low
Confidence
96% confidence
Finding
The only natural-language usage instructions are written in Chinese, which imposes a specific language on users without opt-in or explanation. This is a language/locale policy issue because the file does not provide an alternative language or state that the tool is intentionally limited to a Chinese-speaking context.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The script reads multiple Twitter API secrets from environment variables, but the file does not warn users that credentials must be present and will be used to authenticate actions on their account. This is a missing disclosure for sensitive credential handling in a code file.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The script accesses Twitter/X API credentials from environment variables, which is a sensitive operation under the review criteria. Although this is technically necessary for authentication, the file does not include comments, help text, or other disclosure explaining that it consumes account credentials from the environment.

Static analysis

No suspicious patterns detected.