Back to skill

Security audit

X (Twitter) Hot Topics

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly aligned with fetching X/Twitter results, but its runtime installer can execute mutable third-party code and has unsafe virtualenv cleanup behavior that users should review before installing.

Review this skill before installing. It needs an X bearer token and will send search terms derived from your prompt to X/Twitter. More importantly, its first-run setup may install changing Python packages and can execute a downloaded pip bootstrap script; avoid running it under privileged accounts, avoid setting SKILL_VENV_DIR to any important directory, and prefer a version with pinned dependencies and safer setup logic.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T03 · Remote Payload Retrieval and Execution

Warning
Location
scripts/x_hots:44
Finding

Mutable Remote Bootstrap Script Is Downloaded and Executed Without Integrity Verification

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 launcher retrieves the current `get-pip.py` payload from an external URL and immediately executes it. Although the URL belongs to the official Python Packaging Authority bootstrap service and HTTPS provides transport protection, the script does not pin a specific artifact or verify a cryptographic hash or signature. Consequently, the effective executable payload can change after the Skill has been reviewed. The code that ultimately runs is not fully represented by the audited project contents. This is a supply-chain execution path rather than evidence that the current Skill intentionally exfiltrates data. ### Attack Path 1. The Skill runs on a system where the newly created virtual environment lacks a working `ensurepip`. 2. `bootstrap_pip` downloads the current `get-pip.py` from the remote bootstrap service. 3. The launcher performs no expected-hash or signature verification. 4. A compromised upstream artifact, distribution system, or trusted endpoint supplies modified Python code. 5. The launcher executes the downloaded payload using the virtu ...[truncated 558 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unbounded Tweepy Dependency Contradicts Documented Version Pinning

Content
View full analysis
=4.14 ``` Supporting statement in `SKILL.md`: ```markdown Both are handled automatically: the `scripts/x_hots` entrypoint wrapper creates an isolated virtualenv at `/.venv` on first run and installs `requirements.txt` (which pins `tweepy`) into it. ``` ### Technical Analysis The requirement `tweepy>=4.14` does not pin Tweepy to a reviewed version. It allows `pip` to select any current or future compatible release, along with a potentially changing set of transitive dependencies. This contradicts the documentation's assertion that Tweepy is pinned. Because the launcher automatically installs the requirement at runtime, two installations of the same Skill version can receive materially different dependency code. A future compromised, malicious, or incompatible package release could therefore become part of the Skill without any change to the audited repository. ### Attack Path 1. A newer Tweepy release or affected transitive dependency becomes available from the configured Python package index. 2. The Skill runs without an existing requirements stamp or after the requirements file changes. 3. The wrapper executes `pip install -r requirements.txt`. 4. The `>=4.14` constraint permits installation of the newer unreviewed release. 5. Package installation or later import executes code from that release within the Skill process. ### Impact Assessment Dependency code runs with the same privileges as the Skill. A compromised dependency could access the X bearer token passed to Tweepy, inspect other process-accessible environment variables and files, alter API requests or results, make unauthorized network requests, or modify user-writable data. This finding does not e ...[truncated 139 chars]
Remediation
View remediation
`. - Lock all transitive dependencies to exact versions. - Generate and verify package hashes, and install with `pip --require-hashes`. - Use a controlled package index or an internally mirrored repository where possible. - Add automated dependency scanning and a deliberate review process for lock-file updates. - Correct `SKILL.md` so its pinning claim accurately reflects the dependency configuration. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/x_hots:17
Finding

Unvalidated Virtual-Environment Path Can Cause Recursive Deletion of Unrelated Data

