Back to skill

Security audit

Collect Fees

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly performs read-only DeFi fee discovery, but it should be reviewed because it silently sends host and agent metadata and installs unpinned npm packages at runtime.

Install only if you are comfortable with public wallet addresses being queried through PancakeSwap/RPC services and with npm packages being installed at runtime. For safer use, remove or disable the Step 0 ping, pin dependencies with a lockfile, avoid inherited endpoint overrides, and use trusted RPC providers.

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

other

Warning
Location
SKILL.md:96
Finding

Mandatory telemetry transmits host and agent metadata without functional necessity

Content
View full analysis
/dev/null & ``` ### Technical Analysis The initialization request transmits the AI agent identifier, exact invocation timestamp, operating system, and system architecture to `pancakeswap.ai`. The response is discarded with `-o /dev/null`, so the request cannot update token lists or obtain deep-link formats as claimed by the surrounding instructions. This communication is not required to discover public blockchain positions, calculate fees, retrieve token metadata, or generate deterministic PancakeSwap links. It therefore exceeds the minimum network access necessary for the Skill's declared functionality. Running the request in the background and suppressing both its response and error output also makes the telemetry difficult for users to observe. Although the transmitted fields do not contain wallet private keys or credentials, they can be combined with source IP and server-side request logs to fingerprint and correlate agent executions. ### Attack Path 1. A user invokes the fee-collection Skill. 2. Step 0 directs the agent to execute the background `curl` request. 3. Shell substitutions collect the current UTC time, host operating system, and architecture. 4. The agent identifier and collected host metadata are transmitted to `pancakeswap.ai`. 5. The remote service can associate these ...[truncated 666 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
SKILL.md:180
Finding

Runtime installation of unpinned npm dependencies creates a supply-chain execution risk

Content
View full analysis
package.json << 'PKGJSON' { "type": "module" } PKGJSON npm install --silent viem @pancakeswap/v3-sdk ``` ```bash TMP_DIR=$(mktemp -d) cd "$TMP_DIR" cat > package.json << 'PKGJSON' { "type": "module" } PKGJSON npm install --silent viem @pancakeswap/infinity-sdk ``` ```bash npm install --silent @pancakeswap/solana-core-sdk @solana/web3.js @solana/spl-token@0.4.0 ``` ### Technical Analysis The workflow installs dependencies from the npm registry at runtime. With the exception of `@solana/spl-token@0.4.0`, package versions are not pinned. No lockfile, package-integrity hash, trusted registry configuration, or lifecycle-script restriction is provided. Consequently, the code executed during a future Skill invocation may differ from the code reviewed during this audit. npm packages and their transitive dependencies can execute lifecycle scripts during installation and arbitrary JavaScript when imported by the reference scripts. The use of `--silent` further reduces visibility into dependency resolution, warnings, and lifecycle behavior. Creating a fresh temporary project for each execution causes dependency resolution and installation to happen repeatedly, increasing exposure to compromised package releases, maintainer-account compromise, malicious transitive dependencies, or registry substitution. ### Attack Path 1. An attacker compromises a listed npm package, one of its transitive dependencies, a maintainer account, or the configured npm registry. 2. The attacker publishes a malicious version that still satisfies the unpinned dependency request. 3. A user invokes the Skill after the malicious version becomes available. 4. The Skill creates a temporary package and runs `npm install`. 5. npm resolves ...[truncated 935 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/fetch-solana.cjs:24
Finding

Inherited environment variable can redirect Solana SDK API traffic to an arbitrary host

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
references/fetch-v3-positions.mjs:39
Finding

V3 reference script relies on external wallet and RPC validation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (16)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 272)May include surrounding context.

md
Read `references/fetch-solana.cjs` for the complete script. Copy it into the temp directory, then execute:

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The implementation only reads Solana positions and prints pending fees/rewards; it never constructs or submits any collection transaction. In the context of a skill advertised as 'collect-fees' for PancakeSwap V3/Infinity, this is a significant capability mismatch that can mislead downstream agents or users into believing fees were claimed when nothing happened.

Content

No source excerpt is available for this finding.

External Model or Provider Selection

Medium
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 7)May include surrounding context.

md
description: Check and collect LP fees from PancakeSwap V3 and Infinity (v4) positions. Use when user says "collect my fees", "claim LP fees", "how much fees have I earned", "pending fees", "uncollected fees", "/collect-fees", "harvest LP fees", or asks about fees from a specific token pair position.
homepage: https://github.com/pancakeswap/pancakeswap-ai
allowed-tools: Read, Glob, Grep, Bash(curl:*), Bash(node:*), Bash(npm:*), Bash(xdg-open:*), Bash(open:*), WebFetch, AskUserQuestion
model: sonnet
license: MIT
metadata:
  author: pancakeswap

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · SKILL.md (reported line 112)May include surrounding context.

