Back to skill

Security audit

Twitter API Integration (Web Reversed)

Security checks for vulnerabilities and agentic risk

Overview

This Twitter/X tool needs review because it bundles embedded login credentials and account-security and payment capabilities beyond its advertised tasks.

Prefer a corrected release that removes embedded credentials and separates account administration and purchases from social automation. If proceeding, use a dedicated account, protect its session cookies, explicitly limit permitted actions and accounts, and avoid the bundled live-posting demo. Review profile-update defaults, verify mentions before responding, and manage saved account-data files. Owners should revoke any valid exposed credentials.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
twitter_api/demo_langchain_tools.py
Finding

Account session credentials are distributed in the demo source

Content
View full analysis

Impact

If the session remains valid, a recipient can impersonate the account for authenticated operations, including posting and other actions permitted by the session. This is a credential exposure, not evidence of deliberate credential theft.

T09 · Insecure Skill Coding Practices

Warning
Location
twitter_api/config/settings.py
Finding

Proxy-service authentication credentials are embedded in default configuration

Content
View full analysis

Impact

If valid, the credentials allow unauthorized proxy use, potentially consuming paid bandwidth or causing activity to be attributed to the credential owner's account.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (54)

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 37)May include surrounding context.

md
cd twitter-agent-skill
python -m venv .venv && .venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .env  # fill in your auth_token + ct0 values

# timeline + notification summaries
python scripts/timeline_summary.py

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 · twitter_api/api/timeline_service.py (reported line 316)May include surrounding context.

python
print("-" * 40)

def _load_dotenv(env_path: Optional[os.PathLike] = None) -> None:
    """Load .env from path or search from cwd for .env (e.g. social_ops/.env)."""
    if env_path and os.path.isfile(env_path):
        path = env_path
    else:

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 · twitter_api/api/timeline_service.py (reported line 316)May include surrounding context.

python
print("-" * 40)

def _load_dotenv(env_path: Optional[os.PathLike] = None) -> None:
    """Load .env from path or search from cwd for .env (e.g. social_ops/.env)."""
    if env_path and os.path.isfile(env_path):
        path = env_path
    else:

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 · twitter_api/core/client.py (reported line 127)May include surrounding context.

python
if __name__ == "__main__":
    import asyncio
    import os
    # Load .env from cwd
    cwd = os.path.abspath(os.getcwd())
    for path in [os.path.join(cwd, ".env"), os.path.join(cwd, "social_ops", ".env")]:
        if os.path.isfile(path):

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 · twitter_api/post_tweet.py (reported line 68)May include surrounding context.

python
e = errs[0]
            msg = e.get("message") or (e.get("extensions") or {}).get("message") or str(e)
            if "226" in msg or "automated" in msg.lower():
                msg += " — Try setting GANCLAW_X_PROXY_URL in .env (same network as account)."
            return False, msg
        import json
        return False, "No tweet in response: " + json.dumps(result, default=str)[:300]

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied chunk implements profile and account administration rather than the listed timeline, notification, posting, and follow operations. Password changes and phone-number removal are particularly material security-sensitive capabilities not disclosed by the description. Profile and DM-setting modifications also extend beyond the stated scope. In addition, update_profile_details always submits a default birthday and visibility settings unless overridden, and update_profile_settings submits DM receipt and quality-filter changes alongside the username. Cookie authentication and local image reads/uploads support these operations and are not independently suspicious. Endpoint definitions and client internals are not supplied, so destination details cannot be verified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Subscription and billing operations are materially distinct from the declared social-account automation features. In particular, create_subscription submits payment-related data to a subscription-creation endpoint, an undeclared financial capability. This method is exposed but is not invoked by the direct-run demonstration, which only checks subscription status. Loading local authentication cookies is consistent with the declared cookie-based toolkit and is not itself a mismatch. The supplied chunk does not establish whether a subscription request succeeds or incurs a charge.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The code's primary capability is direct messaging, which is materially distinct from the listed timeline, notification, posting, and follow operations. It submits message text to a direct-message creation endpoint using the supplied client. Identity lookup and optional interaction recording support that capability rather than establishing separate mismatches. The chunk does not show how cookie authentication is implemented.

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 · scripts/fetch_notifications.py (reported line 9)May include surrounding context.

python
from twitter_api.twitter import Twitter

BASE = Path(__file__).parent
ENV_PATH = BASE / '.env'
OUT_PATH = BASE / 'notifications_raw.json'

def load_env(path: Path) -> None:

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/follow_account.py (reported line 21)May include surrounding context.

python
def load_env() -> None:
    cwd = os.path.abspath(os.getcwd())
    for path in [os.path.join(cwd, ".env"), os.path.join(cwd, "social_ops", ".env")]:
        if os.path.isfile(path):
            with open(path, "r", encoding="utf-8") as f:
                for line in f:

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/follow_account.py (reported line 21)May include surrounding context.

python
def load_env() -> None:
    cwd = os.path.abspath(os.getcwd())
    for path in [os.path.join(cwd, ".env"), os.path.join(cwd, "social_ops", ".env")]:
        if os.path.isfile(path):
            with open(path, "r", encoding="utf-8") as f:
                for line in f:

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/post_custom_tweet.py (reported line 20)May include surrounding context.

