Back to skill

Security audit

solana-light-token-client

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed developer cookbook for Solana Light Token operations, with meaningful wallet and transaction cautions users should handle carefully.

Install only from a source you trust, preferably after pinning or verifying the repository version. Treat all examples as transaction-signing code: use a devnet or dedicated test wallet, avoid production keypairs and funded mainnet accounts, verify RPC endpoints and API keys, and review any approve, burn, freeze, wrap, unwrap, transfer, or close-account operation before execution.

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:115
Finding
Unpinned Code Execution Through npx and Mutable Repository Content## Vulnerability Details **File Location**: `SKILL.md:115` **Vulnerability Type**: Supply-chain exposure through unpinned executable dependencies **Risk Level**: Medium ### Vulnerable Code ```markdown - **Install source.** `npx skills add Lightprotocol/skills` installs from the public GitHub repository ([Lightprotocol/skills](https://github.com/Lightprotocol/skills)). Verify the source before running. ``` ### Technical Analysis The documented command invokes `npx`, which may retrieve and execute the currently resolved version of the `skills` npm package. It then installs Skill content from the mutable `Lightprotocol/skills` repository reference. Neither the executable npm package nor the repository content is pinned to a reviewed version, immutable commit, or integrity hash. Consequently, the code and instructions executed or installed when a user follows this command can differ from those reviewed during this audit. The warning to verify the source does not provide a concrete integrity-verification mechanism and does not prevent dependency substitution or later upstream compromise. ### Attack Path 1. An attacker compromises the npm package used by `npx`, the upstream repository, a maintainer account, or the relevant publishing workflow. 2. The attacker publishes malicious installation behavior or modifies the repository content referenced by `Lightprotocol/skills`. 3. A user follows the documented `npx skills add Lightprotocol/skills` command. 4. `npx` resolves and executes the mutable package version, which retrieves or installs the current upstream content. 5. Malicious installer code may execute with the privileges of the invoking user, or malicious Skill instructions may be installed and subsequently loaded by the agent. ### Impact Assessment Successful exploitation could permit arbitrary code execution with the invoking user's privileges during installation. Depending on the user's environment, this may expose accessible files, environment varia ...[truncated 310 chars]
Remediation
## Remediation Suggestions 1. Pin the `skills` npm package to a reviewed exact version rather than allowing `npx` to resolve the latest release. 2. Pin `Lightprotocol/skills` to a reviewed immutable Git commit or signed release tag. 3. Configure `npx` to avoid implicit package installation where possible, and install the verified tool separately using a locked dependency manifest. 4. Verify package integrity using a lockfile and registry integrity hash. 5. Verify repository signatures or commit hashes before loading installed Skill content. 6. Document the exact expected package version, repository commit, and verification commands. 7. Perform installation in a restricted environment without production wallet files or sensitive environment variables. 8. Re-audit the installed files after retrieval and before loading them into an agent session.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Session Persistence

Medium
Category
Rogue Agent
Content
---
name: light-token-client
description: "For client development with tokens on Solana, Light Token is 200x cheaper than SPL and has minimal changes. Skill includes guides for create mints, associated token accounts, transfer, approve, burn, wrap, and more. @lightprotocol/compressed-token (TypeScript) and light_token_client (Rust)."
metadata:
  source: https://github.com/Lightprotocol/skills
  documentation: https://www.zkcompression.com
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding
The skill instructs installation via `npx skills add Lightprotocol/skills` without pinning a specific version, commit, or immutable source. This creates a supply-chain risk: if the referenced package or fetched content changes or is compromised, users may execute unintended code or install altered skill definitions.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
This is a markdown file, so SQP-2 applies to omissions in user-facing safety warnings. Although the text states that approval delegates token spending authority and overwrites the previous delegate, it does not explicitly warn users that running the examples changes account authorization and could affect control over token funds.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The example demonstrates a destructive on-chain operation that permanently closes a token account and returns rent, but it does not clearly warn users about the irreversible effect or emphasize all operational prerequisites beyond a brief inline comment. In a developer skill, this can lead to accidental closure of the wrong account, confusion about account recovery, or unsafe copy-paste use in production-like environments.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
This markdown file includes code that loads the user's private key material from ~/.config/solana/id.json, which is sensitive credential access. The surrounding description does not warn the user that the example consumes local wallet secrets or that they should use an appropriate keypair for the environment.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The sample performs a blockchain operation by creating and submitting a transaction via an RPC endpoint, which can affect on-chain state and transmit wallet-associated data. The markdown description explains the function of the PDA but does not explicitly warn that running the snippet will submit a live transaction on devnet/localnet.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
This example again accesses ~/.config/solana/id.json to construct the payer keypair, which is sensitive credential use. The markdown does not disclose this behavior or caution users about private key exposure and environment selection.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The code constructs and sends a transaction with sendAndConfirmTransaction, which is a state-changing network action. The markdown does not clearly warn that executing the snippet will broadcast a transaction and create the interface PDA on the selected network.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The example directly loads a private key from the user's default Solana keypair file in their home directory without any warning or safer alternative. In documentation, this is dangerous because readers may copy-paste it against a real wallet, exposing signing authority to unintended transactions or encouraging insecure secret-handling practices in application code.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The example reads a private Solana keypair from the default local wallet path and uses an API key from the environment without any warning, isolation guidance, or recommendation to use test-only credentials. In a copy-paste oriented developer guide, this can lead users to run sample code against real wallets or paid RPC endpoints, risking unintended asset movement, credential exposure in logs or screenshots, and misuse of privileged local key material.

Static analysis

No suspicious patterns detected.