Back to skill

Security audit

twit-mcp

Security checks for vulnerabilities and agentic risk

Overview

This skill is built for Twitter/X automation, but it handles account session cookies and wallet-funded requests in ways users should review carefully before installing.

Install only if you are comfortable giving this MCP server a funded wallet key and connecting a Twitter/X account whose session cookies will be stored locally and used for remote write actions. Use a dedicated low-balance wallet, avoid a high-value X account, review API_BASE, and clear or revoke the X session after use.

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 (3)

other

Error
Location
src/index.ts:379
Finding

Reusable X/Twitter Session Credentials Are Transmitted to an External Service

Content
View full analysis
{ const creds = loadCredentials(); if (!creds?.authToken || !creds?.ct0) { return { content: [{ type: 'text' as const, text: 'No Twitter account connected. Use connect_twitter to authenticate first.', }], }; } const res = await fetchWithPayment(`${API_BASE}/tweets`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text, auth_token: creds.authToken, ct0: creds.ct0, ...(in_reply_to_tweet_id && { in_reply_to_tweet_id }), ...(quote_tweet_id && { quote_tweet_id }), }), }); if (!res.ok) { const err = await res.text(); throw new Error(`API error ${res.status}: ${err}`); } const data = await res.json(); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }] }; }, ``` Most other write actions place the credentials directly in URL query parameters: ```ts const params = new URLSearchParams({ id, auth_token: creds.authToken, ct0: creds.ct0 }); const res = await fetchWithPayment(`${API_BASE}/tweets/retweet?${params}`, { method: 'POST' }); ``` The destination can also be changed through an environment variable: ```ts const API_BASE = process.env.API_BASE ?? 'https://x402.twit.sh'; ``` ### Technical Analysis The `connect_twitter` tool extracts the `auth_token` and `ct0` cookies from an authenticated X browser session. Subsequent write tools load these credentials and transmit them to `x402.twit.sh`, or to any alternative destination configured through `API_BASE`. The `au ...[truncated 2570 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/auth.ts:34
Finding

X/Twitter Session Credentials Are Stored in a Plaintext File Without Enforced Restrictive Permissions

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:11
Finding

Documented Installation Executes an Unpinned Mutable npm Package

Content
View full analysis
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
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (63)

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

The skill explicitly stores reusable Twitter authentication credentials locally in a known path, which is a credential-access risk if the host is compromised, multi-user, backed up insecurely, or monitored by other software. This is more dangerous in context because the same skill also encourages configuring a wallet private key in environment variables, so compromise of the MCP runtime or host could expose both payment authority and social-account control.

Content

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

md
3. The agent confirms connection and saves credentials locally
4. Ask the agent to post or delete tweets — no restart needed

Credentials are stored in `~/.twit-mcp-credentials.json` (macOS/Linux) or `C:\Users\<you>\.twit-mcp-credentials.json` (Windows).

## How It Works

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented account-connection flow and local credential management introduce materially different risks than a simple micropayment-backed data API. In the context of a social-media automation skill, extraction/storage of session material and hidden destructive actions make the skill more dangerous because compromise could directly affect a user's social account and reputation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented account-connection flow and local credential management introduce materially different risks than a simple micropayment-backed data API. In the context of a social-media automation skill, extraction/storage of session material and hidden destructive actions make the skill more dangerous because compromise could directly affect a user's social account and reputation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented account-connection flow and local credential management introduce materially different risks than a simple micropayment-backed data API. In the context of a social-media automation skill, extraction/storage of session material and hidden destructive actions make the skill more dangerous because compromise could directly affect a user's social account and reputation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The documented account-connection flow and local credential management introduce materially different risks than a simple micropayment-backed data API. In the context of a social-media automation skill, extraction/storage of session material and hidden destructive actions make the skill more dangerous because compromise could directly affect a user's social account and reputation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented account-connection flow and local credential management introduce materially different risks than a simple micropayment-backed data API. In the context of a social-media automation skill, extraction/storage of session material and hidden destructive actions make the skill more dangerous because compromise could directly affect a user's social account and reputation.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

The skill explicitly stores Twitter credentials in a local file under the user's home directory. Credential material stored on disk is a high-value target: if read by another local process, malware, backup leak, or accidental exposure, an attacker could hijack the connected X/Twitter account and perform unauthorized actions.

Content

Scanner excerpt · SKILL.md (reported line 95)May include surrounding context.

md
1. Call `connect_twitter` — a Chrome window will open at x.com
2. The user logs in if prompted
3. Once confirmed, credentials are saved locally to `~/.twit-mcp-credentials.json`
4. Write actions are available immediately — no restart needed

If a write action is requested and no account is connected, call `connect_twitter` first and wait for confirmation before proceeding.

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

This code defines a fixed credential file path in the user's home directory for Twitter authentication material, signaling deliberate local storage of sensitive account tokens. Because these tokens enable authenticated actions such as posting, liking, retweeting, bookmarking, and following, unauthorized local access could directly result in account takeover or misuse.

Content

Scanner excerpt · dist/auth.js (reported line 4)May include surrounding context.

js
import { homedir } from 'os';
import { join } from 'path';
import { readFileSync, writeFileSync, existsSync } from 'fs';
const CREDENTIALS_FILE = join(homedir(), '.twit-mcp-credentials.json');
export function loadCredentials() {
    // 1. Check env vars (set by client config on startup — backward compat)
    const authToken = process.env.TWITTER_AUTH_TOKEN;

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill places sensitive auth_token and ct0 values in URL query parameters for remote requests. Query strings are commonly exposed in logs, browser history, proxies, APM tooling, and intermediary infrastructure, making credential leakage much more likely than if secrets were sent in headers or protected bodies.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

This portion of the skill implements credential access by harvesting Twitter session cookies from the browser and persisting them for reuse. While likely intended to enable posting features rather than steal secrets, it still handles high-value credentials that could be abused for account actions if exposed.

Content

Scanner excerpt · dist/index.js (reported line 489)May include surrounding context.

js
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
});
// ── Twitter auth ──────────────────────────────────────────────────────────────
server.tool('connect_twitter', 'Connect your Twitter/X account by opening a browser window. Logs in via x.com and stores session cookies locally for posting tweets. Credentials are saved to ~/.twit-mcp-credentials.json.', {}, async () => {
    const browser = await chromium.launch({
        headless: false,
        channel: 'chrome',

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest omits that the skill launches a browser for interactive login, extracts Twitter session cookies, and stores them locally for later reuse. In this context, undisclosed credential capture and persistence is security-relevant because it materially changes the trust model from simple API usage to local session-token handling.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code captures auth_token and ct0 session cookies from x.com and saves them to disk, which are highly sensitive bearer-style credentials. In a social-media skill, this is especially dangerous because possession of those cookies can enable account actions and possible account takeover behavior if the local file or downstream service is compromised.

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 · dist/index.js (reported line 531)May include surrounding context.

js
return {
        content: [{
                type: 'text',
                text: `Connected ${who} successfully. Credentials saved to ~/.twit-mcp-credentials.json — ready to use immediately.`,
            }],
    };
});

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 · dist/index.js (reported line 541)May include surrounding context.

js
return {
        content: [{
                type: 'text',
                text: `Connected ${who} successfully. Credentials saved to ~/.twit-mcp-credentials.json — ready to use immediately.`,
            }],
    };
});

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 · src/index.ts (reported line 777)May include surrounding context.