python
def load_env():
    cwd = os.path.abspath(os.getcwd())
    for path in [os.path.join(cwd, ".env"), os.path.join(cwd, "social_ops", ".env")]:
        if os.path.isfile(path):
            with open(path, "r", encoding="utf-8") as f:
                for line in f:

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/post_custom_tweet.py (reported line 20)May include surrounding context.

python
def load_env():
    cwd = os.path.abspath(os.getcwd())
    for path in [os.path.join(cwd, ".env"), os.path.join(cwd, "social_ops", ".env")]:
        if os.path.isfile(path):
            with open(path, "r", encoding="utf-8") as f:
                for line in f:

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 · twitter_api/api/subscription.py (reported line 71)May include surrounding context.

python
import asyncio
    import os
    cwd = os.path.abspath(os.getcwd())
    for path in [os.path.join(cwd, ".env"), os.path.join(cwd, "social_ops", ".env")]:
        if os.path.isfile(path):
            with open(path, "r", encoding="utf-8") as f:
                for line in f:

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 · twitter_api/api/subscription.py (reported line 71)May include surrounding context.

python
import asyncio
    import os
    cwd = os.path.abspath(os.getcwd())
    for path in [os.path.join(cwd, ".env"), os.path.join(cwd, "social_ops", ".env")]:
        if os.path.isfile(path):
            with open(path, "r", encoding="utf-8") as f:
                for line in f:

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 · twitter_api/api/tweet.py (reported line 473)May include surrounding context.

python
import os
    import sys
    cwd = os.path.abspath(os.getcwd())
    for path in [os.path.join(cwd, ".env"), os.path.join(cwd, "social_ops", ".env")]:
        if os.path.isfile(path):
            with open(path, "r", encoding="utf-8") as f:
                for line in f:

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 · twitter_api/api/tweet.py (reported line 473)May include surrounding context.

python
import os
    import sys
    cwd = os.path.abspath(os.getcwd())
    for path in [os.path.join(cwd, ".env"), os.path.join(cwd, "social_ops", ".env")]:
        if os.path.isfile(path):
            with open(path, "r", encoding="utf-8") as f:
                for line in f:

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 · twitter_api/api/user.py (reported line 698)May include surrounding context.

python
import os
    import sys
    cwd = os.path.abspath(os.getcwd())
    for path in [os.path.join(cwd, ".env"), os.path.join(cwd, "social_ops", ".env")]:
        if os.path.isfile(path):
            with open(path, "r", encoding="utf-8") as f:
                for line in f:

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 · twitter_api/api/user.py (reported line 698)May include surrounding context.

python
import os
    import sys
    cwd = os.path.abspath(os.getcwd())
    for path in [os.path.join(cwd, ".env"), os.path.join(cwd, "social_ops", ".env")]:
        if os.path.isfile(path):
            with open(path, "r", encoding="utf-8") as f:
                for line in f:

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/timeline_summary.py (reported line 15)May include surrounding context.

python
from twitter_api.twitter import Twitter

ENV_PATH = BASE_DIR / '.env'
RAW_PATH = BASE_DIR / 'timeline_raw.json'
SUMMARY_PATH = BASE_DIR / 'timeline_summary.txt'

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/timeline_summary.py (reported line 65)May include surrounding context.

python
auth = os.environ.get('GANCLAW_X_PRIMARY_AUTH_TOKEN')
    ct0 = os.environ.get('GANCLAW_X_PRIMARY_CT0')
    if not auth or not ct0:
        raise SystemExit("Missing GANCLAW_X_PRIMARY_AUTH_TOKEN or GANCLAW_X_PRIMARY_CT0 in .env or environment")

    twitter = Twitter(auth, ct0)

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 · twitter_api/post_all_accounts.py (reported line 27)May include surrounding context.

python
return


# One proxy for all: set GANCLAW_X_PROXY_URL in .env (optional)
PROXY_URL_ENV = "GANCLAW_X_PROXY_URL"

# (label, auth_env, ct0_env) for each account

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 · twitter_api/post_tweet.py (reported line 11)May include surrounding context.

python
import os
import sys

# One proxy for all accounts (optional): set GANCLAW_X_PROXY_URL in .env
PROXY_URL_ENV = "GANCLAW_X_PROXY_URL"

# (auth_env, ct0_env)

Account password changes and phone removal exceed the social-automation purpose.

High
Category
Excessive Agency
Confidence
98% confidence
Finding

In twitter_api/api/profile.py, L252-L268 implement password replacement, and L270-L277 implement removal of the account's phone number. These account-security and recovery mutations are not necessary for timeline, notification, posting, follow, or DM automation and are not explicitly declared in the skill manifest.

Content

No source excerpt is available for this finding.

Paid subscription creation is unjustified by the declared automation workflows.

High
Category
Excessive Agency
Confidence
98% confidence
Finding

In twitter_api/api/subscription.py, L33-L52 accept a payment-method identifier and POST a request to create a subscription, defaulting to premium. Initiating a paid subscription is a billing capability, not an implementation requirement of timeline, notifications, posting, follow operations, or the documented DM client.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.