Back to skill

Security audit

A Stock Trading Signals

Security checks for vulnerabilities and agentic risk

Overview

The skill should go to Review because it advertises paid real-time stock signals, but the included service returns hard-coded mock recommendations and does not enforce the stated payment gate.

Install only if you treat it as a demo or unverified signal feed. Do not rely on its stock picks, prices, targets, or stop losses as current market analysis, and do not assume the x402 payment or data-source claims are correctly implemented until the publisher provides real data integration, payment verification, timestamps, methodology, and dependency pinning.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
api.py:60
Finding
x402 Payment Verification Is Completely Bypassed## Vulnerability Details **File Location**: `api.py`, lines 60-69 and 78-103 **Vulnerability Type**: Authentication and payment authorization bypass **Risk Level**: High ### Evidence ```python def verify_x402_payment(headers: dict) -> bool: """验证x402支付""" if not X402_AVAILABLE: # 测试模式:跳过支付验证 return True # 检查 x402 相关的 header # 实际部署时需要验证支付状态 return True # 简化版本 ``` The protected endpoint also fails to invoke the verification function: ```python @app.get("/signals") async def signals( pattern: str = "all", x402: Optional[str] = Header(None) ): """ 获取A股交易信号 参数: - pattern: 形态类型 (旱地拔葱/N字型态/一阳串三阴/VCP/all) - x402: x402支付header 返回: - signals: 信号列表 - price: 价格 (USDC) - wallet: 收款钱包 """ # 这里应该添加x402支付验证 # 实际部署时需要 data = await get_signals(pattern) return { "success": True, "timestamp": datetime.now().isoformat(), "pattern": pattern, "signals": data, "price": "0.01 USDC", "wallet": "0x1a9275EE18488A20C7898C666484081F74Ee10CA", "chain": "Base (eip155:8453)" } ``` ### Technical Analysis The payment verifier returns `True` in every possible execution path. It permits access when the x402 dependency is unavailable and also unconditionally accepts requests when that dependency is installed. In addition, the `/signals` endpoint never calls the verifier. The optional `x402` request header consequently has no authorization effect. No proof is validated against the expected recipient, amount, asset, chain, nonce, payer, expiration, or transaction status. There is also no replay protection. This is a fail-open access-control design that directly contradicts the declared per-request payment requirement. ### Attack Path 1. An unauthenticated caller sends `GET /signals` or `GET /signals?p ...[truncated 847 chars]
Remediation
## Remediation Suggestions - Require a payment proof for every paid endpoint and invoke verification before obtaining or returning signal data. - Cryptographically validate the proof through the supported x402 implementation. - Confirm the exact Base chain identifier, USDC asset contract, recipient address, required amount, payer authorization, expiration, and transaction finality. - Bind each proof to the requested resource and use a server-issued nonce or unique payment identifier. - Store consumed proof identifiers or transaction references to prevent replay. - Return HTTP 402 for missing, invalid, expired, underpaid, or previously consumed proofs. - Fail closed if the x402 package, network verification service, or chain validation is unavailable. Any test-mode bypass must be explicitly configured and prohibited in production. - Add automated tests covering absent headers, malformed proofs, incorrect chains, incorrect recipients, insufficient amounts, expired proofs, and replay attempts.

other

Error
Location
api.py:20
Finding
Advertised Real-Time Financial Signals Are Static Mock Data## Vulnerability Details **File Location**: `api.py`, lines 20-76; supporting claims in `SKILL.md`, lines 24-30 and 61-63 **Vulnerability Type**: Deceptive financial data behavior **Risk Level**: High ### Evidence The implementation explicitly defines the output as mock data: ```python # 模拟交易信号数据 (实际需要接入东方财富/同花顺API) MOCK_SIGNALS = { "旱地拔葱": [ {"code": "300750", "name": "宁德时代", "price": 285.50, "change": 5.2, "inflow": "2.5亿", "stars": "⭐⭐⭐", "stop_loss": 271.23, "target": 314.05}, {"code": "002594", "name": "比亚迪", "price": 268.80, "change": 3.8, "inflow": "1.8亿", "stars": "⭐⭐", "stop_loss": 255.36, "target": 295.68}, {"code": "600519", "name": "贵州茅台", "price": 1680.00, "change": 2.5, "inflow": "3.2亿", "stars": "⭐⭐⭐", "stop_loss": 1596.00, "target": 1848.00}, ], "N字型态": [ {"code": "000858", "name": "五粮液", "price": 158.60, "change": 4.2, "inflow": "1.2亿", "stage": "再次启动", "stars": "⭐⭐⭐", "stop_loss": 150.67, "target": 174.46}, {"code": "601318", "name": "中国平安", "price": 48.50, "change": 3.5, "inflow": "2.1亿", "stage": "突破", "stars": "⭐⭐", "stop_loss": 46.08, "target": 53.35}, ], "一阳串三阴": [ {"code": "300059", "name": "东方财富", "price": 22.80, "change": 6.8, "inflow": "4.5亿", "stars": "⭐⭐⭐", "stop_loss": 21.66, "target": 25.08}, {"code": "002475", "name": "立讯精密", "price": 35.60, "change": 5.5, "inflow": "2.8亿", "stars": "⭐⭐", "stop_loss": 33.82, "target": 39.16}, ], "VCP": [ {"code": "688041", "name": "纳芯微", "price": 125.80, "change": 4.5, "sector": "半导体", "rvol": 2.3, "stars": "⭐⭐⭐", "stop_loss": 119.51, "target": 138.38}, {"code": "688126", "name": "沪硅产业", "price": 28.90, "change": 3.2, "sector": "半导体", "rvol": 1.8, "stars": "⭐⭐", "stop_loss": 27.46, "target": 31.79}, ] } async def get_signals(pattern: str = "all") -> dict: """获取交易信号""" if pattern == "all": return MOCK_SIGNALS ...[truncated 2109 chars]
Remediation
## Remediation Suggestions - Do not expose mock signal data through a production or paid endpoint. - Integrate the declared market-data providers through documented and authorized APIs. - Implement the advertised technical-pattern screening logic and validate it with deterministic tests. - Include the source, exchange, instrument, quote timestamp, timezone, calculation timestamp, and whether the quote is delayed in each response. - Reject requests or clearly report degraded service when upstream data is unavailable or stale. - Clearly label demonstration data as synthetic, prevent it from being presented as current, and do not charge users for it. - Remove unsupported Hong Kong market claims until that functionality is implemented and verified. - Ensure response timestamps cannot be mistaken for quote timestamps. - Subject all financial calculations and disclosures to domain review before production deployment.

