Back to skill

Security audit

Ev Calculator

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed paid EV calculator skill with a small remote API/payment component, and I did not find hidden execution, persistence, credential access, or destructive behavior.

Before installing, treat this as a paid remote calculator: confirm you are comfortable sending calculator inputs to the declared API and paying 0.01 USDC via x402. Do not use its output as financial advice or in automated trading without independent validation, and prefer a pinned release or reviewed package over cloning the mutable GitHub branch.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ev_calculator.py:56
Finding

Missing Numeric Input Validation Can Produce Unsafe Financial Recommendations

Content
View full analysis
float: return p * win - (1 - p) * loss def polymarket_ev(your_prob: float, market_price: float) -> Tuple[float, float]: edge = your_prob - market_price ev_dollar = edge / market_price if market_price > 0 else 0 return edge, ev_dollar def kelly_from_ev(p: float, b: float, fraction: float = 0.5) -> float: f_star = (p * b - (1 - p)) / b if f_star < 0: return 0 return f_star * fraction ``` ```python parser.add_argument("--p", type=float, help="胜率 (0-1, e.g., 0.55)") parser.add_argument("--win", type=float, help="赢的金额 (e.g., 1.10)") parser.add_argument("--loss", type=float, help="输的金额 (e.g., 1.00)") parser.add_argument("--market", type=float, help="市场定价 (Polymarket, 0-1)") parser.add_argument("--your", type=float, help="你的判断概率 (0-1)") parser.add_argument("--b", type=float, help="盈亏比 (win/loss)") parser.add_argument("--json", action="store_true", help="JSON输出") args = parser.parse_args() result = {} if args.p is not None and args.win is not None and args.loss is not None: ev = calculate_ev(args.p, args.win, args.loss) ev_pct = (ev / args.loss * 100) if args.loss > 0 else 0 ``` ### Technical Analysis The command-line parser converts values to floating-point numbers but does not enforce their semantic domains. Probabilities and market prices are expected to be within `[0, 1]`; win and loss amounts should be non-negative or positive as appropriate; and the Kelly payoff ratio must be greater than zero. The code also does not reject non-finite IEEE-754 values such as `NaN` and positive or negative infinity. Consequently, the calculator accepts inputs that do not represent valid probabilities or financial values. For example, `--p nan` propagates `NaN` through ...[truncated 1732 chars]
Remediation
View remediation
= 0` and `loss > 0`. - Require `b > 0`. - Define and enforce an allowed range for the fractional Kelly coefficient. 2. Reject `NaN` and infinite values with `math.isfinite()`. 3. Return a nonzero exit status and a clear error message for invalid or incomplete argument combinations. 4. Prevent non-standard JSON output by using `json.dumps(..., allow_nan=False)`. 5. Add unit tests for boundary values, negative values, zero denominators, `NaN`, infinity, and probabilities outside `[0, 1]`. Example validation helper: ```python import math def probability(value: float, name: str) -> float: if not math.isfinite(value) or not 0 <= value <= 1: raise ValueError(f"{name} must be a finite value between 0 and 1") return value def positive(value: float, name: str) -> float: if not math.isfinite(value) or value <= 0: raise ValueError(f"{name} must be a finite value greater than zero") return value ``` ]]>

T08 · Insecure Dependencies

Warning
Location
README.md:57
Finding

Installation Instructions Retrieve an Unpinned Mutable Repository

Content
View full analysis
Remediation
View remediation
git verify-commit python -m pip install --require-hashes -r requirements.txt ``` ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill description, usage guidance, and risk notes are presented only in Chinese, with no indication that users may choose another language or that the skill is intended exclusively for a Chinese-speaking region. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · README.md (reported line 35)May include surrounding context.

bash
# 支付示例
curl -X POST https://api.x402.dev/pay \
  -H "Content-Type: application/json" \
  -d '{
    "to": "0x24b288c98421d7b447c2d6a6442538d01c5fce22",

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · README.md (reported line 35)May include surrounding context.

bash
# 支付示例
curl -X POST https://api.x402.dev/pay \
  -H "Content-Type: application/json" \
  -d '{
    "to": "0x24b288c98421d7b447c2d6a6442538d01c5fce22",

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description, usage instructions, examples, and outputs are written in Chinese throughout the skill, and there is no indication that users may opt into another language or that the skill is intentionally limited to a Chinese-speaking region or audience. This creates a natural-language policy concern because it effectively forces a specific language without user choice.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill is marketed as a simple EV calculator, but its manifest routes usage to a paid external API endpoint with x402 payment metadata and an on-chain wallet. This creates an integrity and privacy risk because users may send inputs and make payments to a remote service when the documented functionality could be performed locally, increasing trust requirements and exposure beyond what the description implies.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation defines the Polymarket version as a simple difference between your estimate and market price. In the code example, polymarket_ev returns both that edge and a second value, ev_dollar = edge / market_price, which is a different metric not reflected by the stated formula or return description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code file includes its docstrings, CLI help text, output labels, and usage instructions exclusively in Chinese. Under the policy, forcing a specific language without offering a user choice or documenting a justified locale restriction is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.