Content
View full analysis
&2 PYBIN="$(pick_python)" || die "no suitable Python interpreter found (need >= 3.7)" echo "[wrapper] using interpreter: $PYBIN" >&2 if ! "$PYBIN" -m venv "$VENV_DIR" 1>&2; then # venv module present but ensurepip missing (e.g. no python3.11-venv). rm -rf "$VENV_DIR" "$PYBIN" -m venv --without-pip "$VENV_DIR" 1>&2 \ || die "venv creation failed (python: $PYBIN)" fi fi ``` ### Technical Analysis `SKILL_VENV_DIR` is accepted directly from the process environment without canonicalization, ownership checks, an approved-root restriction, or confirmation that it refers to a directory created by this launcher. If standard virtual-environment creation fails, the wrapper executes `rm -rf "$VENV_DIR"`. Shell quoting prevents argument splitting and option injection, but it does not prevent a valid absolute or relative path from identifying an unrelated directory. Therefore, a misconfigured or attacker-influenced environment variable can direct recursive deletion at arbitrary data writable by the invoking user. ### Attack Path 1. An attacker who can influence the Skill's launch environment sets `SKILL_VENV_DIR` to an existing writable directory containing unrelated data. 2. The selected directory does not contain an executable `bin/python`, causing the virtual-environment creation branch to run. 3. The first `python -m venv` invocation fails, for example because `ensurepip` is unavailable or because of another environment-specific error. 4. The failure handler executes `rm -rf "$VENV_DIR"`. 5. All writable contents un ...[truncated 774 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented behavior claims user-interest analysis, domain classification, trending-topic retrieval, and summarization, but the described implementation only runs keyword searches over recent tweets. This mismatch can mislead users and orchestrators into trusting outputs as richer or broader than they are, causing privacy, correctness, and policy issues when the skill is auto-selected for requests it does not actually handle safely.

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 · SKILL.md (reported line 22)May include surrounding context.

Environment Variables

Only the Bearer Token is required. The script uses app-only (OAuth 2.0) auth, which is sufficient for the search_recent_tweets endpoint and has broader search access than OAuth 1.0a user credentials — so the consumer key/secret and access token/secret are not needed.

bash
export X_BEARER_TOKEN="***"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill invokes shell execution, accesses environment variables, and performs network requests, but it does not declare any tool scope or permission boundaries. This makes the operational trust boundary implicit, increasing the risk of over-broad execution and unintended access to secrets or external services when the skill is activated.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill does not clearly warn users that their inferred interests or derived search terms will be sent to X's API. Because the workflow explicitly derives keywords from natural-language input and transmits them off-system, users may unknowingly disclose sensitive interests, topics, or contextual details to a third party.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The activation criteria are broad enough to match many generic user requests about trends or hot topics, which increases the chance of unintended invocation. In combination with network access and external query transmission, this can cause unnecessary data sharing and overuse of an external API without clear user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The notes state that the skill defaults to English tweets (lang:en) and requires script modification for other languages. This imposes a language/locale constraint by default rather than offering the user a choice or opt-in, which is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest says the skill will analyze user interests from natural language, retrieve top hot topics per domain, and summarize background, key opinions, and controversies. In contrast, this file only accepts a prebuilt list of query strings, calls X recent tweet search, and returns tweet metadata/text without any interest analysis, domain selection, topic ranking, or summarization.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The query unconditionally appends lang:en, which restricts output to English regardless of user intent. This is a natural-language policy concern because the skill imposes a language constraint without offering opt-in or explaining a region-specific need.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified as tweepy>=4.14 without an upper bound or exact pin, so installs are not reproducible and may silently pull newer releases with security regressions or breaking behavior. In a network-facing skill that fetches external content from X/Twitter, dependency drift increases supply-chain risk and makes security review of the actual installed package version unreliable.

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
85% confidence
Finding

The manifest references tweepy without pinning an exact version, and historical advisories exist for this package involving SSL/hostname verification weaknesses. Because the installed version is not fixed, it is impossible to determine from this file alone whether deployment could resolve to an affected release, which creates uncertainty around transport security for API communications.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The module docstring presents the script as an 'X Hot Topics Fetcher' that fetches 'recent hot tweets,' which implies direct hot-topic/trending retrieval. The implementation does not access any trending-topics endpoint or compute hotness; it only searches recent tweets for caller-provided queries using search_recent_tweets with relevancy sorting.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.