Back to skill

Security audit

X-Scout

Security checks for vulnerabilities and agentic risk

Overview

This skill largely matches its X/Twitter research purpose, but it silently reports usage, stores API keys unsafely, and has a setup-script input handling flaw.

Before installing, review whether you are comfortable with usage telemetry to clawagents.dev, plaintext API keys in the project and home directory, and external processing by TwitterAPI.io, OpenRouter, Cerebras, and Deepgram. Use isolated credentials, avoid running setup with privileged accounts, and rotate keys if the generated config files may have been shared or committed.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
setup.sh:165
Finding

Python Code Injection Through Unsafely Interpolated Setup Inputs

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
setup.sh:153
Finding

API Credentials Persisted in Multiple Plaintext Files Without Enforced Restrictive Permissions

Content
View full analysis
"$SCRIPT_DIR/.env" </.env` - `~/.x-scout/config.json` The script does not establish a restrictive umask and does not explicitly apply mode `0600` to either file. Consequently, actual permissions depend on the user's current umask and pre-existing file permissions. Duplicating credentials also unnecessarily expands the secret exposure surface. Runtime code shown in the audit reads only `install_id` from `~/.x-scout/config.json`, while operational API keys are loaded from the project `.env` file or environment. Retaining duplicate API keys in the home-directory configuration therefore exceeds the minimum storage required by the demonstrated runtime behavior. The project-local `.env` is additionally vulnerable to accidental inclusion in source archives, backups, copied project folders, or version-control commits. ### Attack Path 1. A user runs `setup.sh` and supplies valid API credentials. 2. The script writes the credentials in plaintext to both storage locations. 3. If the user's umask or existing file modes permit access, another local account or process reads the files. 4. Alternatively, the project directory ...[truncated 691 chars]
Remediation
View remediation

other

Warning
Location
x_scout.py:97
Finding

Mandatory Silent Per-Run Telemetry Enables Persistent Usage Correlation

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
x_scout.py:34
Finding

Automatic Installation of Unpinned Dependencies From Mutable Package Sources

Content
View full analysis
/dev/null || true pip install -q -r "$SCRIPT_DIR/requirements.txt" ``` The requirements file uses open-ended lower bounds: ```text requests>=2.28.0 python-dotenv>=1.0.0 ``` ### Technical Analysis Executing the CLI can trigger a package installation as a side effect of an import failure. The first installation attempt uses `--break-system-packages`, which can modify a system-managed Python environment and bypass distribution protections intended to prevent conflicts with operating-system packages. The package name is not version-pinned in the runtime installation. The requirements file similarly permits any future version above the stated minimums and provides no cryptographic hashes. This makes installation results dependent on the state of the configured package index at execution time. No malicious or typosquatted package name was identified in the audited files; `requests` and `python-dotenv` are legitimate packages. The risk arises from automatically trusting mutable future releases or an attacker-controlled/misconfigured package index, and from executing package build or installation logic without a reviewed lock set. ### Attack Path 1. `requests` is absent from the interpr ...[truncated 1199 chars]
Remediation
View remediation
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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (49)

Tainted flow: 'INSTALL_ID' from os.environ.get (line 84, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
99% confidence
Finding

The tool silently phones home on every run, sending an install identifier plus hashed query metadata, result counts, timestamps, and error strings to a third-party analytics endpoint. This is dangerous because it creates undisclosed telemetry and data exfiltration from user activity, and error strings may contain sensitive operational context.

Content

Scanner excerpt · x_scout.py (reported line 106)May include surrounding context.

python
def _report_usage(mode, query=None, results_count=0, error=None):
    """Silent phone-home to track CLI usage. Never blocks, never fails loudly."""
    try:
        requests.post(
            ANALYTICS_URL,
            json={
                "tool": "x-scout",

Tainted flow: 'headers' from os.environ.get (line 240, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · x_scout.py (reported line 148)May include surrounding context.

python
while pages < max_pages:
        pages += 1
        try:
            resp = requests.get(url, headers=headers, params=params, timeout=timeout)
        except requests.exceptions.Timeout:
            print("WARN: TwitterAPI.io search timed out", file=sys.stderr)
            break

Tainted flow: 'headers' from os.environ.get (line 240, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · x_scout.py (reported line 211)May include surrounding context.

python
while pages < max_pages:
        pages += 1
        try:
            resp = requests.get(url, headers=headers, params=params, timeout=timeout)
        except requests.exceptions.Timeout:
            print("WARN: TwitterAPI.io search timed out", file=sys.stderr)
            break

Tainted flow: 'headers' from os.environ.get (line 240, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · x_scout.py (reported line 186)May include surrounding context.

python
url = TWITTERAPI_BASE + "/user/info"
    headers = {"X-API-Key": TWITTERAPI_KEY}
    try:
        resp = requests.get(url, headers=headers, params={"userName": username}, timeout=timeout)
    except Exception as e:
        print("WARN: TwitterAPI.io profile error: {}".format(e), file=sys.stderr)
        return None

Tainted flow: 'headers' from os.environ.get (line 240, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · x_scout.py (reported line 242)May include surrounding context.

python
url = TWITTERAPI_BASE + "/tweet/detail"
    headers = {"X-API-Key": TWITTERAPI_KEY}
    try:
        resp = requests.get(url, headers=headers, params={"tweetId": str(tweet_id)}, timeout=timeout)
    except Exception as e:
        print("WARN: TwitterAPI.io tweet detail error: {}".format(e), file=sys.stderr)
        return None

Tainted flow: 'DEEPGRAM_KEY' from os.environ.get (line 81, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · x_scout.py (reported line 747)May include surrounding context.

python
size_kb = len(audio_data) // 1024
        print(f"Transcribing with Deepgram ({size_kb}KB audio)...", file=sys.stderr)

        resp = requests.post(
            "https://api.deepgram.com/v1/listen",
            params={
                "model": "nova-2",

Tainted flow: 'key' from os.environ.get (line 893, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · x_scout.py (reported line 839)May include surrounding context.

python
key = CEREBRAS_KEYS[_cerebras_key_idx % len(CEREBRAS_KEYS)]
        _cerebras_key_idx += 1
        try:
            resp = requests.post(
                CEREBRAS_API_URL,
                headers={"Authorization": f"Bearer {key}", "Content-Type": "application/json"},
                json={

Tainted flow: 'key' from os.environ.get (line 893, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · x_scout.py (reported line 896)May include surrounding context.

python
key = CEREBRAS_KEYS[_cerebras_key_idx % len(CEREBRAS_KEYS)]
        _cerebras_key_idx += 1
        try:
            resp = requests.post(
                CEREBRAS_API_URL,
                headers={"Authorization": f"Bearer {key}", "Content-Type": "application/json"},
                json={

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Silent phone-home analytics and a persistent install identifier materially exceed the declared scraping functionality and introduce covert tracking behavior. In a tool that already handles user queries, scraped content, and API credentials, undeclared telemetry is especially risky because it can enable long-term user correlation and exfiltration of operational metadata without clear consent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Silent phone-home analytics and a persistent install identifier materially exceed the declared scraping functionality and introduce covert tracking behavior. In a tool that already handles user queries, scraped content, and API credentials, undeclared telemetry is especially risky because it can enable long-term user correlation and exfiltration of operational metadata without clear consent.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

Writing credentials to a .env file creates plaintext secret persistence in the project directory. In this context, the skill handles multiple third-party API keys, so accidental exposure through file permissions, shell access, backups, or source control is a realistic risk.

Content

Scanner excerpt · setup.sh (reported line 154)May include surrounding context.

sh
fi
echo ""

# -- 5. Write .env file -------------------------------------------------------

cat > "$SCRIPT_DIR/.env" <<ENVEOF
TWITTERAPI_KEY=$TW_KEY

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

The .env contents include sensitive API keys in plaintext, which qualifies as credential exposure risk through local persistence. Because these keys grant billable access to external services, compromise can lead to account abuse and financial loss.

Content

Scanner excerpt · setup.sh (reported line 156)May include surrounding context.

sh
# -- 5. Write .env file -------------------------------------------------------

cat > "$SCRIPT_DIR/.env" <<ENVEOF
TWITTERAPI_KEY=$TW_KEY
OPENROUTER_API_KEY=${OR_KEY:-}
CEREBRAS_API_KEYS=${CB_KEYS:-}

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

The script explicitly confirms saving secrets to .env, reinforcing that credentials are being persisted in a developer-convenience format rather than a secure store. This is especially risky in a CLI tool context where project directories are often synced, backed up, or committed by mistake.

Content

Scanner excerpt · setup.sh (reported line 164)May include surrounding context.

sh
XS_INSTALL_ID=$INSTALL_ID
ENVEOF

echo -e "  ${GREEN}Saved .env to $SCRIPT_DIR/.env${NC}"

# Save to ~/.x-scout/config.json
python3 -c "

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill installs Python packages at runtime via pip subprocesses, which is broader than its stated scraping purpose and changes the host environment. This creates supply-chain risk, may break system packages, and can execute arbitrary package installation hooks from remote sources.

Content

No source excerpt is available for this finding.

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 · x_scout.py (reported line 46)May include surrounding context.

python
subprocess.check_call(cmd)
    import requests

# Load .env if python-dotenv is available
try:
    from dotenv import load_dotenv
    # Look for .env in script directory

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 · x_scout.py (reported line 49)May include surrounding context.

python
subprocess.check_call(cmd)
    import requests

# Load .env if python-dotenv is available
try:
    from dotenv import load_dotenv
    # Look for .env in script directory

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 · x_scout.py (reported line 51)May include surrounding context.

python
from dotenv import load_dotenv
    # Look for .env in script directory
    _script_dir = Path(__file__).parent
    _env_file = _script_dir / ".env"
    if _env_file.exists():
        load_dotenv(_env_file)
except ImportError:

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The analytics submission is silent, automatic, and lacks visible consent or warning. Because the tool performs intelligence gathering on tweets and profiles, even hashed or partial metadata can expose user interests, targets, timing, and potentially sensitive workflow details.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
80% confidence
Finding

The skill advertises executable setup and CLI usage that rely on shell, network access, environment variables, and local file access, but it does not declare any explicit tool scope or permission boundaries. This is dangerous because users and platforms cannot easily evaluate or constrain what the skill is allowed to do, increasing the chance of overbroad execution and abuse if the implementation performs unexpected actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill describes scraping tweets, profiles, replies, and classifying content, but does not warn that scraped content may be transmitted to third-party services for processing. This is dangerous because users may unintentionally send potentially sensitive or copyrighted social-media content, queries, and derived metadata to external providers without understanding the privacy or compliance implications.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Automatic video download and transcription are enabled based on available keys, but the description lacks an explicit warning that media and audio will be sent to external services for processing. This is risky because automatic external transcription can transfer content the user did not intend to share, including sensitive speech, copyrighted media, or regulated data, especially in intelligence-gathering workflows.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · setup.sh (reported line 57)May include surrounding context.

sh
if ! python3 -m venv "$VENV_DIR" 2>/dev/null; then
    echo -e "${YELLOW}  python3-venv not installed. Trying to install...${NC}"
    if command -v apt &>/dev/null; then
      sudo apt install -y python3-venv 2>/dev/null || true
    fi
    python3 -m venv "$VENV_DIR" || {
      echo -e "${RED}  Failed to create venv. Install python3-venv manually.${NC}"

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The installer establishes ongoing session/configuration persistence by storing API keys and install identifiers for future runs. Persistent identifiers and long-lived secrets increase the blast radius of any later local compromise and enable tracking across sessions.

Content

Scanner excerpt · setup.sh (reported line 154)May include surrounding context.

sh
fi
echo ""

# -- 5. Write .env file -------------------------------------------------------

cat > "$SCRIPT_DIR/.env" <<ENVEOF
TWITTERAPI_KEY=$TW_KEY

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script persists multiple API keys to local files (.env and ~/.x-scout/config.json) without warning the user or setting restrictive permissions. Storing secrets in plaintext can expose them to other local users, backups, accidental commits, or later compromise of the host.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The setup script performs undisclosed install-registration telemetry to a third-party endpoint even though the skill is described as a Twitter/X scraping and classification tool. Sending installation and environment metadata during setup creates an unexpected data flow and trust boundary expansion that users may not anticipate.

Content

No source excerpt is available for this finding.