Back to skill

Security audit

小果量化交易平台助手

Security checks for vulnerabilities and agentic risk

Overview

This quant-trading skill is coherent, but it needs review because it handles account credentials and destructive strategy actions through insecure HTTP API examples.

Install only if you trust the publisher and the XG Quant server. Do not use real or reused passwords unless the service supports HTTPS and safer token handling; avoid running deletion or custom-code endpoints unless you explicitly intend those account changes and understand they may be irreversible.

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:5801
Finding
Credentials Transmitted over Plaintext HTTP and Exposed in Request URLs## Vulnerability Details **File Location**: `SKILL.md`, lines 5801 and 5811–5856 **Vulnerability Type**: Plaintext credential transmission and sensitive information exposure through URL query parameters **Risk Level**: High **Complete Code Snippet**: ```python self.base_url = f"http://{url}:{port}" self.session = requests.Session() self.timeout = 120 def _get_params(self, **kwargs) -> Dict[str, Any]: """Build request parameters and automatically add user authentication information.""" params = { 'user': self.user, 'password': self.password, 'auth_code': self.auth_code, } params.update(kwargs) return params def _request( self, endpoint: str, params: Dict[str, Any], method: str = 'GET', timeout: Optional[int] = None, verbose: bool = True ) -> Dict[str, Any]: if timeout is None: timeout = self.timeout url = f"{self.base_url}{endpoint}" clean_params = {k: v for k, v in params.items() if v is not None} try: if method.upper() == 'GET': response = self.session.get(url, params=clean_params, timeout=timeout) else: response = self.session.post(url, params=clean_params, timeout=timeout) if verbose: print(f"📤 Request URL: {response.url[:100]}...") print(f"📤 Status code: {response.status_code}") ``` ### Technical Analysis The client constructs its base endpoint with the unencrypted `http://` scheme and automatically adds the user's password and authorization code to every request parameter set. Both GET and POST requests pass these values through `params`, causing them to appear in the URL query string rather than in a protected request body or authentication header. This creates two related exposure channels: 1. **Network interception:** Plaintext HTTP provides neither transport encryption nor reliable server authent ...[truncated 2442 chars]
Remediation
## Remediation Suggestions 1. Require HTTPS for every API endpoint and reject initialization with an `http://` endpoint. Keep certificate verification enabled and do not introduce a bypass such as `verify=False`. 2. Remove passwords and authorization codes from query parameters. Use a standard `Authorization` header with a short-lived token, or place authentication data in a protected POST body when required by the protocol. 3. Do not send reusable passwords with every request. Exchange credentials once for a scoped, short-lived access token and support revocation and expiration. 4. Remove full request-URL logging. If request diagnostics are necessary, log only the scheme, host, path, status code, and a sanitized parameter-name list. Explicitly redact `password`, `auth_code`, tokens, cookies, and authorization headers. 5. Ensure reverse proxies, API gateways, application servers, and telemetry systems also redact sensitive headers and parameters. 6. Store credentials outside source code and notebooks, such as in a protected secret manager or environment-based credential provider. Avoid defaults that resemble usable credentials. 7. Rotate passwords and authorization codes that may already have been transmitted or logged by this implementation, and purge exposed logs according to the applicable retention policy. 8. Add automated tests that fail if credentials appear in generated URLs, logs, exception messages, or telemetry. 9. Apply server-side rate limiting, token scoping, anomaly detection, and reauthentication for destructive operations. Require a separate confirmation mechanism for irreversible deletion requests.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
The skill exposes a generic server-side execution surface through `get_user_def_data(name, func=...)`, where arbitrary Python code is passed as a request parameter to a remote endpoint. In a quant assistant, this is far beyond normal data retrieval/backtesting scope and could enable remote code execution on the backing service, data theft, pivoting, or full server compromise if the server evaluates the provided code.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger keywords are very broad finance terms such as stock analysis, performance analysis, historical market data, and strategy generation, which can overlap with many ordinary user requests. That increases the chance of unintended invocation, causing users to engage a credentialed remote trading/data skill when they did not intend to, which is riskier in this context because the skill can access account-linked and destructive operations.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill instructs users to provide `user`, `password`, and `auth_code` and sends them over HTTP to a remote server, but it does not prominently warn users that credentials and account data will be transmitted off-platform. In a financial/trading context, this omission is especially dangerous because it can expose account secrets and portfolio or strategy data to interception, misuse, or unauthorized retention.

Context-Inappropriate Capability

Medium
Confidence
82% confidence
Finding
`get_wencai_data(query=...)` introduces a generic external query feature not clearly constrained to the declared platform scope, expanding the skill's effective capability surface beyond the manifest. While not inherently code execution, this kind of scope creep can route user queries and potentially sensitive finance intent to an external service without clear disclosure or tight boundaries.

Static analysis

No suspicious patterns detected.