T09 · Insecure Skill Coding Practices
- Location
api.py:10- Finding
Paid signal endpoints expose static simulated data without payment verification
- Content
View full analysis
Vulnerability Details
File Location:
api.py:10-24, 32-41, 43-52;SKILL.md:25-29, 59
Vulnerability Type: Missing payment authorization and misleading data provenance
Risk Level: HighVulnerable Code
python # VCP signal data (simulated) VCP_SIGNALS = [ {"code": "688041", "name": "纳芯微", "price": 125.80, "change": 4.5, "sector": "半导体", "rvol": 2.3, "atr_ratio": 0.42, "stars": "⭐⭐⭐", "stop_loss": 119.51, "target": 138.38, "reason": "VCP突破+量能放大+半导体板块热度高"}, {"code": "688126", "name": "沪硅产业", "price": 28.90, "change": 3.2, "sector": "半导体", "rvol": 1.8, "atr_ratio": 0.48, "stars": "⭐⭐", "stop_loss": 27.46, "target": 31.79, "reason": "缩量回调后放量突破"}, {"code": "688008", "name": "澜起科技", "price": 78.50, "change": 5.8, "sector": "半导体", "rvol": 2.1, "atr_ratio": 0.45, "stars": "⭐⭐⭐", "stop_loss": 74.58, "target": 86.35, "reason": "VCP形态紧凑+突破前高"}, ]python def get_vcp_signals() -> dict: """Return VCP signals.""" return { "success": True, "timestamp": datetime.now().isoformat(), "pattern": "VCP", "count": len(VCP_SIGNALS), "signals": VCP_SIGNALS, "payment": PAYMENT_INFO } def create_app(): """FastAPI application.""" from fastapi import FastAPI app = FastAPI(title="A股 VCP信号 API", version="1.0.0") @app.get("/signals") @app.get("/vcp") async def signals(): return get_vcp_signals()Technical Analysis
The Skill documentation describes an x402 workflow in which an API request triggers a payment challenge, payment is completed, and protected VCP screening results are returned. The implementation does not contain authentication middleware, payment-proof validation, transaction confirmation, replay protection, or access-control checks.
Both
/signalsand/vcpcallget_vcp_signals()directly and return the complete dataset to ...[truncated 1525 chars]- Remediation
View remediation
Remediation Suggestions
- Place payment verification middleware in front of
/signalsand/vcp. - Return an x402 payment challenge when a valid proof is absent.
- Verify the payment recipient, chain ID, token contract, amount, transaction status, and request association before disclosing results.
- Implement replay protection by recording consumed transaction identifiers or signed payment nonces.
- Fail closed when payment verification services are unavailable or return ambiguous results.
- Retrieve data from the documented sources and perform the advertised VCP analysis before generating recommendations.
- Include the market-data observation time and source in each response rather than assigning a fresh timestamp to static records.
- If the endpoint is only a demonstration, prominently label every response as simulated, remove live-data claims, and disable real payment requests.
- Add automated tests confirming that unpaid, invalid, underpaid, wrong-chain, and replayed payment proofs cannot access protected results.
- Place payment verification middleware in front of
