Back to skill

Security audit

Twitter Cli

Security checks for vulnerabilities and agentic risk

Overview

This Twitter/X skill is coherent as an account automation tool, but it asks for and automatically extracts powerful session credentials in ways users should review carefully before installing.

Install only if you are comfortable giving an agent access equivalent to your logged-in Twitter/X browser session. Avoid the remote-agent full-cookie copy/paste workflow, prefer a local isolated environment, restrict the browser profile with `TWITTER_CHROME_PROFILE`, do not use untrusted proxies, and review write actions before allowing the agent to post, delete, follow, like, or retweet.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:65
Finding

Skill instructs remote agents to request complete Twitter session cookies through chat

Content
View full analysis
我需要你的 Twitter 登录凭证。请按以下步骤获取: > > 1. 用 Chrome/Edge/Firefox 打开 https://x.com(确保已登录) > 2. 按 `F12` 打开开发者工具 → **Network** 标签 > 3. 在页面上刷新,点击任意 `x.com` 请求 > 4. 找到 **Request Headers** → **Cookie:** 这一行,右键 → 复制值 > 5. 把完整 Cookie 字符串发给我 > > ⚠️ Cookie 包含登录信息,请不要分享给其他人。 Then extract and set env vars: ```bash FULL_COOKIE="" export TWITTER_AUTH_TOKEN=$(echo "$FULL_COOKIE" | grep -oE 'auth_token=[a-f0-9]+' | cut -d= -f2) export TWITTER_CT0=$(echo "$FULL_COOKIE" | grep -oE 'ct0=[a-f0-9]+' | cut -d= -f2) twitter whoami ``` ``` This conflicts with the later safety instruction: ```markdown - Do not ask users to share raw cookie values in chat logs. - Prefer local browser cookie extraction over manual secret copy/paste. - Agent should treat cookie values as secrets (do not echo to stdout unnecessarily). ``` ### Technical Analysis A complete authenticated Twitter/X Cookie header is a reusable session credential. The Skill explicitly tells a cloud or remote agent to ask the user to paste this credential into the conversation. The cookie can consequently enter chat history, model-provider infrastructure, agent traces, shell histories, telemetry, or tool logs. The warning not to share the cookie with others does not mitigate the exposure because the preceding instruction specifically asks the user to disclose it to the agent. The instruction also contradicts the Skill's own safety notes. Requesting the entire Cookie header exceeds the minimum privileges required. The implementation supports local browser extraction and authentication with the narrower `auth_token` and `ct0` values. ### Attack Path 1. A remot ...[truncated 1088 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
twitter_cli/auth.py:157
Finding

Browser extraction collects and forwards every Twitter-domain cookie

