Back to skill

Security audit

X (Twitter) Publisher

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for publishing to X, but it needs review because it can immediately post public content and its wrappers perform unsafe runtime dependency bootstrapping.

Install only after reviewing the wrapper behavior. Use an X account you intend to post from, confirm exact content before invoking tweet or thread commands, and consider requiring preinstalled pip/venv plus hash-pinned dependencies before running with X credentials in the environment.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Mutable and Unverified Python Dependency Installation

Content
View full analysis
=4.14 ``` `scripts/x_publisher:75-90` and identical code in `scripts/post_thread:75-90`: ```bash # --- (re)install deps when needed ------------------------------------------- need_install=0 [ -f "$STAMP" ] || need_install=1 if [ -f "$REQ_FILE" ] && ! cmp -s "$REQ_FILE" "$STAMP" 2>/dev/null; then need_install=1 fi if [ "$need_install" -eq 1 ]; then if [ -f "$REQ_FILE" ]; then echo "[wrapper] installing dependencies from $REQ_FILE" >&2 if "$VENV_PY" -m pip install --disable-pip-version-check --no-input -r "$REQ_FILE" >&2; then cp "$REQ_FILE" "$STAMP" else echo "[wrapper] WARNING: dependency installation failed; continuing in case the script does not need them" >&2 fi else : > "$STAMP" fi fi ``` ### Technical Analysis The dependency declaration uses the lower-bound constraint `tweepy>=4.14`, allowing pip to install any current or future release satisfying that constraint. No exact version, package hash, lock file, or trusted artifact digest is supplied. The executable wrappers automatically install the dependency when the virtual environment is first created or when `requirements.txt` changes. Consequently, the code that runs can differ from the code assessed during the Skill audit. This also contradicts the documentation’s statement that Tweepy is “pinned.” Although no malicious dependency is currently present in the repository, the installation design creates a concrete supply-chain trust boundary. A compromised future Tweepy release, compromised transitive dependency, or altered package-index re ...[truncated 1583 chars]
Remediation
View remediation

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/x_publisher:41
Finding

Runtime Download and Execution of Unverified get-pip.py

Content
View full analysis
/dev/null 2>&1 && return 0 local gp="$VENV_DIR/get-pip.py" echo "[wrapper] ensurepip unavailable; fetching get-pip.py" >&2 if command -v curl >/dev/null 2>&1; then curl -fsSL https://bootstrap.pypa.io/get-pip.py -o "$gp" || return 1 elif command -v wget >/dev/null 2>&1; then wget -qO "$gp" https://bootstrap.pypa.io/get-pip.py || return 1 else "$VENV_PY" -c "import urllib.request; urllib.request.urlretrieve('https://bootstrap.pypa.io/get-pip.py', '$gp')" || return 1 fi "$VENV_PY" "$gp" >/dev/null 2>&1; local rc=$? rm -f "$gp" [ $rc -eq 0 ] } ``` ### Technical Analysis When `ensurepip` is unavailable, the wrappers download the current `get-pip.py` payload from an external URL and immediately execute it. The downloaded content is not checked against a pinned cryptographic digest or authenticated signature. HTTPS protects ordinary network transport, and the configured URL is the official PyPA bootstrap domain. However, the effective payload remains mutable after the Skill has been reviewed. A compromise of the upstream artifact, hosting infrastructure, certificate trust path, DNS environment, or locally configured proxy could substitute executable Python code. The risk is increased by `X_HTTP_PROXY` support elsewhere in the Skill and by the standard proxy environment variables inherited by `curl`, `wget`, and Python networking. A malicious or compromised trusted pro ...[truncated 1669 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (27)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 49)May include surrounding context.

若将凭证保存在当前目录的 .env 文件中,请先将其载入环境:

bash
set -a && . ./.env && set +a

可选:若网络无法直连 X API,请设置 X_HTTP_PROXY。

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.zh-CN.md (reported line 49)May include surrounding context.

若将凭证保存在当前目录的 .env 文件中,请先将其载入环境:

bash
set -a && . ./.env && set +a

可选:若网络无法直连 X API,请设置 X_HTTP_PROXY。

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

若将凭证保存在当前目录的 .env 文件中,请先将其载入环境:

bash
set -a && . ./.env && set +a

可选:若网络无法直连 X API,请设置 X_HTTP_PROXY。

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/x_publisher.py (reported line 52)May include surrounding context.

python
若将凭证保存在当前目录的 `.env` 文件中,请先将其载入环境:

```bash
set -a && . ./.env && set +a
```

可选:若网络无法直连 X API,请设置 `X_HTTP_PROXY`。

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description understates or misstates behavior by omitting thread/reply posting and CLI/stdin input mechanisms, while also claiming media support that may not be implemented in the referenced code path. Misleading capability descriptions are dangerous because agents and users may authorize the skill for a narrow task, while it can perform broader or different public-posting actions than expected.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 30)May include surrounding context.

md
---
name: X (Twitter) Publisher
description: Publish tweets to X (Twitter) using the official Tweepy library. Supports text-only tweets, tweets with images or videos, and returns detailed publish results including tweet ID and URL. Requires X API credentials (API Key, API Secret, Access Token, Access Token Secret).
env:
  - X_API_KEY
  - X_API_SECRET

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 31)May include surrounding context.

md
---
name: X (Twitter) Publisher
description: Publish tweets to X (Twitter) using the official Tweepy library. Supports text-only tweets, tweets with images or videos, and returns detailed publish results including tweet ID and URL. Requires X API credentials (API Key, API Secret, Access Token, Access Token Secret).
env:
  - X_API_KEY
  - X_API_SECRET

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.zh-CN.md (reported line 30)May include surrounding context.

