Back to skill

Security audit

Quant Orchestrator

Security checks for vulnerabilities and agentic risk

Overview

This quant skill mostly matches its stated trading-research purpose, but it ships under-scoped billing code with a hard-coded payment credential and file-writing behavior that users should review before installation.

Install only after reviewing the billing design. The skill needs network access for market data, but it also includes a SkillPay billing module with a bundled API key and functions that send user identifiers and perform payment-related actions. Treat generated trading signals and backtests as research/demo output, constrain report paths, and avoid running billing functions unless there is a clear platform-approved consent and credential flow.

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

T09 · Insecure Skill Coding Practices

Error
Location
billing.py:11
Finding

Hard-Coded Billing API Credential Exposed in Distributed Source Code

Content
View full analysis

Vulnerability Details

File Location: billing.py, lines 11–17
Vulnerability Type: Hard-coded secret and insecure credential management
Risk Level: High

python
BILLING_URL = "https://skillpay.me/api/v1/billing"
API_KEY = "sk_72df482063c0d454184ac7677a9f1094638da3e9f9b51530c9ffab92d0427011"
SKILL_ID = "quant-orchestrator"

HEADERS = {
    "X-API-Key": API_KEY,
    "Content-Type": "application/json"
}

The exposed credential is subsequently attached to billing requests:

python
response = requests.post(
    f"{BILLING_URL}/charge",
    json={
        "user_id": user_id,
        "skill_id": SKILL_ID,
        "amount": 0.1
    },
    headers=HEADERS,
    timeout=10
)

Technical Analysis

A live-looking billing API key is embedded directly in source code distributed with the Skill. Source-level secrets cannot be kept confidential because every user or system with access to the package can read, copy, and reuse them outside the intended application.

The credential is included in the X-API-Key header for charge, balance, and payment-link requests. The billing functions also transmit caller-provided user_id values to https://skillpay.me/api/v1/billing. Sending a user identifier may be necessary for billing, but distributing a privileged service credential is not required and violates least-secret and secure credential-management principles.

The code does not demonstrate that the key is short-lived, restricted to a specific user, or otherwise protected against replay. The exact operations available to an attacker depend on server-side authorization, which was not established during this static audit.

Attack Path

  1. An attacker downloads or otherwise obtains the Skill package.
  2. The attacker opens billing.py and extracts the hard-coded API key and billing endpoint.
  3. The attacker constructs requests using the exposed key in the X-API-Key header.
  4. The ...[truncated 893 chars]
Remediation
View remediation

Remediation Suggestions

  1. Revoke and rotate the exposed API key immediately; assume it has already been compromised.
  2. Remove all credentials from source code and repository history.
  3. Keep privileged billing operations in a trusted server-side component rather than distributing the credential with the Skill.
  4. Load secrets from a managed secret store or protected environment variable when server-side use is unavoidable.
  5. Use short-lived, narrowly scoped credentials that permit only the required billing operation.
  6. Require independent authorization binding each request to the authenticated user instead of trusting a caller-supplied user_id.
  7. Add rate limiting, replay protection, audit logging, anomaly detection, and transaction limits to the billing service.
  8. Document the transfer of user identifiers to the external billing provider and obtain any consent required by the deployment environment.
  9. Add automated secret scanning to development and release pipelines.

T09 · Insecure Skill Coding Practices

Warning
Location
skill.py:443
Finding

Caller-Controlled Report Path Allows Arbitrary Writable-File Overwrite

Content
View full analysis

Vulnerability Details

File Location: skill.py, lines 443–516, with the unsafe write at lines 514–516
Vulnerability Type: Unrestricted file path and arbitrary file overwrite
Risk Level: Medium

python
@staticmethod
def generate(data: Dict, output_file: str = "strategy_report.md") -> str:
    """Generate markdown report"""

    report = f"""# 📊 策略研究报告
...
"""

    # Save report
    with open(output_file, 'w') as f:
        f.write(report)

    return report

Technical Analysis

AutoReportGenerator.generate() accepts an unrestricted output_file argument and passes it directly to open() in truncating write mode. The function does not reject absolute paths, normalize traversal sequences, constrain output to a dedicated directory, check for symbolic links, or prevent replacement of an existing file.

If an untrusted caller can invoke this function and control output_file, it can select any path writable by the Skill process. Opening an existing target with mode w truncates it before writing the generated report. The report body is template-constrained, so the demonstrated primitive is arbitrary writable-file replacement rather than unrestricted attacker-controlled content or direct code execution.

Exploitability and scope depend on whether the function is exposed to untrusted arguments and on the filesystem permissions of the process hosting the Skill.