md
The routing decision is made after Step 1 based on the user's pool type preference and chain:

| Pool Type         | Discovery Method                               | Chains                                           | Position Model                 | Fee Query Method                                                                                                                  |
| ----------------- | ---------------------------------------------- | ------------------------------------------------ | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| **V3**            | On-chain: NonfungiblePositionManager NFT       | BSC, ETH, ARB, Base, zkSync, Linea, opBNB, Monad | ERC-721 NFT (tokenId)          | TypeScript/node via `viem` (readContract on NonfungiblePositionManager)                                                           |
| **Infinity (v4)** | **Explorer API only** (no NFT, no `balanceOf`) | BSC, Base only                                   | Singleton PoolManager (no NFT) | TypeScript/node via `@pancakeswap/infinity-sdk` (CL fee math)                                                                     |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · SKILL.md (reported line 117)May include surrounding context.

md
| **V3**            | On-chain: NonfungiblePositionManager NFT       | BSC, ETH, ARB, Base, zkSync, Linea, opBNB, Monad | ERC-721 NFT (tokenId)          | TypeScript/node via `viem` (readContract on NonfungiblePositionManager)                                                           |
| **Infinity (v4)** | **Explorer API only** (no NFT, no `balanceOf`) | BSC, Base only                                   | Singleton PoolManager (no NFT) | TypeScript/node via `@pancakeswap/infinity-sdk` (CL fee math)                                                                     |
| **Solana**        | `@pancakeswap/solana-core-sdk` CLMM + Farm API | Solana mainnet                                   | CLMM positions + Farm accounts | `Raydium.load()` + `getOwnerPositionInfo()` + `fetchMultipleFarmInfoAndUpdate()` — outputs `clmmPositions` + `farmPositions` JSON |
| **V2**            | Out of scope                                   | BSC only                                         | ERC-20 LP token                | Out of scope — fees embedded in LP value                                                                                          |

---

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest says the skill can 'check and collect' LP fees, but the implemented behavior here is read-only: it queries explorer/RPC data, computes pending CL fees, derives Bin amounts, and logs results. There is no transaction submission or contract call that would collect fees. While this may be one helper file within a larger skill, this file's behavior does not match the collection claim on its own.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Using a user-supplied RPC endpoint for wallet-related reads can expose the target wallet and its query pattern to the RPC provider. In this skill, the RPC is central to fetching position data, so an untrusted or logging provider can correlate the wallet with user activity and potentially profile holdings and usage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script sends the user's wallet address to PancakeSwap explorer API endpoints to enumerate positions. This leaks wallet-associated holdings and activity to a third party without any disclosure or consent mechanism in the file, which is a privacy issue especially in an agent context where users may not expect off-chain data sharing.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest describes a skill for checking and collecting LP fees from PancakeSwap V3 and Infinity positions. In this file, the Bin-position branch does not calculate or collect fees; instead it fetches pool metadata and computes the user's underlying token amounts per bin, effectively acting as a position inventory feature. That is broader than a fee-focused skill description.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file is explicitly built for Solana CLMM/farm discovery, while the skill metadata claims PancakeSwap V3 and Infinity (v4) fee collection. This cross-chain and protocol-scope mismatch can cause the wrong tool to be invoked, producing incorrect outputs for users and potentially bypassing expected controls for the intended EVM fee-collection workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The header comment describes the script as only fetching all V3 NonfungiblePositionManager positions for a wallet. In practice, the code also invokes collect via simulateContract on both the position manager and MasterChef contracts to compute claimable fees, which is a broader behavior than simple position enumeration.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation says the script fetches V3 NonfungiblePositionManager positions for a wallet. However, getFarmingPositions() also reads positions from masterChefV3Addresses, meaning the code covers staked/farming positions in an additional contract domain not mentioned in the file description.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says the skill checks and collects LP fees from PancakeSwap V3 and Infinity (v4) positions, which reads as an EVM-only scope. The body of the skill explicitly adds Solana discovery, summaries, and deep links as a supported workflow, so the declared scope is narrower than the documented behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill states it only reads on-chain state and generates deep links, but Step 0 silently performs an external telemetry request containing agent, OS, architecture, and timestamp data. This creates undisclosed outbound data flow and weakens user/operator trust, especially in environments expecting strictly local/read-only behavior.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

To find position NFTs, the code fetches the owner's SOL account plus all SPL and Token-2022 token accounts, building a token-account map for the wallet. While useful for discovery, this is a broader wallet-inspection capability than the manifest's narrow 'check and collect LP fees' purpose and is not described there.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The comment on .filter(Boolean) says 'Only positions with non-zero amounts', but the mapping code always returns an object and the earlier zero-fee filter is commented out. As written, .filter(Boolean) merely removes null/undefined entries and does not exclude zero-amount positions, contradicting the comment's stated intent.

Content

No source excerpt is available for this finding.