md
---
name: X (Twitter) Publisher
description: Publish tweets to X (Twitter) using the official Tweepy library. Supports text-only tweets, tweets with images or videos, and returns detailed publish results including tweet ID and URL. Requires X API credentials (API Key, API Secret, Access Token, Access Token Secret).
env:
  - X_API_KEY
  - X_API_SECRET

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.zh-CN.md (reported line 31)May include surrounding context.

md
---
name: X (Twitter) Publisher
description: Publish tweets to X (Twitter) using the official Tweepy library. Supports text-only tweets, tweets with images or videos, and returns detailed publish results including tweet ID and URL. Requires X API credentials (API Key, API Secret, Access Token, Access Token Secret).
env:
  - X_API_KEY
  - X_API_SECRET

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
---
name: X (Twitter) Publisher
description: Publish tweets to X (Twitter) using the official Tweepy library. Supports text-only tweets, tweets with images or videos, and returns detailed publish results including tweet ID and URL. Requires X API credentials (API Key, API Secret, Access Token, Access Token Secret).
env:
  - X_API_KEY
  - X_API_SECRET

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
---
name: X (Twitter) Publisher
description: Publish tweets to X (Twitter) using the official Tweepy library. Supports text-only tweets, tweets with images or videos, and returns detailed publish results including tweet ID and URL. Requires X API credentials (API Key, API Secret, Access Token, Access Token Secret).
env:
  - X_API_KEY
  - X_API_SECRET

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
---
name: X (Twitter) Publisher
description: Publish tweets to X (Twitter) using the official Tweepy library. Supports text-only tweets, tweets with images or videos, and returns detailed publish results including tweet ID and URL. Requires X API credentials (API Key, API Secret, Access Token, Access Token Secret).
env:
  - X_API_KEY
  - X_API_SECRET

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · CLAUDE.md (reported line 59)May include surrounding context.

md
- `SKILL.md` frontmatter declares the required `env:` vars; these are what the skill loader expects to be populated in the environment before the script runs.
- `references/x_api.md` is a demand-loaded reference (Tweepy methods, error codes, rate limits) — consult it when extending API usage rather than re-deriving from scratch.
- Tweet text >280 chars is truncated to 277 + `"...publish"` (not a clean cut). If you change truncation, update the "Tweet length" note in `SKILL.md`.
- The `wait_a_while()` tail (10s sleep) is intentional in `x_publisher.py` — do not remove it without checking the skill's runtime expectations.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README gives direct publish commands for tweets and threads but does not prominently warn that these actions post immediately to the user's real X account and may create public, irreversible content. In an agent-skill context, unclear disclosure increases the chance of accidental posting, especially when an automated tool executes examples or user requests without an explicit confirmation step.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill declares access to environment-backed credentials, shell wrappers, and outbound network use, but does not define an explicit tool scope such as allowed-tools or permissions. That increases the chance an agent or operator invokes it with broader capabilities than intended, especially since it can post publicly to X and access secrets from the environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This skill performs irreversible public actions on a social media account, but the documentation does not place a prominent warning and confirmation requirement before execution. In agent settings, that omission can lead to accidental publication, reputational harm, or unintended disclosure because posting is externally visible and not easily undone.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

When ensurepip is unavailable, the wrapper downloads get-pip.py over the network and immediately executes it. That creates a supply-chain and network-trust risk: a compromised mirror, TLS interception, or hostile environment could cause execution of attacker-controlled code before the skill runs.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a skill for publishing tweets, but this wrapper accepts a .py filename argument and will run that script instead of the expected entrypoint. That general script-launcher capability is broader than what is justified for a dedicated X/Twitter publisher skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The wrapper downloads get-pip.py from the network and immediately executes it inside the virtual environment when ensurepip is unavailable. This creates a code execution path based on remote content and transport trust; if the download source, TLS trust chain, proxy, or local network path is compromised, arbitrary Python code can run during skill startup.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest describes a skill whose purpose is publishing tweets to X, but this wrapper accepts a .py filename argument and runs that alternate script instead of the default X publisher entrypoint. That general script-launching capability is broader than what is justified by a single-purpose tweet publishing skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

文件标题和全文内容均固定为中文说明,但未声明这是可选的本地化文档、也未给用户提供语言选择或适用范围说明。根据语言/地区策略,强制单一语言且缺少用户选择时可构成自然语言层面的策略问题。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description limits the skill to publishing tweets with optional media and returning publish results, but this README documents additional behaviors: thread publishing, explicit credential verification, reading thread content from standard input, proxy configuration, and self-bootstrapping execution wrappers. These are real code-facing capabilities and operational behaviors not reflected in the manifest description, creating a mild description-to-behavior mismatch.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

This markdown file documents a destructive operation via client.delete_tweet("tweet_id") but does not include any warning that deletion affects posted content and may be irreversible from the user's perspective. For markdown files, omissions of warnings about actions affecting user data or system integrity should be flagged.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The dependency is specified as tweepy>=4.14 without an upper bound or exact pin, so builds are not reproducible and may silently pull in newer releases with security or breaking changes. In a publishing skill that handles X API credentials and sends outbound content, unexpected dependency changes can introduce supply-chain risk or operational failures.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
tweepy>=4.14

Unverifiable Dependency: tweepy has 2 known advisory(ies) (CVE-2012-5825 (Tweepy does not verify SSL Certificate ); CVE-2012-5825 (Tweepy does not verify that the server hostname matches a domain name in the sub)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.