Back to skill

Security audit

Polymarket Quant Trader

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Polymarket trading guide, but it directs users toward unaudited external bot code, raw wallet-key handling, and automated trading workflows that need careful review before use.

Install only if you are prepared to audit the separate bot repository and dependencies before running npm install or adding any secrets. Use a dedicated low-balance wallet, keep DRY_RUN enabled until verified, avoid storing raw private keys in the repo, restrict any exchange API keys, and manually review every live trade or strategy change.

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)

T08 · Insecure Dependencies

Error
Location
README.md:16
Finding

Unauditable External Repository and Unsafe Dependency Installation Workflow

Content
View full analysis
cd polymarket-bot npm install cp .env.example .env ``` ### Technical Analysis The audited package does not include the advertised trading bot, its `package.json`, a dependency lockfile, or its TypeScript source. Instead, users are directed to clone an unspecified repository supplied after purchase and execute `npm install`. The repository URL, owner, revision, release digest, and dependency versions are not pinned in the reviewed material. Consequently, the code ultimately installed and executed can differ from the content reviewed during this audit. In addition, `npm install` can execute package lifecycle scripts such as `preinstall`, `install`, and `postinstall`, giving dependencies an opportunity to run arbitrary commands with the invoking user's privileges. This is a supply-chain risk rather than proof that the external repository is malicious. The absence of the repository and dependency metadata prevents verification of the executable component advertised by the Skill. ### Attack Path 1. A user installs the documentation-only Skill and receives a mutable external repository URL after purchase. 2. The repository, one of its dependencies, or a dependency release is compromised or replaced. 3. The user runs `npm install` as instructed. 4. A malicious npm lifecycle script executes under the user's local account. 5. The script can read files accessible to that account, alter the bot, access subsequently configured environment secrets, or establish unauthorized network communication. 6. When the user runs the trading bot, modified code may submit unauthorized transactions or disclose credentials. ### Impact Assessment Successful exploitation would obtain the privileges of the user ...[truncated 545 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:449
Finding

Plaintext Wallet Private Key and Exchange Credential Configuration

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/brier-score-explained.md:38
Finding

Invalid Brier-Score Calculation Can Corrupt Automated Trading Optimization

Content
View full analysis
{ const outcome = p.resolvedYes ? 1 : 0; return sum + Math.pow(p.ourProbability - outcome, 0.2); }, 0) / predictions.length; ``` ### Technical Analysis The same document correctly defines the Brier score as: ```text Brier = mean((predicted_probability - actual_outcome)^2) ``` However, the purported implementation raises the prediction error to `0.2` rather than `2`. This has two serious correctness consequences: 1. Positive errors are transformed using a fifth-root-like operation rather than squared error, so the result is not a Brier score. 2. For a negative base, JavaScript's `Math.pow(base, 0.2)` generally returns `NaN` because the exponent is fractional. Predictions for resolved-YES outcomes commonly produce negative values for `ourProbability - 1`. The Skill states that this score controls an automated hill-climbing optimizer that retains or reverts strategy mutations and may deploy the resulting strategy. A non-finite or mathematically invalid objective can therefore corrupt model selection and invalidate reported performance claims. The executable `research/evaluate.ts` file was not supplied, so the audit cannot determine whether the external implementation contains the same defect or whether this is limited to documentation. ### Attack Path 1. The evaluation set contains a resolved-YES market with `ourProbability` below `1`. 2. The expression `p.ourProbability - outcome` becomes negative. 3. `Math.pow(negativeValue, 0.2)` produces `NaN`. 4. The aggregate Brier score becomes `NaN`, or otherwise fails to represent squared prediction error. 5. Optimizer comparisons no longer reliably determine whether a mutation improved the strategy. ...[truncated 736 chars]
Remediation
View remediation
{ const outcome = p.resolvedYes ? 1 : 0; const error = p.ourProbability - outcome; return sum + Math.pow(error, 2); }, 0) / predictions.length; ``` 2. Validate that every probability is finite and within `[0, 1]`. 3. Reject empty prediction arrays to avoid division by zero. 4. Reject optimizer results when the score is `NaN`, infinite, or outside the valid Brier range `[0, 1]`. 5. Add unit tests using known examples for both YES and NO resolutions. 6. Compare the implementation against an independently calculated reference score. 7. Prevent automatic checkpointing or live deployment unless all metric-validation tests pass. 8. Recompute all historical performance claims and optimizer checkpoints after applying the correction. 9. Keep live trading disabled until corrected results have passed out-of-sample and paper-trading validation. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (3)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 20)May include surrounding context.

git clone cd polymarket-bot npm install cp .env.example .env

text

4. Configure your `.env` with wallet keys and risk parameters (see SKILL.md Setup Guide)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list is broad enough to activate on many generic finance or betting-related requests, which can cause the skill to run outside the user's precise intent. In this skill's context, unintended activation is more concerning because the skill is oriented toward trading, wallet usage, and automated decision support, so accidental invocation could lead users toward risky financial actions or disclosure of sensitive configuration details.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file defines Brier score correctly as mean squared error, but the example implementation raises the error term to 0.2 instead of 2. This silently changes the optimization objective used by the trading/research system, making model evaluation and parameter tuning inconsistent with the documented metric and likely distorting calibration judgments and position sizing decisions.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.