Back to skill

Security audit

hxl-code-reviewer

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent MCP development guide, but its evaluation harness can expose credentials and sensitive tool data unless used carefully.

Install only if you are comfortable using it in a controlled development environment. Run dependency installation and MCP evaluations in a virtual environment or container, pin dependencies before use, avoid passing real secrets in command-line arguments, use narrowly scoped test credentials, and do not run the evaluator against MCP servers that expose write/destructive tools or sensitive production data unless you have isolated and reviewed the report output path.

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

T08 · Insecure Dependencies

Warning
Location
scripts/requirements.txt:1
Finding
Unpinned third-party dependencies and package execution<![CDATA[ ## Vulnerability Details **File Location**: `scripts/requirements.txt:1-2`; related instructions at `SKILL.md:140-141` and `reference/evaluation.md:387-392` **Vulnerability Type**: Unpinned dependencies and execution of dynamically resolved packages **Risk Level**: Medium ### Complete Code Snippet ```text anthropic>=0.39.0 mcp>=1.1.0 ``` Related execution instructions: ```bash npm run build npx @modelcontextprotocol/inspector ``` ```bash pip install -r scripts/requirements.txt ``` Or: ```bash pip install anthropic mcp ``` ### Technical Analysis The Python dependency declarations use unrestricted lower bounds rather than exact, reviewed versions. No lock file or package hashes are supplied. Consequently, an installation performed at different times can resolve to materially different dependency versions. The documented `npx @modelcontextprotocol/inspector` command similarly resolves and may download a package version at execution time without identifying an audited version. This creates a mutable supply-chain boundary: code that executes during installation or evaluation is not necessarily the code that existed when the Skill was reviewed. A compromised dependency release, malicious transitive dependency, or unexpectedly incompatible future release could be installed. Python source distributions may execute build-system code during installation, while installed dependencies execute in the evaluation harness when imported. An `npx`-resolved package executes under the invoking user's account. No evidence indicates that the currently named packages are malicious. The vulnerability is the absence of deterministic dependency controls. ### Attack Path 1. An attacker compromises a future release of a direct or transitive dependency, or gains control of its publication channel. 2. A user follows the Skill's documented `pip install` or unversioned `npx` command. 3. The package manager resolves the compromised release because no exact version and in ...[truncated 848 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace open-ended dependency ranges with exact, reviewed versions. 2. Generate and commit a reproducible lock file. 3. Use package hashes, such as a hash-locked requirements file installed with `pip --require-hashes`. 4. Pin the Inspector command to a reviewed version, for example: ```bash npx --yes @modelcontextprotocol/inspector@<reviewed-version> ``` 5. Review and constrain transitive dependencies through a lock-file workflow. 6. Run package installation and evaluation inside an isolated virtual environment or container with minimal filesystem, credential, and network access. 7. Enable automated dependency vulnerability monitoring, but require review before updating locked versions. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
reference/evaluation.md:437
Finding
Sensitive credentials accepted through command-line arguments<![CDATA[ ## Vulnerability Details **File Location**: `reference/evaluation.md:437-470` and `reference/evaluation.md:565-569`; implemented by `scripts/evaluation.py:329-353` **Vulnerability Type**: Exposure of secrets through process arguments and shell history **Risk Level**: Medium ### Complete Code Snippet The documentation instructs users to provide credentials directly as command-line values: ```bash python scripts/evaluation.py \ -t stdio \ -c python \ -a my_mcp_server.py \ -e API_KEY=abc123 \ -e DEBUG=true \ evaluation.xml ``` ```bash python scripts/evaluation.py \ -t sse \ -u https://example.com/mcp \ -H "Authorization: Bearer token123" \ -H "X-Custom-Header: value" \ evaluation.xml ``` ```bash python scripts/evaluation.py \ -t http \ -u https://example.com/mcp \ -H "Authorization: Bearer token123" \ evaluation.xml ``` The evaluation harness explicitly accepts these values as process arguments: ```python stdio_group.add_argument( "-e", "--env", nargs="+", help="Environment variables in KEY=VALUE format (stdio only)", ) remote_group.add_argument( "-H", "--header", nargs="+", dest="headers", help="HTTP headers in 'Key: Value' format (sse/http only)", ) headers = parse_headers(args.headers) if args.headers else None env_vars = parse_env_vars(args.env) if args.env else None ``` A complete workflow example also places a service token in an argument: ```bash python scripts/evaluation.py \ -t stdio \ -c python \ -a github_mcp_server.py \ -e GITHUB_TOKEN=ghp_xxx \ -o github_eval_report.md \ my_evaluation.xml ``` ### Technical Analysis Command-line arguments are not an appropriate secret-delivery channel. Real API keys or bearer tokens entered using `-e` or `-H` may be retained in shell history, recorded by terminal or CI logging, included in diagnostic output, or exposed through operating-system process inspection where local permissions permit it. The parser stores these ...[truncated 1731 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove examples that place literal credentials in `-e` and `-H` arguments. 2. Prefer inherited environment variables for local-server credentials: ```bash export GITHUB_TOKEN python scripts/evaluation.py ... --env-name GITHUB_TOKEN ``` The CLI should accept the variable name rather than its secret value. 3. Add support for protected header files, environment-variable references, or secret-manager references for remote authorization headers. 4. Where interactive execution is appropriate, read sensitive values using a non-echoing prompt such as `getpass`, not ordinary command-line arguments. 5. Ensure secret files are restricted to the current user and never committed to source control. 6. Document shell-history cleanup and immediate token rotation for users who previously supplied real credentials in arguments. 7. Redact authorization headers and recognized secret fields from errors, reports, telemetry, and CI output. 8. Recommend narrowly scoped, short-lived credentials dedicated to evaluation rather than general-purpose production tokens. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The declared description frames the skill as a development guide, but the content also directs use of live MCP interactions, external fetches, file generation, and evaluation workflows that materially expand its operational behavior. This mismatch can mislead users and policy systems about the skill's actual capabilities, reducing scrutiny and making risky networked or file-writing actions more likely to be approved implicitly.

Ae1

High
Category
analysis-evasion
Content
- [⚡ TypeScript Guide](./reference/node_mcp_server.md) - TypeScript patterns and examples
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- [⚡ TypeScript Guide](./reference/node_mcp_server.md) - TypeScript patterns and examples
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- [⚡ TypeScript Guide](./reference/node_mcp_server.md) - TypeScript patterns and examples
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

External Model or Provider Selection

High
Category
Excessive Agency
Content
optional arguments:
  -h, --help            Show help message
  -t, --transport       Transport type: stdio, sse, or http (default: stdio)
  -m, --model           Claude model to use (default: claude-3-7-sonnet-20250219)
  -o, --output          Output file for report (default: print to stdout)

stdio options:
Confidence
90% confidence
Finding
Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Credential Access

High
Category
Privilege Escalation
Content
**OAuth 2.1**:
- Use secure OAuth 2.1 with certificates from recognized authorities
- Validate access tokens before processing requests
- Only accept tokens specifically intended for your server

**API Keys**:
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill instructs the agent to create projects, fetch external documentation, and create evaluation artifacts, but it does not declare any explicit tool scope such as allowed tools or permissions. In an agent environment, that ambiguity can lead to broader-than-necessary access to file writing and MCP-related capabilities, increasing the chance of unintended writes or connections when the skill is invoked.

Rp1

Medium
Category
MCP Rug Pull
Confidence
85% confidence
Finding
Using `npx @modelcontextprotocol/inspector` without a pinned version allows execution of whatever package version is current at runtime. That weakens reproducibility and creates a supply-chain risk: a compromised or breaking upstream release could execute unexpected code in the developer environment.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Content
After understanding the API and tools, USE the MCP server tools:
- Inspect content using READ-ONLY and NON-DESTRUCTIVE operations ONLY
- Goal: identify specific content (e.g., users, channels, messages, projects, tasks) for creating realistic questions
- Should NOT call any tools that modify state
- Will NOT read the code of the MCP server implementation itself
- Parallelize this step with individual sub-agents pursuing independent explorations
- Ensure each subagent is only performing READ-ONLY, NON-DESTRUCTIVE, and IDEMPOTENT operations
Confidence
80% confidence
Finding
Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

External Transmission

Medium
Category
Data Exfiltration
Content
mcp = FastMCP("example_mcp")

# Constants
API_BASE_URL = "https://api.example.com/v1"

# Enums
class ResponseFormat(str, Enum):
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
mcp = FastMCP("example_mcp")

# Constants
API_BASE_URL = "https://api.example.com/v1"

# Enums
class ResponseFormat(str, Enum):
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The resource example reads a local file path derived directly from a template parameter (`./docs/{name}`) without any path normalization, allowlisting, or warning about traversal risks. In a guide meant to be copied by developers building MCP servers, this can propagate insecure patterns that allow unauthorized local file disclosure if an attacker controls the resource name.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The stdio transport creates a connection by running a caller-supplied command and arguments, which is a shell/subprocess-like operation. In this file there is no confirmation prompt, logging, or explicit warning comment/docstring disclosing that an external process will be started.

Missing User Warnings

Medium
Confidence
83% confidence
Finding
The SSE and HTTP transports initiate outbound network connections using a supplied URL and optional headers, potentially transmitting user or system data. This file includes no confirmation, user-visible logging, or warning text describing that remote connections will be made.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The evaluation system prompt explicitly requires the model to include the inputs provided to each tool and the outputs received from each tool in the generated summary. If tools handle secrets, tokens, personal data, internal documents, or sensitive remote responses, that data will be copied into the evaluation output and potentially persisted to logs or report files. In an MCP evaluation harness, this is especially risky because the evaluated server may connect to arbitrary local or remote systems and return sensitive content.

Ssd 3

Medium
Confidence
99% confidence
Finding
The prompt instructs the model to reveal exact tool inputs and outputs in the summary, which creates a direct data exfiltration channel from tool execution into saved evaluation artifacts. Because tool inputs may contain user prompts, headers, credentials, or identifiers, and outputs may contain privileged remote data, this can leak sensitive information beyond its intended scope. In a tool-evaluation harness, the skill context makes this more dangerous because broad tool interoperability increases the chance of encountering confidential data.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
The script supports connecting to remote MCP servers over SSE/HTTP and then stores tool-call summaries/feedback in the final report, potentially transmitting questions and receiving data from external services. While transport options are documented, there is no explicit warning that remote evaluation may send task content to external endpoints and persist returned content in output files.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The guide prescribes that tools should default to markdown for human-readable output and structures output guidance around markdown versus JSON, without indicating that end users may choose another language or locale. While this is framed as formatting guidance rather than a hard locale restriction, it still imposes a language-specific presentation convention without explicit opt-in.

Unpinned Dependencies

Low
Category
Supply Chain
Content
anthropic>=0.39.0
mcp>=1.1.0
Confidence
98% confidence
Finding
The dependency specifier uses a lower-bound only (anthropic>=0.39.0), which makes builds non-reproducible and allows future installs to resolve to unexpected major or minor releases. In a security-sensitive agent skill that may interact with external services, this increases supply-chain risk and makes it hard to verify whether vulnerable or breaking versions are being installed.

Unverifiable Dependency: anthropic has 4 known advisory(ies) (CVE-2026-34450 (Claude SDK for Python has Insecure Default File Permissions in Local Filesystem ); CVE-2026-34452 (Claude SDK for Python: Memory Tool Path Validation Race Condition Allows Sandbox); CVE-2026-34450 (The Claude SDK for Python provides access to the Claude API from Python applicat) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
92% confidence
Finding
The manifest references anthropic without pinning to a specific version, and known advisories exist for that package, so it is impossible to determine from this file whether a safe or affected release will be installed. While this file alone does not prove exploitation, the inability to verify a non-vulnerable version is itself a supply-chain security weakness.

Unpinned Dependencies

Low
Category
Supply Chain
Content
anthropic>=0.39.0
mcp>=1.1.0
Confidence
99% confidence
Finding
The mcp dependency is also unpinned (mcp>=1.1.0), so installations may pull in different versions over time, including releases with security regressions or incompatible protocol behavior. This is more concerning here because the skill is specifically about building MCP servers, so the package is likely central to functionality and exposed to untrusted client input.

Unverifiable Dependency: mcp has 12 known advisory(ies) (CVE-2025-53366 (MCP Python SDK vulnerability in the FastMCP Server causes validation error, lead); CVE-2025-66416 (Model Context Protocol (MCP) Python SDK does not enable DNS rebinding protection); CVE-2026-52870 (MCP Python SDK: Experimental task handlers allow any client to access and cancel) +9 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
97% confidence
Finding
The mcp package has multiple known advisories, but because the dependency is not pinned, the resolved version could be vulnerable and cannot be audited from this manifest alone. Given this skill's purpose is to help build MCP servers, uncertainty around the MCP SDK version is more dangerous because any SDK flaw may directly affect server exposure, request handling, or client trust boundaries.

Static analysis

No suspicious patterns detected.