Content
View full analysis
Optional[Dict[str, str]]: """Extract Twitter cookies from a cookie jar.""" result: Dict[str, str] = {} all_cookies: Dict[str, str] = {} twitter_cookie_count = 0 for cookie in jar: domain = cookie.domain or "" if _is_twitter_domain(domain): twitter_cookie_count += 1 if cookie.name == "auth_token": result["auth_token"] = cookie.value elif cookie.name == "ct0": result["ct0"] = cookie.value if cookie.name and cookie.value: all_cookies[cookie.name] = cookie.value if "auth_token" in result and "ct0" in result: cookies = {"auth_token": result["auth_token"], "ct0": result["ct0"]} if all_cookies: cookies["cookie_string"] = "; ".join("%s=%s" % (k, v) for k, v in all_cookies.items()) logger.info("Extracted %d total cookies for full browser fingerprint", len(all_cookies)) return cookies ``` The subprocess extraction path repeats the same behavior: ```python def extract_from_jar(jar, name, profile=""): result = {} all_cookies = {} for cookie in jar: domain = cookie.domain or "" if domain.endswith(".x.com") or domain.endswith(".twitter.com") or domain in ("x.com", "twitter.com", ".x.com", ".twitter.com"): if cookie.name == "auth_token": result["auth_token"] = cookie.value elif cookie.name == "ct0": result["ct0"] = cookie.value if cookie.name and cookie.value: all_c ...[truncated 2485 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
twitter_cli/auth.py:499
Finding

Authentication fallback downloads and executes an unpinned dependency at runtime

Content
View full analysis
=0.19`, but that lower-bound constraint does not provide reproducible or immutable resolution. The fallback command is even less restrictive because it does not provide a version constraint at all. ### Attack Path 1. The CLI runs in an environment where `browser_cookie3` cannot be imported. 2. The in-process or initial subprocess extraction reports that the package is missing. 3. The fallback invokes `uv run --with browser-cookie3`. 4. `uv` resolves and downloads the package and its dependencies from the configured package index. ...[truncated 959 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
.github/workflows/publish-clawhub.yml:54
Finding

ClawHub publishing disables TLS certificate validation while transmitting a bearer token

Content
View full analysis
{ const ext = f.rel.split(".").pop().toLowerCase(); return ["md","txt","py","toml","yml","yaml","json","cfg","ini","sh","bat"].includes(ext); }); const payload = JSON.stringify({ slug, displayName: slug, version, changelog: "Release " + version, tags: ["latest"], acceptLicenseTerms: true, }); ...[truncated 3388 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (105)

YARA rule 'info_stealer': Information stealer patterns (credential harvesting, browser data theft) [malware]

High
Category
YARA Match
Confidence
95% confidence
Finding

The README endorses automatic scanning of browser profiles and forwarding of all Twitter cookies, which matches credential-access and info-stealer-like behavior even if the stated purpose is account automation rather than malware. In an AI skill context, this is especially dangerous because the skill is designed for automated use and combines credential extraction with anti-detection guidance, increasing the likelihood of silent account compromise or misuse if integrated without strict controls.

Content

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

json twitter delete 1234567890 twitter like 1234567890 twitter like 1234567890 --yaml twitter unlike 1234567890 twitter retweet 1234567890 twitter unretweet 1234567890 twitter bookmark 1234567890 twitter unbookmark 1234567890 twitter follow elonmusk --json

text

### Authentication

twitter-cli uses this auth priority:

1. **Environment variables**: `TWITTER_AUTH_TOKEN` + `TWITTER_CT0`
2. **Browser cookies** (recommended): auto-extract from Arc/Chrome/Edge/Firefox/Brave

Browser extraction is recommended — it forwards ALL Twitter cookies (not just `auth_token` + `ct0`) and aligns request headers with your local runtime, which is closer to normal browser traffic than minimal cookie auth.

**Chrome multi-profile**: All Chrome profiles are scanned automatically. To specify a profile:

```bash
TWITTER_CHROME_PROFILE="Profile 2" twitter feed

After loading cookies, the CLI performs lightweight verification. Commands that require account access fail fast on clear auth errors (401/403).

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

The README provides instructions to unlock macOS Keychain and grant Terminal persistent access to browser safe-storage entries so the tool can decrypt and extract cookies. In context, this meaningfully lowers protections around local credential stores and could broaden access to sensitive browser secrets beyond this tool, especially in shared, remote, or agent-driven environments.

Content

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

bash
    security unlock-keychain ~/Library/Keychains/login.keychain-db
    ```
  - **Local terminal**: Open **Keychain Access** → search for **"\<Browser\> Safe Storage"** → **Access Control** → add your Terminal app → **Save Changes**.
  - Or click **"Always Allow"** when the Keychain authorization popup appears.

- `Twitter API error 404`

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Although parts of this finding overreach, the material point is valid: the declared high-level Twitter skill does not clearly disclose that it accesses live Twitter/X sessions via local browser cookies. Hidden dependence on local authenticated browser state materially raises the risk of unintended secret access and account misuse in an agent context.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The instruction to use this skill for ALL Twitter/X operations is overly broad and encourages automatic invocation for both benign reads and sensitive account-modifying actions. In context, that broad trigger is more dangerous because the skill also handles credentials and can perform destructive or reputation-affecting operations.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly instructs the agent to solicit the user's full Twitter session cookie string through chat and parse authentication secrets from it. Session cookies are effectively account credentials; collecting them in chat can expose them to logs, intermediaries, model context, or future misuse, enabling full account compromise.

Content

No source excerpt is available for this finding.

YARA rule 'info_stealer': Information stealer patterns (credential harvesting, browser data theft) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · tests/test_auth.py (reported line 354)May include surrounding context.

python
le to get key for cookie decryption"]
    hint = auth._diagnose_keychain_issues(diagnostics)

    assert hint is not None
    assert "SSH session detected" in hint
    assert "security unlock-keychain" in hint


def test_diagnose_keychain_issues_returns_none_for_unrelated_errors() -> None:
    """Should return None when diagnostics don't mention Keychain."""
    diagnostics = ["chrome[Default]=no-cookies", "firefox: profile not found"]
    hint = auth._diagnose_keychain_issues(diagnostics)

    assert hint is None


def test_get_cookies_includes_keychain_hint_in_error(monkeypatch) -> None:
    """When extraction fails with Keychain errors, error msg should contain the hint."""
    monkeypatch.setattr("sys.platform", "darwin")
    monkeypatch.setenv("SSH_CLIENT", "1.2.3.4 54321 22")
    monkeypatch.setattr(auth, "load_from_env", lambda: None)
    monkeypatch.setattr(
        auth,
        "extract_from_browser",
        lambda: (None, ["arc: Unable to get key for cookie decryption"]),

Credential Access

High
Category
Privilege Escalation
Confidence
99% confidence
Finding

The file advertises fallback behavior that extracts browser cookies and relies on macOS Keychain access to decrypt them. Accessing keychain-protected browser secrets for session reuse is direct credential access and can enable full account takeover if misused.

Content

Scanner excerpt · twitter_cli/auth.py (reported line 7)May include surrounding context.

python
1. Environment variables: TWITTER_AUTH_TOKEN + TWITTER_CT0
2. Auto-extract from browser via browser-cookie3
   Extracts ALL Twitter cookies for full browser-like fingerprint.
   Prefers in-process extraction (required on macOS for Keychain access),
   falls back to subprocess if in-process fails (e.g. SQLite lock).
"""

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 · tests/test_auth.py (reported line 326)May include surrounding context.

python
# ---------------------------------------------------------------------------
# Keychain / environment diagnostics
# ---------------------------------------------------------------------------

_KEYCHAIN_ERROR_KEYWORDS = (

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 · tests/test_auth.py (reported line 336)May include surrounding context.

python
# ---------------------------------------------------------------------------
# Keychain / environment diagnostics
# ---------------------------------------------------------------------------

_KEYCHAIN_ERROR_KEYWORDS = (

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 · tests/test_auth.py (reported line 353)May include surrounding context.

python
# ---------------------------------------------------------------------------
# Keychain / environment diagnostics
# ---------------------------------------------------------------------------

_KEYCHAIN_ERROR_KEYWORDS = (

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 · tests/test_auth.py (reported line 361)May include surrounding context.

python
# ---------------------------------------------------------------------------
# Keychain / environment diagnostics
# ---------------------------------------------------------------------------

_KEYCHAIN_ERROR_KEYWORDS = (

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 · twitter_cli/auth.py (reported line 34)May include surrounding context.

python
# ---------------------------------------------------------------------------
# Keychain / environment diagnostics
# ---------------------------------------------------------------------------

_KEYCHAIN_ERROR_KEYWORDS = (

Static analysis

No suspicious patterns detected.