Back to skill

Security audit

Mx Search

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent financial-search purpose, but its shell command template can mishandle user queries and should be reviewed before installation.

Review this skill before installing. Its purpose and API use are understandable, but the curl example should be rewritten to build JSON safely, such as with a JSON serializer, before agents use user-provided query text. Treat queries as data sent to Meixiang, do not include secrets or confidential client information, and save raw JSON only when needed.

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:23
Finding

Shell and JSON Injection Through Unsafe Query Interpolation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 23–31
Vulnerability Type: Unsafely interpolated user input in a shell command
Risk Level: High

bash
1. Construct the query string based on the user's request.
2. Execute the POST request to the Meixiang endpoint:
   ```bash
   curl -X POST \
     --location 'https://mkapi2.dfcfs.com/finskillshub/api/claw/news-search' \
     --header 'Content-Type: application/json' \
     --header "apikey:${MX_APIKEY}" \
     --data '{"query":"<YOUR_QUERY_HERE>"}'
   ```

Technical Analysis

The skill instructs an agent to construct a shell command by replacing <YOUR_QUERY_HERE> with content derived from the user's request. It does not require the query to be encoded with a JSON serializer or passed to the process through a shell-safe mechanism.

The request body is enclosed in a single-quoted shell argument. If an implementation performs direct textual substitution, a query containing a single quote can terminate that argument. Subsequent shell metacharacters may then be interpreted by the shell instead of being treated as query data. Independently, unescaped quotation marks, backslashes, or control characters can corrupt the JSON body.

This is an instruction-level coding flaw rather than evidence that the skill intentionally executes malicious commands. Exploitability depends on an agent or implementation following the documented template through a shell and directly interpolating untrusted input.

Attack Path

  1. An attacker submits a finance-related query containing a single quote followed by shell syntax and an attacker-selected command.
  2. The agent constructs the documented curl command by directly replacing the query placeholder.
  3. The single quote closes the intended --data argument.
  4. The shell interprets the remaining injected syntax as command operators or additional commands.
  5. The injected command executes with ...[truncated 925 chars]
Remediation
View remediation

Remediation Suggestions

  • Never substitute user-controlled text directly into a shell command template.

  • Construct the request body with a JSON serializer. For example:

    bash
    printf '%s' "$QUERY" |
      jq -Rs '{query: .}' |
      curl --fail-with-body --silent --show-error \
        --request POST \
        --location 'https://mkapi2.dfcfs.com/finskillshub/api/claw/news-search' \
        --header 'Content-Type: application/json' \
        --header "apikey:${MX_APIKEY}" \
        --data-binary @-
    
  • Prefer a native HTTP client that accepts arguments without invoking a shell and uses a language-provided JSON encoder.

  • Explicitly instruct the agent not to generate executable command strings by concatenating or interpolating user input.

  • Validate query length and expected character encoding as defense-in-depth, while recognizing that validation is not a replacement for safe serialization.

  • Keep MX_APIKEY scoped to the minimum required permissions, rotate it if exposure is suspected, and avoid logging request headers or the complete environment.

  • Add tests containing single quotes, double quotes, backslashes, newlines, JSON control characters, and shell metacharacters to verify that all input remains inert request data.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs sending user-constructed queries directly to a third-party API without warning that user input will leave the local environment. This creates a privacy and data-governance risk because users or agents may transmit sensitive financial, personal, or confidential information to an external service unintentionally.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

The skill performs an outbound POST request to an external domain using user-provided query content and an API key. In the context of an agent skill, this is dangerous if not paired with clear consent, data-minimization guidance, and secret-handling rules, because it can leak sensitive prompts or business information off-system.

Content

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

  1. Construct the query string based on the user's request.
  2. Execute the POST request to the Meixiang endpoint:
    bash
    curl -X POST \
      --location 'https://mkapi2.dfcfs.com/finskillshub/api/claw/news-search' \
      --header 'Content-Type: application/json' \
      --header "apikey:${MX_APIKEY}" \
    

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The manifest description narrows the skill to timely, authoritative financial news, announcements, research reports, policies, and related finance information from the Meixiang search API. Line L09 broadens that scope to 'any other external data needed for finance-related queries,' which exceeds the tighter manifest framing and weakens the stated boundary on what the skill is for.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
64% confidence
Finding

L09 characterizes the skill as a 'safe way' to query the service, implying a constrained, read-oriented interaction. Later, L61-L66 instruct saving raw JSON results to a local file, which introduces a write side effect not reflected in that safety-oriented description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation recommends saving raw JSON results to local disk without warning about local persistence. This can expose sensitive search results, regulated financial data, or user-request context to other local users, backups, or later unintended reuse.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.