Back to skill

Security audit

MCP Third Party Publisher

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a publishing helper, but it gives the agent under-scoped authority to run payload-provided CLI commands, use hardcoded account details, update local cache state, and steer users toward a paid listing option.

Install only if you intend to use it for the openpatsnap/PatSnap-oriented MCP publishing workflow and are prepared to review every command, account, email, listing tier, and destination before proceeding. Do not let it run payload-provided CLI commands or select a paid listing unless you have independently verified the command and explicitly want that purchase or publication action.

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

Error
Location
SKILL.md:145
Finding

Unvalidated Execution of Payload-Provided CLI Commands

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 145
Vulnerability Type: Command injection through untrusted command strings
Risk Level: High

Vulnerable Code Snippet

markdown
4. If publication is required, prefer the Smithery CLI command contained in `payload["commands"]`; use the web page only for login, verification, and result confirmation.

The snippet is an English translation of the instruction at the specified source location.

Technical Analysis

The skill instructs the agent to prefer CLI commands supplied through payload["commands"]. The document identifies payload as part of generated skill_inputs, but it does not require the command to be validated before execution.

No controls are specified for:

  • Restricting the executable to an approved Smithery CLI binary.
  • Allowlisting supported subcommands and options.
  • Separating executable arguments from a shell command string.
  • Rejecting shell metacharacters, command substitutions, redirects, or pipelines.
  • Verifying that the command performs only the requested publication operation.
  • Displaying the exact command and obtaining explicit approval before local execution.

Consequently, a compromised publishing tool or maliciously constructed input could place arbitrary shell operations in payload["commands"]. An agent following the skill could interpret those operations as an authorized part of the publishing workflow. The existing confirmation requirement applies to final external submission actions, not explicitly to local CLI execution, so it does not reliably mitigate this command-execution path.

Attack Path

  1. An attacker controls, modifies, or influences the generated skill_inputs.
  2. The attacker inserts a malicious shell command into payload["commands"], potentially combining a legitimate Smithery command with command separators, substitutions, redirects, or unrelated executables.
  3. A user invokes the skill to publish an MCP server to Smith ...[truncated 1153 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not execute command strings supplied directly through payload["commands"].
  2. Construct the Smithery invocation internally from individually validated fields.
  3. Use a fixed, trusted executable path and an argument-array API that does not invoke a shell.
  4. Allowlist the exact Smithery subcommands and options required by the publishing workflow.
  5. Validate identifiers, repository URLs, server URLs, and file paths against strict formats and expected schemes.
  6. Reject shell control characters and constructs, including separators, pipelines, redirects, substitutions, and newline injection.
  7. Display the normalized executable and every argument to the user before execution.
  8. Require explicit confirmation for local CLI execution separately from confirmation for final external submission.
  9. Run the command with least privilege in a restricted working directory and sanitized environment.
  10. Avoid forwarding unrelated environment variables or credentials to the child process.
  11. Record the validated command, approval, exit status, and resulting publication URL for auditability.
  12. Prefer a typed publisher API over shell-based automation wherever one is available.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (8)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill is predominantly written in Chinese and does not state that the user can choose another language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the constraint is documented and justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill extends beyond browser-assisted third-party submission into local state management by instructing the agent to modify .cache JSON status files and drive ordered batch workflows. That broadens the skill’s authority from form-filling to local filesystem mutation, which can create integrity issues, misleading publication state, or unintended changes outside the user’s immediate review path.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The Smithery section instructs running a local Python command (python -m mcp_publisher ...) even though the skill is described primarily as a browser/computer-use publishing helper. Introducing command execution increases the attack surface because it can trigger local code paths, dependency execution, or side effects not inherent to simple web submission.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The Smithery guidance is internally inconsistent: one section requires the exact GitHub directory name for Server ID*, while another later section says to use a slugified server ID. Conflicting instructions can cause misregistration, namespace collisions, or publication of the wrong server entry, especially in an automated workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The MCP Market instructions hardcode a default email and default to a paid $29/OFFICIAL listing option. This can steer the agent toward spending money or using a specific account without fresh user authorization, which exceeds a neutral 'prepare and stop before submit' workflow and creates financial and account-misuse risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Defaulting to the marketplace's recommended paid package biases the agent toward a billable action without confirming that the user wants to purchase that option. In a publishing skill, this is dangerous because it can normalize unnecessary spend and reduce meaningful consent at the point of payment.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The default prompt is broadly phrased to 'submit this MCP server to third-party directories with Computer Use,' which can trigger the skill in many contexts involving publishing or browser automation without sufficient user intent confirmation. In a skill that interacts with external websites and submission flows, unintended activation can cause data entry, disclosure of server metadata, or progression toward external publication actions before the user explicitly authorizes them.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill specifies a default Smithery account/email (openpatsnap@gmail.com) for publication context. Hardcoded account identity can cause submissions under the wrong tenant or leak organizational assumptions into unrelated publishing tasks.

Content

No source excerpt is available for this finding.