Back to skill

Security audit

X

Security checks for vulnerabilities and agentic risk

Overview

This X integration needs review because its downloaded code and weak local-server checks could put your account credentials and other running programs at risk.

Review before installing. Seek a version that verifies downloaded code and dependencies, protects runtime state in a private per-user directory, authenticates the local server, and verifies process identity before termination. The skill stores OAuth credentials locally and can publish or delete posts; approve each exact write action and use read-only access when sufficient. The artifacts support implementation concerns, not intentional credential theft.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/local_http_invoke.py
Finding

Attacker-controlled shared runtime state can redirect authenticated calls to a counterfeit local server

Content
View full analysis

Impact

The counterfeit service can receive the victim's X access token and requested tool arguments, and return attacker-controlled tool responses. A captured token can permit X API access within its granted scopes and validity. This does not establish disclosure of the refresh token or client secret.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (16)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The description emphasizes searching and reading. Although 'work with' is broad, it does not clearly disclose the account-modifying capabilities explicitly included in DEFAULT_ALLOWLIST: createPosts and deletePosts. Those capabilities materially extend the advertised read/search scope. Downloading upstream sources, installing dependencies, caching files, forwarding authentication, and exposing a health endpoint are supporting implementation details rather than separate mismatches. The supplied code configures these tools; their implementation resides in the downloaded upstream server.

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 · SKILL.md (reported line 70)May include surrounding context.

md
- `MAVERICK_X_MCP_EXPIRES_IN`
- `MAVERICK_X_MCP_REFRESH_TOKEN_EXPIRES_AT`

mcporter refreshes expired X access tokens through X's OAuth2 token endpoint before calling the local XMCP server. If calls keep returning HTTP 401 after retry, the OAuth grant has likely been revoked or expired; reconnect the integration.

## Data flow

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/local_http_invoke.py (reported line 284)May include surrounding context.

python
stamp = state / "last-used"
    _touch(stamp)
    env = os.environ.copy()
    env["MCPORTER_CONFIG"] = str(config_path)
    completed = subprocess.run(["mcporter", *args.mcporter_args], env=env, check=False)
    _touch(stamp)

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

python
"MCP_PORT": str(port),
    }
    lines = [f"{key}={value}" for key, value in values.items()]
    (xmcp_dir / ".env").write_text("\n".join(lines) + "\n", encoding="utf-8")
    return values

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/server.py (reported line 239)May include surrounding context.

python
python = _ensure_venv(xmcp_dir)
    values = _write_env_file(xmcp_dir, host=args.host, port=args.port)

    child_env = os.environ.copy()
    child_env.update(values)
    server_entry = xmcp_dir / "server.py"
    os.chdir(xmcp_dir)

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

The wrapper executes server.py downloaded from a mutable master branch without verifying its provenance or expected digest, and subsequently trusts the cached file. The patch checks only recognize text fragments and markers, not the safety or integrity of the whole program. Compromise of the upstream source or an attacker-writable cache could therefore run arbitrary code, with access to inherited environment secrets and bearer tokens handled by this X integration.

Content

Scanner excerpt · scripts/server.py (reported line 243)May include surrounding context.

python
child_env.update(values)
    server_entry = xmcp_dir / "server.py"
    os.chdir(xmcp_dir)
    os.execve(str(python), [str(python), str(server_entry)], child_env)


if __name__ == "__main__":

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · mcporter.json (reported line 20)May include surrounding context.

json
"deletePosts"
      ],
      "refresh": {
        "tokenEndpoint": "https://api.x.com/2/oauth2/token",
        "clientIdEnv": "MAVERICK_X_MCP_CLIENT_ID",
        "clientSecretEnv": "MAVERICK_X_MCP_CLIENT_SECRET",
        "clientAuthMethod": "client_secret_basic",

Server processes can be forcibly terminated without disclosure.

Medium
Category
Output Handling
Confidence
94% confidence
Finding

Terminating an idle local server is legitimate, but the wrapper signals a PID read from disk without verifying that it still identifies the server it launched. Stale PID reuse, or tampering with state in a pre-created predictable temporary directory, can cause SIGTERM and SIGKILL to target an unrelated process that the wrapper has permission to signal.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/local_http_invoke.py (reported line 148)May include surrounding context.

python
"--port",
        str(port),
    ]
    process = subprocess.Popen(
        command,
        stdout=log_handle,
        stderr=subprocess.STDOUT,

Tainted flow: 'log_handle' from os.environ.get (line 137, credential/environment) → subprocess.Popen (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/local_http_invoke.py (reported line 148)May include surrounding context.

python
"--port",
        str(port),
    ]
    process = subprocess.Popen(
        command,
        stdout=log_handle,
        stderr=subprocess.STDOUT,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/local_http_invoke.py (reported line 218)May include surrounding context.

python
def _spawn_reaper(state: Path, pid: int, timeout_seconds: int) -> None:
    if timeout_seconds <= 0:
        return
    subprocess.Popen(
        [
            sys.executable,
            __file__,

Tainted flow: 'state' from os.environ.get (line 293, credential/environment) → subprocess.Popen (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/local_http_invoke.py (reported line 218)May include surrounding context.

python
def _spawn_reaper(state: Path, pid: int, timeout_seconds: int) -> None:
    if timeout_seconds <= 0:
        return
    subprocess.Popen(
        [
            sys.executable,
            __file__,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/local_http_invoke.py (reported line 286)May include surrounding context.

python
_touch(stamp)
    env = os.environ.copy()
    env["MCPORTER_CONFIG"] = str(config_path)
    completed = subprocess.run(["mcporter", *args.mcporter_args], env=env, check=False)
    _touch(stamp)
    timeout = int(
        os.environ.get(

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
96% confidence
Finding

The subprocess call uses argument arrays rather than a shell, so it does not demonstrate shell injection. However, its callers automatically run pip against requirements downloaded from a mutable upstream master branch without a trusted integrity check or enforced package hashes; compromised upstream content or dependencies could execute code with the user's privileges. Installing inside a virtual environment does not sandbox that execution.

Content

Scanner excerpt · scripts/server.py (reported line 48)May include surrounding context.

python
def _run(command: list[str], *, cwd: Path | None = None, env: dict[str, str] | None = None) -> None:
    subprocess.run(command, cwd=cwd, env=env, check=True)


def _download(url: str, destination: Path) -> None:

Tainted flow: 'command' from os.environ.get (line 200, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/server.py (reported line 48)May include surrounding context.

python
def _run(command: list[str], *, cwd: Path | None = None, env: dict[str, str] | None = None) -> None:
    subprocess.run(command, cwd=cwd, env=env, check=True)


def _download(url: str, destination: Path) -> None: