Back to skill

Security audit

Superfluid Protocol

Security checks for vulnerabilities and agentic risk

Overview

This Superfluid knowledge-base skill is broadly coherent, but it includes under-controlled runtime package execution and high-impact financial approval guidance that users should review before installing.

Install only if you are comfortable using this as blockchain developer guidance. Pin and review any bunx/npx packages before running helper scripts, run them without wallet secrets or sensitive environment variables, verify contract addresses independently, prefer simulations and readable signing paths, and avoid unlimited token approvals unless you understand the standing allowance risk.

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
references/guides/scripts.md:5
Finding
Unpinned Third-Party Packages Are Downloaded and Executed at Runtime<![CDATA[ ## Vulnerability Details **File Location**: `references/guides/scripts.md:5-16` **Additional Locations**: `references/guides/scripts.md:34-40,64-66,83-94`; `scripts/abi.mjs:7-9`; `scripts/balance.mjs:7,11`; `scripts/metadata.mjs:7-18`; `scripts/selectors.mjs:7-13,286-288`; `scripts/tokenlist.mjs:7-15` **Vulnerability Type**: Unpinned runtime dependency execution **Risk Level**: Medium ### Vulnerable Code ```markdown **runtime data** (what to call it on) by importing canonical npm packages directly. No npm install required — use `bunx -p <pkg> bun script.mjs` to resolve packages at runtime. All scripts are in `skills/superfluid/scripts/`. --- ## ABI JSON — `abi.mjs` Source: [`@sfpro/sdk`](https://sdk.superfluid.pro/docs) package. ``` bunx -p @sfpro/sdk bun abi.mjs <contract> Full JSON ABI bunx -p @sfpro/sdk bun abi.mjs <contract> <function> Single fragment by name bunx -p @sfpro/sdk bun abi.mjs list All contracts with SDK import info ``` ``` The same pattern is used for other dependencies, including: ```bash bunx -p @superfluid-finance/tokenlist bun tokenlist.mjs ... bunx -p @superfluid-finance/metadata bun metadata.mjs ... bunx -p @sfpro/sdk -p js-sha3 bun selectors.mjs ... bunx @foundry-rs/cast ``` ### Technical Analysis The Skill explicitly directs users or agents to use `bunx` to resolve packages from a public package registry at execution time. No exact package versions, lockfile, integrity hashes, or immutable package artifacts are specified. The scripts then import code from those downloaded packages, for example: ```javascript import { extendedSuperTokenList } from "@superfluid-finance/tokenlist"; import metadata from "@superfluid-finance/metadata"; import { keccak256 } from "js-sha3"; ``` Consequently, the code that runs is not limited to the content reviewed in this Skill. Package initialization code and transitive dependencies may execute with the permissions of the invoking user. The effec ...[truncated 1957 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Pin every runtime dependency to an exact audited version.** ```bash bunx -p @sfpro/sdk@1.2.3 bun abi.mjs ... bunx -p @superfluid-finance/tokenlist@1.2.3 bun tokenlist.mjs ... bunx -p @superfluid-finance/metadata@1.2.3 bun metadata.mjs ... bunx -p js-sha3@0.9.3 bun selectors.mjs ... ``` Replace example versions with versions that have been reviewed and approved. 2. **Prefer a committed dependency manifest and lockfile.** Add a `package.json` and `bun.lock` or another supported immutable lockfile, and execute scripts using dependencies installed from that lockfile rather than resolving packages dynamically for every invocation. 3. **Use frozen-lockfile installation.** ```bash bun install --frozen-lockfile ``` Configure automation to fail if dependency resolution would modify the lockfile. 4. **Verify package integrity and provenance.** Record expected package integrity hashes, verify registry provenance where available, and review package ownership and release history before upgrades. 5. **Review transitive dependencies.** Automated dependency scanning should cover the complete resolved dependency tree rather than only the directly imported packages. 6. **Control upgrades.** Process dependency updates through reviewed pull requests with lockfile diffs, release-note review, and tests that validate known contract addresses, ABI fingerprints, and selector output. 7. **Reduce execution privileges.** Run these utilities in a sandbox or container without wallet files, private keys, sensitive environment variables, SSH credentials, or unnecessary filesystem write access. 8. **Correct the documentation.** Remove statements implying that runtime package resolution is inherently safe because no explicit installation is required. Clearly disclose that `bunx` downloads and executes third-party code. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (31)

Ae1

High
Category
analysis-evasion
Content
**Investigating (one-off):** Scripts (`tokenlist.mjs`, `metadata.mjs`, `balance.mjs`, `cast call`). ABI source: `scripts/abi.mjs`. Addresses: `scripts/metadata.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Investigating (one-off):** Scripts (`tokenlist.mjs`, `metadata.mjs`, `balance.mjs`, `cast call`). ABI source: `scripts/abi.mjs`. Addresses: `scripts/metadata.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Investigating (one-off):** Scripts (`tokenlist.mjs`, `metadata.mjs`, `balance.mjs`, `cast call`). ABI source: `scripts/abi.mjs`. Addresses: `scripts/metadata.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Investigating (one-off):** Scripts (`tokenlist.mjs`, `metadata.mjs`, `balance.mjs`, `cast call`). ABI source: `scripts/abi.mjs`. Addresses: `scripts/metadata.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Investigating (one-off):** Scripts (`tokenlist.mjs`, `metadata.mjs`, `balance.mjs`, `cast call`). ABI source: `scripts/abi.mjs`. Addresses: `scripts/metadata.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Investigating (one-off):** Scripts (`tokenlist.mjs`, `metadata.mjs`, `balance.mjs`, `cast call`). ABI source: `scripts/abi.mjs`. Addresses: `scripts/metadata.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Memory Manipulation

High
Category
Memory Poisoning
Content
- **ω preserves conservation** — the sum of all MUD deltas from any single ω
  invocation is zero. This is the per-operation zero-sum guarantee.
- **Agreement contracts are MUD** (they provide balance via π) but are **not**
  Semigroups — they replace state rather than merging. Only per-account MUD is
  a Semigroup.

### Lens Accessors
Confidence
85% confidence
Finding
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The manifest explicitly recommends `type(uint256).max` approval for the strategy contract, which exposes users to unlimited ERC-20 spend if that strategy is buggy, later compromised, maliciously upgraded, or incorrectly approved by the manager owner. In this skill context, the risk is more significant because the document is operational guidance for real deployed contracts, so users may follow it verbatim and grant standing authority over their underlying tokens far beyond any single wrap operation.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
This manifest documents functions that can create, update, and delete token streams and grant or revoke operator permissions, but it does not prominently warn users that these actions can move funds continuously or delegate powerful control over their flows. In a wallet, agent, or UI context, a consumer of this YAML could present these methods as routine operations without sufficient risk framing, increasing the chance of unsafe approvals or unintended destructive actions.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Content
stopFunding:
  # Stops funding by deleting the treasury flow and subsidy flow.
  # Compensates for unused funds by transferring remaining amounts back.
  # Anyone can call this — no access restriction.
  notes:
    - "Gotcha: Can only be called within the EARLY_PROGRAM_END window before the end date."
  mutability: nonpayable
Confidence
75% confidence
Finding
Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The file states that FaceTec-based face verification is used and that periodic re-verification is required, which is privacy-sensitive handling of biometric data. While it notes anonymous facial-hash storage, it does not clearly warn users about the sensitivity of biometric collection or its implications in a user-facing cautionary way.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The description says GoodID uses Amazon Rekognition for age and gender prediction and uses IP/phone for location, which can materially affect user privacy. Although it says opt-in is required, it does not include a clear warning about the sensitivity of these data sources or the consequences of participating.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Intent-Code Divergence

Medium
Confidence
94% confidence
Finding
The document makes a materially misleading security claim by stating the contracts are 'non-custodial' and 'do not hold funds themselves' while elsewhere acknowledging that TOREX accumulates user in-tokens before execution. Even if the custody is temporary and automated, users and integrators may incorrectly downgrade smart-contract, insolvency, or operational risk, which can lead to unsafe reliance on the system.

External Transmission

Medium
Category
Data Exfiltration
Content
// ... build encodedPayload, types, and sign as in self-submit steps 4–6

// 4. Submit to relay
const relayRes = await fetch(
  'https://clearmacro-provider.superfluid.dev/v1/relay-executions',
  {
    method: 'POST',
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The Solidity example explicitly reverts unless `lang == bytes32("en")`, which enforces a single language and demonstrates a locale restriction. The surrounding documentation presents `lang` as a localization mechanism, but this example offers no user opt-in or justification for limiting support to English only.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The primary execution example shows how to call BlindMacroForwarder directly, but the nearby flow does not prominently warn that the wallet will present opaque calldata that users cannot meaningfully verify. In a security-sensitive blockchain context, normalizing direct execution of a legacy blind-signing flow increases the chance that integrators and end users approve malicious or unintended macro behavior, especially because macros are permissionless and can compose arbitrary batch operations.

Unbounded Resource Access

Medium
Category
Excessive Agency
Content
`Host.allowCompositeApp(targetApp)`.

`MAX_APP_CALLBACK_LEVEL` is **1**, meaning at most two Super Apps in a chain
(SECOND → FINAL). This prevents unbounded callback recursion.

If a SECOND-level app calls a non-whitelisted Super App, the transaction
reverts with `APP_RULE` code 30 (`COMPOSITE_APP_IS_NOT_WHITELISTED`).
Confidence
80% confidence
Finding
Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

External Transmission

Medium
Category
Data Exfiltration
Content
Base Mainnet and Base Sepolia **only**. These are Goldsky-hosted endpoints (not the standard `subgraph-endpoints.superfluid.dev` pattern):

- Base Mainnet (8453): `https://api.goldsky.com/api/public/project_clsnd6xsoma5j012qepvucfpp/subgraphs/sup/v2/gn`
- Base Sepolia (84532): `https://api.goldsky.com/api/public/project_clsnd6xsoma5j012qepvucfpp/subgraphs/sup_test/latest/gn`

---
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
Base Mainnet and Base Sepolia **only**. These are Goldsky-hosted endpoints (not the standard `subgraph-endpoints.superfluid.dev` pattern):

- Base Mainnet (8453): `https://api.goldsky.com/api/public/project_clsnd6xsoma5j012qepvucfpp/subgraphs/sup/v2/gn`
- Base Sepolia (84532): `https://api.goldsky.com/api/public/project_clsnd6xsoma5j012qepvucfpp/subgraphs/sup_test/latest/gn`

---
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Vague Triggers

Low
Confidence
77% confidence
Finding
This YAML file describes the contract and its behavior but does not define any explicit trigger phrases, invocation conditions, or exclusion criteria for when a related skill should activate. For manifest-style files, that absence can make downstream activation logic ambiguous if this metadata is used to determine when the skill applies.

Vague Triggers

Low
Confidence
79% confidence
Finding
This YAML file describes a skill-facing contract artifact but does not define any explicit trigger phrases, invocation boundaries, or exclusion conditions for when an agent should use it. For manifest-scoped files, the absence of activation specificity can lead to overly broad or unintended use if the surrounding system treats this metadata as skill-discovery input.

Static analysis

No suspicious patterns detected.