T08 · Insecure Dependencies

Warning
Location
skill.json:10
Finding
Security-Critical Runtime Dependencies Are Unpinned## Vulnerability Details **File Location**: `skill.json`, lines 10-14 **Vulnerability Type**: Uncontrolled third-party dependency resolution **Risk Level**: Medium ### Evidence ```json "dependencies": [ "fastapi", "uvicorn", "x402" ], ``` ### Technical Analysis The project declares package names without exact versions and provides no reviewed lockfile or integrity hashes. Each installation can therefore resolve to different package releases. This is particularly sensitive for `x402`, which is intended to enforce payment authorization. An incompatible, compromised, or unexpectedly changed package release could alter verification behavior. Unpinned web-framework and server dependencies can likewise introduce regressions or known vulnerabilities into later deployments without any source-code modification in this repository. The reviewed files do not prove that any currently resolved package is malicious. The confirmed issue is the absence of reproducible, integrity-controlled dependency resolution. ### Attack Path 1. A deployment or developer environment installs dependencies from the configured package index. 2. The installer resolves the latest package versions because no exact versions are specified. 3. A compromised, vulnerable, or behaviorally incompatible release is selected. 4. Package installation hooks or imported runtime code execute in the application environment. 5. The affected dependency may compromise service behavior, availability, payment validation, or data confidentiality within the privileges of the application process. ### Impact Assessment Exploitation depends on a malicious or vulnerable upstream release, package-index compromise, or unsafe resolver configuration. If that condition occurs, dependency code runs with the same operating-system and network privileges as the API process. Potential scope includes application data, environment variables available to the process, outbou ...[truncated 167 chars]
Remediation
## Remediation Suggestions - Pin every direct dependency to an exact, reviewed version. - Generate and commit a lockfile suitable for the deployment toolchain. - Use package hashes or another integrity-verification mechanism during installation. - Verify that the selected `x402` distribution is the intended official package and review its publisher and source repository. - Resolve and lock transitive dependencies in addition to direct dependencies. - Run automated vulnerability and package-provenance scanning in continuous integration. - Use a private package mirror or allowlist where appropriate. - Test dependency upgrades in a controlled environment and merge them only after security and compatibility review. - Configure deployment builds to fail if dependency versions or hashes differ from the approved lock state.
Vulnerability Patterns
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill advertises quantitative stock-screening for A-shares and Hong Kong stocks, but the manifest and description indicate a paid backend API and monetization flow without exposing or documenting any verifiable screening logic. In a financial context, this mismatch is dangerous because users may pay for and act on opaque or possibly fabricated trading signals, creating financial loss, trust abuse, and potential fraud/compliance risk.

Natural-Language Policy Violations

Medium
Confidence
84% confidence
Finding
The skill description, inputs, outputs, and warnings are all presented exclusively in Chinese. Under the policy rule, forcing a specific language without user opt-in or a clearly justified region-specific constraint is a natural-language policy concern.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The service advertises paid x402-gated access, but the code does not enforce payment before returning the stock signals. In `verify_x402_payment`, verification always succeeds, and the `/signals` endpoint does not call enforcement logic at all, allowing any client to bypass the paywall and access protected content for free.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
This file’s natural-language description and API-facing documentation are presented only in Chinese, including the module docstring and endpoint descriptions. Under the policy rule, forcing a specific language without user opt-in or a documented justification is a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
84% confidence
Finding
The description and endpoint labels are written entirely in Chinese, which implies a fixed language experience but does not state that the skill is region-specific or offer an alternative language option. This can violate language/locale policy when users are not given an explicit choice or explanation for the constraint.

Description-Behavior Mismatch

Low
Confidence
79% confidence
Finding
The manifest description focuses on identifying strong A/HK stocks based on chart patterns. In addition to serving signals, the code embeds payment product behavior by publishing a payment scheme, token amount, chain, and payout wallet, which is not reflected in the manifest description.

Vague Triggers

Low
Confidence
90% confidence
Finding
This manifest provides only a short description of the skill but does not define any explicit trigger phrases, invocation constraints, or negative examples. For a manifest file, that makes activation boundaries unclear and increases the risk of unintended invocation based on a broad stock-trading description alone.

Static analysis

No suspicious patterns detected.