Back to skill

Security audit

csmar-agent

Security checks for vulnerabilities and agentic risk

Overview

The skill is a small financial-query helper, but it sends user queries to an opaque hardcoded private HTTP service, so it should be reviewed before installation.

Install only if you understand and trust the backend at 10.222.21.157:6600 and are comfortable sending financial queries to it over plaintext HTTP. Avoid including confidential research, customer data, credentials, or internal business context in queries unless the publisher documents the service, transport security, retention, and access controls.

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/search.py:7
Finding
Plaintext HTTP Exposes Search Queries and Streamed Responses to Network Interception## Vulnerability Details **File Location**: `scripts/search.py`, lines 7–17 **Vulnerability Type**: Cleartext transmission of potentially sensitive data **Risk Level**: Medium ### Vulnerable Code ```python def baidu_search(query:str) -> Generator[str, None, None]: url = "http://10.222.21.157:6600/api/Agent/queryanswerstream" headers = { "accept": "application/json", "Content-Type": "application/json-patch+json" } data = { "Query": query, "IsReasoner": False } try: response = requests.post(url, json=data, headers=headers, stream=True) ``` ### Technical Analysis The script sends the user-supplied query to a hardcoded private-network endpoint over plaintext HTTP. HTTP provides neither transport confidentiality nor cryptographic server authentication. Any party able to observe or manipulate traffic between the host and `10.222.21.157:6600` may read the submitted query, modify the request, impersonate the service, or alter the streamed response. Although the documented use case concerns financial-report searches, users may include confidential company names, investment research, internal financial questions, or other sensitive context in a query. The service response is also delivered without transport integrity protection and is printed directly to the terminal. ### Attack Path 1. An attacker gains a network-adjacent position, such as access to the same local network, a compromised router or proxy, or control of a relevant network path. 2. A user invokes the skill with a query. 3. The script submits the query in an unencrypted HTTP request to the hardcoded endpoint. 4. The attacker captures the request and reads its JSON `Query` value. 5. The attacker may additionally redirect, impersonate, or modify the HTTP exchange and inject attacker-controlled text into the streamed response. 6. The script prints the manipulated response as though it ca ...[truncated 530 chars]
Remediation
## Remediation Suggestions - Replace the plaintext endpoint with an authenticated HTTPS endpoint, for example `https://.../api/Agent/queryanswerstream`. - Configure the server with a certificate issued by a trusted internal or public certificate authority, and retain TLS certificate verification in `requests`. - Do not disable certificate validation through `verify=False`. If an internal certificate authority is required, provide its CA bundle explicitly. - Consider mutual TLS or authenticated request signing when the endpoint is restricted to trusted internal clients. - Move the endpoint into validated configuration rather than embedding a fixed address in source code. Permit only approved HTTPS origins. - Apply network access controls so only authorized clients can reach the service. - Avoid placing secrets or unnecessary confidential context in queries, and document what data is transmitted to the remote service. - Add explicit connection and read timeouts while updating the request, such as a bounded `timeout` configuration, to prevent indefinite hangs.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared purpose says the skill queries CSMAR financial-report APIs for A-share company reports, but the analyzed behavior indicates a generic internal query-answer streaming client instead. This mismatch is dangerous because users and orchestrators may trust the skill with finance-specific queries while it actually sends data to a broader service with different data handling, scope, or trust assumptions.

Lp3

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding
The skill advertises network-capable behavior but does not declare any explicit tool scope such as permissions or allowed-tools. This weakens policy enforcement and reviewability, making it easier for a networked script to access external services without clear authorization boundaries.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The invocation description uses broad trigger keywords like 财务 and mentions handles such as @csmar_agent/@csmar-agent without clear scope constraints. Overbroad triggers can cause unintended activation for loosely related prompts, increasing the chance that sensitive financial queries or unrelated user content are routed to this skill unexpectedly.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The code posts queries to a non-local service over plaintext HTTP rather than HTTPS, exposing the request contents to interception or modification by anyone on the network path. Because the payload is fully controlled by user input and the response is streamed back into the tool output, this weak transport also enables tampering, surveillance, and prompt/content injection through a man-in-the-middle position.

External Transmission

Medium
Category
Data Exfiltration
Content
"IsReasoner": False
    }
    try:
        response = requests.post(url, json=data, headers=headers, stream=True)
        response.raise_for_status()
        yield  from simple_sse_reader(response)
    except Exception as e:
Confidence
93% confidence
Finding
This code transmits user-supplied query data to an external endpoint, crossing a trust boundary without any evident safeguards, consent flow, or data handling controls. In the context of an agent skill, that is security-relevant because prompts often contain more than the minimal search term and may reveal internal context or sensitive user intent.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The function sends the raw user query to a remote API endpoint without any consent, disclosure, minimization, or classification of the data being transmitted. In an agent skill handling financial-report queries, user prompts may still contain sensitive business information, identifiers, or proprietary research terms, so undisclosed exfiltration to an external service creates a real privacy and data-governance risk.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The description is written to enforce a fixed response behavior ('输出内容不添加最终总结文本') and is implicitly Chinese-language oriented without indicating user choice. A fixed language/locale or presentation constraint can violate policy when it is imposed regardless of user preference and is not documented as an opt-in or region-specific requirement.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
The code emits natural-language error text in Chinese only, and similar fixed-language messages appear elsewhere in the file. This can violate language or locale policy when no user opt-in or documented locale restriction is provided.

Natural-Language Policy Violations

Low
Confidence
67% confidence
Finding
The script mixes English and Chinese user-facing strings, but does not document any intended locale behavior or offer a language choice. This can create an implicit language policy issue under the requirement to avoid forcing a locale without opt-in.

Static analysis

No suspicious patterns detected.