Back to skill

Security audit

SimpleFunctions

Security checks for vulnerabilities and agentic risk

Overview

This skill is coherent for prediction-market trading, but it asks users to install an unaudited global CLI and connect live financial credentials without enough scoping, safety, or privacy guidance.

Review this carefully before installing. Use only credentials you are comfortable exposing to the CLI, prefer read-only or least-privilege keys where available, verify the npm package and publisher, and do not allow an agent to place trades or run natural-language trading workflows without explicit human confirmation. Treat Telegram alerts as third-party disclosure of trading-related context unless the publisher documents otherwise.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:13
Finding

Unpinned Third-Party npm Package Installed Globally

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 13–20 and 30–32
Vulnerability Type: Unpinned third-party dependency with global installation
Risk Level: Medium

Complete Code Snippet

yaml
"install":
  [
    {
      "id": "npm",
      "kind": "npm",
      "package": "@spfunctions/cli",
      "bins": ["sf"],
      "label": "Install @spfunctions/cli (npm)",
    },
  ],
bash
npm install -g @spfunctions/cli
sf setup          # Interactive configuration wizard

Technical Analysis

The installation instructions retrieve @spfunctions/cli without specifying an exact version or package integrity value. Consequently, the installed code depends on whichever release the npm registry resolves at installation time. This prevents the reviewed Skill definition from guaranteeing that users will receive a previously audited artifact.

npm packages can execute lifecycle scripts during installation unless those scripts are explicitly disabled. The documented -g option also exposes the resulting sf executable system-wide within the installing user's environment. The package implementation is not included in the audited project, so its installation scripts, credential handling, network behavior, and trading operations could not be independently reviewed.

The same document directs users to run sf setup and configure SF_API_KEY, KALSHI_API_KEY_ID, and KALSHI_PRIVATE_KEY_PATH. These credentials are legitimate for the declared functionality, but an unsafe or compromised package release could potentially access them.

Attack Path

  1. An attacker compromises the npm publisher account, package build pipeline, or a future release of @spfunctions/cli.
  2. The attacker publishes a modified package version containing a malicious lifecycle script or executable.
  3. A user follows the documented npm install -g @spfunctions/cli instruction, which resolves the compromised releas ...[truncated 1346 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin @spfunctions/cli to a specific, reviewed version rather than allowing npm to select the latest release.
  2. Record and verify the package's expected integrity hash before installation.
  3. Prefer a project-local installation governed by a committed lockfile instead of global installation.
  4. Disable npm lifecycle scripts during installation where compatible with the package, and separately review any scripts that must execute.
  5. Link to a verifiable official source repository and document how published artifacts correspond to reviewed source and builds.
  6. Run the CLI with a dedicated, least-privileged operating-system account or sandbox.
  7. Use narrowly scoped API credentials with only the permissions necessary for the requested operation. Separate read-only monitoring credentials from credentials capable of placing trades.
  8. Protect the Kalshi private key with restrictive filesystem permissions and avoid exposing secrets through command-line arguments, logs, or plaintext configuration.
  9. Require explicit human confirmation for trade execution and other irreversible financial actions.
  10. Establish package provenance verification, publisher-account protection, release signing, automated dependency scanning, and a documented credential-revocation procedure.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill exposes position, balance, orders, and trading capabilities but does not clearly warn that actions may affect a live brokerage/prediction-market account and cause real financial loss. In an agent-facing skill, omission of execution-risk guidance is especially dangerous because an autonomous or semi-autonomous user may treat examples as safe to run and place live trades unintentionally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The Telegram integration instructs users to connect a bot for alerts without warning that thesis, market, or account-related metadata may be transmitted to Telegram, a third-party service. This can expose sensitive trading interests or behavioral signals, and in agentic workflows may leak proprietary strategy context beyond the local environment.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.