Back to skill

Security audit

X Profile Deep Dive

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent X/Twitter profile-analysis purpose, but it needs review because it uses Twitter cookies through an unpinned third-party dependency and stores scraped profile/network data persistently.

Install only if you are comfortable giving this skill access to Twitter/X cookies and letting a third-party Python package use them. Prefer a dedicated low-privilege X account, pin and review the tweety-ns dependency before use, keep cookie/session files private, and understand that generated reports may retain full tweets, profile details, and social-network information locally.

Vulnerability Patterns
  • 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
  • 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 (1)

T08 · Insecure Dependencies

Warning
Location
README.md:31
Finding

Unpinned Third-Party Dependency Receives Reusable X Authentication Cookies

Content
View full analysis

Vulnerability Details

File Locations:

  • README.md:17
  • README.md:31-35
  • scripts/tweety_utils.py:12-33

Vulnerability Type: Unverified supply-chain dependency with access to sensitive authentication material
Risk Level: Medium

Complete Code Snippets

From README.md:17:

markdown
- tweety-ns library (`pip3 install tweety-ns`)

From README.md:31-35:

markdown
2. Install dependencies:
   ```bash
   pip3 install tweety-ns
  1. Set up Twitter cookies at <WORKSPACE>/config/twitter_cookies.json
text

From `scripts/tweety_utils.py:12-33`:

```python
def load_cookies_file(cookies_path):
    """Load cookies dict from a JSON file."""
    if not os.path.exists(cookies_path):
        sys.stderr.write(f"Error: cookie file not found: {cookies_path}\n")
        sys.exit(1)
    with open(cookies_path, "r", encoding="utf-8") as f:
        return json.load(f)


def create_app(session_dir):
    """Create a tweety Twitter client with session storage."""
    from tweety import Twitter

    os.makedirs(session_dir, exist_ok=True)
    session_path = os.path.join(session_dir, "tw_session")
    return Twitter(session_path)


def login_app(app, cookies_dict):
    """Login to Twitter via cookies. Exits on failure."""
    try:
        app.load_cookies(cookies_dict)
    except Exception as e:
        sys.stderr.write(f"Error: login failed: {e}\n")
        sys.exit(2)

Technical Analysis

The installation instructions use pip3 install tweety-ns without an exact version pin, lock file, package hash, or documented provenance check. The imported tweety package subsequently executes in the Agent's Python process and receives reusable X/Twitter authentication cookies through app.load_cookies(cookies_dict).

Authenticated X access is necessary for the declared profile-analysis functionality. However, allowing the latest mutable release of an unverified dependency to process authentication cookies creates a supply-chain trust boundary ...[truncated 2381 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin an exact reviewed package version

    • Replace the floating installation command with an exact approved version, such as tweety-ns==X.Y.Z.
    • Update the version only after reviewing release changes.
  2. Enforce cryptographic integrity

    • Maintain a locked requirements file containing hashes.
    • Install with pip install --require-hashes -r requirements.txt.
    • Pin and hash transitive dependencies as well as the direct dependency.
  3. Document and verify provenance

    • Record the expected package index, upstream repository, maintainer identity, and reviewed source revision.
    • Configure installation to use an explicitly trusted package index rather than unspecified or user-controlled indexes.
    • Consider building and hosting an internally reviewed wheel.
  4. Reduce credential scope

    • Use a dedicated X account for analysis instead of cookies from a primary account.
    • Grant only the minimum account capabilities required for read-only profile collection where the platform permits it.
    • Rotate cookies after suspected dependency compromise and avoid long-lived sessions.
  5. Isolate dependency execution

    • Run collection in a dedicated virtual environment or sandbox.
    • Restrict filesystem access to the cookie file, output directory, and required session directory.
    • Apply outbound-network controls so the process can communicate only with necessary X endpoints.
    • Do not expose unrelated workspace secrets or credentials to the process.
  6. Protect session material

    • Create cookie and session files with restrictive owner-only permissions.
    • Validate that the configured paths do not point to shared or attacker-controlled directories.
    • Avoid logging cookie values and sanitize dependency exceptions before exposing them to broader logs.
  7. Prefer a supported, least-privilege interface

    • Where practical, use an official, narrowly scoped, read-only API credential instead ...[truncated 29 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (13)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README explicitly promotes collecting tweets, followings, followers, and using Twitter/X authentication cookies, but it provides no privacy, consent, retention, or safe-handling guidance. In a skill designed to profile individuals and map social networks, this omission increases the risk of unauthorized surveillance, misuse of session cookies, and inappropriate processing of potentially sensitive account and relationship data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The README explicitly says the skill generates 'Chinese-language profile reports,' which imposes a specific output language. There is no indication that the user can opt into another language or choose their preferred locale, so this is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill requires access to environment state, local files, file writes, and networked scraping, but it does not declare any explicit tool scope or allowed-tools boundary. That creates an authorization ambiguity where an agent may invoke broader capabilities than the user expects, increasing the chance of unintended data access, cookie use, or filesystem modification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs use of Twitter cookies and authenticated scraping/session material but does not require a clear user-facing warning that personal session credentials will be used to access third-party content. This can lead to users unknowingly exposing account-linked browsing context, authenticated data access, or violating their own privacy expectations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill is described as X/Twitter profile analysis, but the workflow expands into opening and evaluating external blogs, newsletters, Medium/Substack pages, and comparing off-platform content. This broadens the trust boundary and can cause the agent to fetch and analyze unrelated third-party sites without clear user consent, increasing privacy, tracking, and data-exposure risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The line explicitly states '中文输出' and marks '全中文报告' as a passing requirement, which imposes a specific language choice. This is a natural-language policy concern because the file does not mention user opt-in or a documented region-specific justification for forcing Chinese output.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says this skill performs deep analysis of X/Twitter profiles by using tweety-ns plus Twitter cookies to collect tweets, followings, and followers. This file instead documents a different behavior: browser page-flipping, web_search supplementation, and web_fetch of blogs, explicitly noting no API access and limited data, which does not match the claimed implementation scope.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The evaluation assertions are framed around the intended skill behavior of using tweety-ns and structured tweet data, yet the evidence explicitly says tweety-ns was not known to be installed and browser snapshots were used instead. This creates an intent-versus-actual-execution contradiction within the file itself about what the skill run was supposed to be doing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This file contains instructional content exclusively in Chinese, including the title, workflow steps, and notes, with no indication that users may choose another language. The policy explicitly calls for flagging language or locale constraints when a specific language is effectively forced without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template explicitly requires tweet summaries to be written in Chinese ("中文") and the surrounding headings/content are also fixed in Chinese. This imposes a language policy on generated output without offering user opt-in or explaining a region-specific requirement, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The workflow instructs the agent to modify or add content to local knowledge files beyond the core generated profile output, which extends the skill's write scope from analysis into persistent workspace curation. Unnecessary persistent writes increase the risk of contaminating local knowledge bases, creating unintended side effects, or storing scraped data more broadly than expected.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill directs the agent to write scraped profile data and derived analysis into persistent workspace files without explicitly warning that this data will remain stored locally. Persisting third-party profile content, tweets, and social graph details can create an unexpected local privacy footprint and retention risk for the user or organization.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The text explicitly states '输出:中文报告' and later reinforces '明确说中文分析报告', which imposes a specific language choice in natural-language instructions. Under the policy, forcing a language without user opt-in is a locale/language policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.