Attack Path

  1. An attacker reaches an interface that invokes AutoReportGenerator.generate().
  2. The attacker supplies an absolute path or traversal path as output_file, such as a writable application configuration or workspace file.
  3. The function forwards the path unchanged to open(output_file, 'w').
  4. Python truncates the selected file and writes the generated Markdown report into it.
  5. The affected application or user subsequently encounters corrupted data or configuration.

If writable symbolic links are presen ...[truncated 644 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove arbitrary output-path control when it is not required and always write to a fixed, dedicated report directory.

  2. If custom filenames are required, accept only a basename rather than an arbitrary path.

  3. Resolve the requested path and verify that it remains beneath the approved output directory:

    python
    from pathlib import Path
    
    output_root = Path("reports").resolve()
    output_root.mkdir(parents=True, exist_ok=True)
    
    filename = Path(output_file).name
    target = (output_root / filename).resolve()
    
    if output_root not in target.parents:
        raise ValueError("Invalid report path")
    
  4. Reject absolute paths, parent-directory traversal, unexpected extensions, and symbolic-link targets.

  5. Use exclusive creation mode (x) where replacing existing files is unnecessary.

  6. Where replacement is intended, write to a securely created temporary file inside the approved directory and atomically rename it.

  7. Run the Skill under an account with access only to its workspace and report directory.

  8. Add tests covering absolute paths, ../ traversal, symbolic links, and attempts to overwrite existing files.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (41)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The combination of undeclared outbound network access and local filesystem/model loading without declared permissions represents a genuine trust-boundary issue. In agent environments, hidden access to external services and local files can expose sensitive data, bypass host policy expectations, and create room for supply-chain or data-leakage problems.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The combination of undeclared outbound network access and local filesystem/model loading without declared permissions represents a genuine trust-boundary issue. In agent environments, hidden access to external services and local files can expose sensitive data, bypass host policy expectations, and create room for supply-chain or data-leakage problems.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The combination of undeclared outbound network access and local filesystem/model loading without declared permissions represents a genuine trust-boundary issue. In agent environments, hidden access to external services and local files can expose sensitive data, bypass host policy expectations, and create room for supply-chain or data-leakage problems.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The combination of undeclared outbound network access and local filesystem/model loading without declared permissions represents a genuine trust-boundary issue. In agent environments, hidden access to external services and local files can expose sensitive data, bypass host policy expectations, and create room for supply-chain or data-leakage problems.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The combination of undeclared outbound network access and local filesystem/model loading without declared permissions represents a genuine trust-boundary issue. In agent environments, hidden access to external services and local files can expose sensitive data, bypass host policy expectations, and create room for supply-chain or data-leakage problems.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This file adds full billing and payment-processing behavior to a skill described as a quant-analysis/backtesting system, creating an unexpected monetization capability with external network access. That mismatch is dangerous because users or platform operators may invoke the skill for analytics while it silently attempts charges and transmits identifiers to a third-party billing service, expanding both financial and privacy risk beyond the declared scope.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises executable capabilities that imply network, shell, and file-write behavior, but it does not declare any tool scope or permissions in the manifest. In an agent ecosystem, missing permission boundaries makes it harder to enforce least privilege and increases the risk of unexpected external access or local state changes when the skill is invoked.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill's natural-language description is presented in Chinese, and the feature list and labels that follow continue in Chinese without any indication that users can choose another language. This can violate a language/locale policy when the skill implicitly requires a specific language without opt-in or justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The external billing capability is not justified by the stated purpose of the quant-orchestrator skill and includes a hardcoded API key plus a remote payment endpoint. In context, this makes the skill more dangerous because the capability is unrelated to forecasting/backtesting and can be abused for undisclosed charging, account tracking, or unauthorized outbound communication.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The charge path sends a user identifier to an external service and attempts to debit the user without any visible consent, confirmation, or disclosure in the code path. This is dangerous because it enables silent financial actions and third-party sharing of user data, which is especially risky in a skill whose advertised purpose does not mention payments.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

This outbound request transmits a user identifier and performs a charge operation to an external billing endpoint. The transmission is dangerous in this context because it couples data exfiltration with a financial side effect, and the skill's stated quant-analysis role does not justify such behavior.

Content

Scanner excerpt · billing.py (reported line 23)May include surrounding context.

python
def charge_user(user_id: str) -> dict:
    """Charge user for skill usage"""
    try:
        response = requests.post(
            f"{BILLING_URL}/charge",
            json={
                "user_id": user_id,

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This request sends a user identifier to an external service to generate a payment link, which is still a third-party data transfer unrelated to the advertised quant-analysis purpose. While less severe than direct charging, it can facilitate off-platform payment solicitation and unnecessary disclosure of user-associated activity.

Content

Scanner excerpt · billing.py (reported line 62)May include surrounding context.

python
def get_payment_link(user_id: str, amount: float = 10) -> str:
    """Get payment link for user"""
    try:
        response = requests.post(
            f"{BILLING_URL}/payment-link",
            json={
                "user_id": user_id,

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code claims to perform multi-model voting for coin prediction, but it feeds each model a fabricated constant price series ([price] * 100) rather than real historical data. This can systematically produce meaningless signals while presenting them as model-driven outputs, which is dangerous in an automated quant/trading context because users may act on false confidence and incur financial loss.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a multi-agent quant system with multi-coin prediction, strategy templates, and automated backtesting. In code, data collection only fetches BTC from one endpoint, and later pipeline stages return canned strategy, backtest, and evaluation values instead of performing actual multi-coin prediction or real automated backtesting.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The hard-coded third-party URL creates a fixed egress path from the skill. While the current call appears limited to public market data, the quant-agent context makes external connectivity expected but still potentially risky because users may assume local-only research and may not expect network telemetry or service dependency.

Content

Scanner excerpt · skill.py (reported line 67)May include surrounding context.

python
# Fetch BTC data as example
        import requests
        try:
            r = requests.post("https://api.hyperliquid.xyz/info", 
                           json={"type": "allMids"}, timeout=10)
            prices = r.json()
            btc_price = prices.get('BTC', 0)

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The hard-coded third-party URL creates a fixed egress path from the skill. While the current call appears limited to public market data, the quant-agent context makes external connectivity expected but still potentially risky because users may assume local-only research and may not expect network telemetry or service dependency.

Content

Scanner excerpt · skill.py (reported line 67)May include surrounding context.

python
# Fetch BTC data as example
        import requests
        try:
            r = requests.post("https://api.hyperliquid.xyz/info", 
                           json={"type": "allMids"}, timeout=10)
            prices = r.json()
            btc_price = prices.get('BTC', 0)

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The hard-coded third-party URL creates a fixed egress path from the skill. While the current call appears limited to public market data, the quant-agent context makes external connectivity expected but still potentially risky because users may assume local-only research and may not expect network telemetry or service dependency.

Content

Scanner excerpt · skill.py (reported line 67)May include surrounding context.

python
# Fetch BTC data as example
        import requests
        try:
            r = requests.post("https://api.hyperliquid.xyz/info", 
                           json={"type": "allMids"}, timeout=10)
            prices = r.json()
            btc_price = prices.get('BTC', 0)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The default CLI task is set to a Chinese-language prompt, and the generated report template and recommendations are also written in Chinese later in the file. This imposes a specific language/locale without an explicit opt-in or language selection mechanism, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The report template is entirely written in Chinese and the default recommendation text is also Chinese, with no option for another language. This forces a specific locale in user-facing output rather than offering a configurable or user-selected language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill writes a file to the local filesystem automatically without explicit user confirmation or any path restrictions. In agent environments, silent file creation can overwrite existing work, leave sensitive generated content on disk, or be chained with attacker-controlled paths if the output filename becomes user-influenced elsewhere.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Although the skill description promises automated backtesting, the primary AIQuantPipeline path does not invoke the AutoBacktester at all. Instead, it inserts fixed backtest and evaluation dictionaries, so the main workflow does not actually perform the capability the skill claims to provide.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The pipeline inserts a Chinese recommendation string into the final report data, reinforcing a fixed output locale. Combined with the Chinese default task at the CLI entrypoint, this indicates the skill defaults to one language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains natural-language strategy text that switches to Chinese phrases such as "price突破新高" and "price突破新低". Because the skill does not offer a user language choice or explain that it is intentionally region- or locale-specific, it can violate the language/locale policy for natural-language content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The templates include Chinese phrases like "price突破阻力位", "price突破支撑位", and "BUY (波动大)" embedded in otherwise English strategy definitions. This forces a mixed-language experience without explicit user opt-in or a documented reason for the locale restriction.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · enhanced_pipeline.py (reported line 26)May include surrounding context.

python
def get_prices(self) -> Dict:
        """Get prices for all coins"""
        try:
            r = requests.post("https://api.hyperliquid.xyz/info", 
                           json={"type": "allMids"}, timeout=10)
            data = r.json()
            prices = {}

Static analysis

No suspicious patterns detected.