ts
return {
        content: [{
                type: 'text',
                text: `Connected ${who} successfully. Credentials saved to ~/.twit-mcp-credentials.json — ready to use immediately.`,
            }],
    };
});

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 · src/index.ts (reported line 793)May include surrounding context.

ts
return {
        content: [{
                type: 'text',
                text: `Connected ${who} successfully. Credentials saved to ~/.twit-mcp-credentials.json — ready to use immediately.`,
            }],
    };
});

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · package.json (reported line 4)May include surrounding context.

json
{
  "name": "twit-mcp",
  "version": "1.4.0",
  "description": "X/Twitter data MCP server powered by x402 micropayments. Pay per request in USDC on Base.",
  "type": "module",
  "main": "dist/index.js",
  "bin": "dist/index.js",
  "scripts": {
    "dev": "tsx src/index.ts",
    "build": "tsc",
    "start": "node dist/index.js",
    "prepublishOnly": "yarn build"
  },
  "keywords": [
    "mcp",
    "x402",
    "twitter",
    "x",
    "ai-agents",
    "usdc",
    "base"
  ],
  "repository": {
    "type": "git",
    "url": "git+https://github.com/etherlect/twit-mcp.git"
  },
  "license": "MIT",
  "engines": {
    "node": ">=20"
  },
  "depende

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

The hardcoded path to .twit-mcp-credentials.json indicates deliberate local credential storage for sensitive Twitter session material. Because these credentials enable authenticated social-media actions, compromise of the file can directly lead to unauthorized posting, follows, likes, or account takeover-like session abuse; the skill context makes this more dangerous because it advertises write actions and may be installed by users expecting only micropayment-based access.

Content

Scanner excerpt · src/auth.ts (reported line 5)May include surrounding context.

ts
import { join } from 'path';
import { readFileSync, writeFileSync, existsSync } from 'fs';

const CREDENTIALS_FILE = join(homedir(), '.twit-mcp-credentials.json');

export type TwitterCredentials = {
  authToken: string;

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The retweet action places auth_token and ct0 into URL query parameters before sending them to the remote API. Query strings are commonly logged by clients, proxies, servers, observability tooling, browser history, and exception traces, so this materially increases the chance of Twitter session-token leakage and account compromise.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The like action transmits Twitter session credentials in URL parameters to a third-party endpoint. Because these are reusable session tokens, leakage through logs or intermediaries can let an attacker perform authenticated actions as the user.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The follow action sends stored Twitter session credentials via query parameters to an external service. In the context of a social-media action tool, this is especially risky because compromise of these tokens enables broad impersonation and abuse of the connected Twitter account beyond just following users.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The unfollow action also serializes Twitter session credentials into the request URL, exposing them to logging and monitoring layers. These tokens are sufficient to authenticate account actions, so disclosure can escalate to account hijacking or unauthorized content actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The bookmark action includes reusable Twitter session cookies in query parameters sent to the external API. The danger is not the bookmark itself but the exposure of bearer-like session material that can be replayed by anyone who obtains it.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This unbookmark action repeats the same pattern of sending auth_token and ct0 in the URL. Because URL-based secret exposure is pervasive across infrastructure logs and traces, the pattern is a systemic credential-leak risk rather than an isolated implementation detail.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The unlike action forwards Twitter session credentials through URL parameters to a remote service. Any leak of these values can permit authenticated actions on the user's Twitter account, making the confidentiality failure much more severe than the nominal action suggests.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
dist/index.js:511

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
src/index.ts:749