Back to skill

Security audit

Kalshi Eth Gas Correlation Trader

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed live trading skill, but it needs review because the implemented strategy and safety boundaries do not match the documentation closely enough for real-money use.

Install only after reviewing the exact SDK version and using restricted, low-balance credentials. Treat --live as real-money trading, do not expose a valuable Solana wallet key, and be aware that the current code does not actually fetch on-chain gas prices and may sell unrelated ETH positions in the connected account.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
trader.py:323
Finding

Market safety checks fail open when context retrieval fails

Content
View full analysis
dict: """Get market context with safeguards and edge analysis.""" try: if my_probability is not None: return get_client()._request( "GET", f"/api/sdk/context/{market_id}", params={"my_probability": my_probability} ) return get_client().get_market_context(market_id) except Exception: return None def check_safeguards(context: dict) -> tuple: """Check context for safeguards. Returns (should_trade, reasons).""" if not context: return True, [] ``` ### Technical Analysis `get_market_context` catches every exception and converts the failure into `None`. `check_safeguards` then treats missing context as successful validation by returning `(True, [])`. Consequently, authentication failures, network interruptions, malformed API responses, rate limits, and server-side errors bypass the checks that normally reject: - Resolved markets - Severe flip-flop warnings - Markets close to resolution - Insufficient liquidity - Excessive expected slippage This violates the fail-safe default principle. A security or risk-control service becoming unavailable should prevent a live financial action, not authorize it. ### Attack Path 1. The operator starts the Skill with `python trader.py --live`. 2. A market generates a trading signal. 3. The request to `/api/sdk/context/{market_id}` fails because of a network error, API error, malformed response, or other exception. 4. `get_market_context` suppresses the exception and returns `None`. 5. `check_safeguards(None)` returns `(True, [])`. 6. The strategy proceeds to `execute_trade`. 7. A live order can be submitted without validating resolution status, liquidit ...[truncated 765 chars]
Remediation
View remediation
tuple: if not context: return False, ["Unable to retrieve market safety context"] ``` 2. Catch only expected SDK or network exceptions rather than using `except Exception`. 3. Log the failure type without exposing credentials or sensitive response data. 4. Require the safety response to contain all mandatory fields before live execution. 5. Distinguish dry-run behavior from live behavior if availability is important: - Dry run may continue while clearly marking safeguards as unavailable. - Live mode must reject the trade. 6. Add tests covering timeouts, authentication errors, malformed responses, empty dictionaries, resolved markets, high slippage, and missing liquidity data. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
trader.py:394
Finding

Exit logic can liquidate unrelated ETH positions

Content
View full analysis
= EXIT_THRESHOLD: found += 1 log(f" EXIT: {question} price={price:.2f} >= {EXIT_THRESHOLD:.2f}") ctx = get_market_context(market_id) ok, reasons = check_safeguards(ctx) if not ok: log(f" Skipped: {'; '.join(reasons)}") continue if not dry_run: result = execute_trade( market_id, "sell", shares, reasoning=f"Exit: price {price:.2f} >= threshold {EXIT_THRESHOLD:.2f}", ) ``` ### Technical Analysis The position filter uses an `or` condition. A position is selected when either: - Its source metadata identifies this Skill, or - Its question contains the substring `eth` The second condition is not an ownership or provenance check. It includes manually opened ETH positions and positions created by unrelated agents or strategies. Once selected, the code can sell all detected shares when the generic exit threshold is met. The Skill only needs authority to manage positions that it created. Using a question substring to authorize liquidation exceeds the minimum ...[truncated 1280 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
clawhub.json:7
Finding

High-value trading dependency is installed without version or integrity pinning

Content
View full analysis
Remediation
View remediation
" ] ``` 2. Use a lockfile or installation process with cryptographic package hashes. 3. Verify the package publisher, source repository, release provenance, and signatures where available. 4. Audit the exact SDK version before providing live credentials. 5. Review dependency updates explicitly instead of automatically accepting new releases. 6. Run the Skill in an isolated environment containing only the environment variables it strictly needs. 7. If the SDK does not require direct wallet-key access for the selected mode, do not expose `SOLANA_PRIVATE_KEY` to the process. 8. Use restricted trading credentials, account-level spending limits, and transaction alerts to reduce supply-chain impact. ]]>
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 (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented behavior materially understates the skill's actual operational reach: it can support live trading, manage and exit positions, persist configuration, and requires an additional private key not disclosed in the manifest. This mismatch is dangerous because users may authorize execution or provide credentials under false assumptions, leading to unintended financial actions and overexposure of sensitive keys.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Requesting an unrelated blockchain private key capability is a serious red flag because it grants access to sensitive signing material outside the described ETH gas/Kalshi workflow. In this context, the mismatch makes the skill more dangerous, not less, because users would have little reason to expect Solana wallet access and may unknowingly expose valuable credentials.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The top-level documentation states that the skill monitors gas price levels and trades on that basis, but the actual implementation does not do so. This mismatch is dangerous because it can mislead users, reviewers, or automation into trusting the strategy’s rationale and risk profile, especially since the skill supports live trading with real credentials and a private key.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill advertises an on-chain gas-based trading strategy, but the implemented signal is derived from keyword matching in market questions rather than any real gas-price source. In an automated live-trading context, this creates a material integrity failure: an operator may deploy capital under false assumptions, while the strategy actually trades on irrelevant or manipulable metadata instead of the claimed market signal.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill declares access to environment-based credentials but does not specify an explicit tool scope or permissions boundary. In a trading skill that uses high-value API keys and can potentially place live orders, missing capability declarations reduce transparency and make it harder for operators or policy systems to constrain secret access safely.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation says SOLANA_PRIVATE_KEY is required even though the manifest only declares SIMMER_API_KEY, creating a hidden credential requirement for a private signing key. In a financial trading context, undocumented or inconsistently declared key requirements are especially risky because users may disclose a wallet private key without appropriate review, controls, or expectation of live-trade capability.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest requests SOLANA_PRIVATE_KEY even though the stated purpose is Kalshi ETH market trading using Ethereum gas data, creating a strong capability-to-purpose mismatch. Unnecessary private key access is dangerous because it could allow unauthorized signing or theft of assets from an unrelated Solana wallet if the skill code later reads or exfiltrates that secret.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest requires a raw private key credential without any user-facing warning or disclosure, preventing informed consent for highly sensitive secret handling. Even absent proven exfiltration in this file, collecting such a credential silently increases the risk of misuse, accidental exposure, or unauthorized signing.

Content

No source excerpt is available for this finding.