T09 · Insecure Skill Coding Practices
- Location
SKILL.md:605- Finding
Blind Signing of a Remotely Supplied Jupiter Transaction
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This DeFi skill is purpose-aligned, but it gives an agent high-impact wallet signing authority and includes under-scoped swap and transaction verification guidance.
Review before installing. Use only a dedicated Solana wallet with limited funds, require explicit approval immediately before every signature, avoid exposing a main private key, and do not let the agent sign Jupiter swap transactions unless it decodes and verifies the transaction against the approved quote. Be aware that wallet portfolio lookups disclose your wallet address and holdings to ai.0.xyz.
SKILL.md:605Blind Signing of a Remotely Supplied Jupiter Transaction
SKILL.md:268Wallet Identity and Portfolio Disclosure to a Remote Service
SKILL.md:605Swap Example Reports Success Without Checking Program-Level Failure
The skill instructs the agent to locate a wallet keypair path from user input or .env and read the secret key file directly from disk. In an agent setting, this is highly sensitive credential access: if the skill is invoked broadly or the environment is shared, the agent may load and use private keys with minimal isolation, increasing the blast radius of compromise or misuse.
import { Keypair } from "@solana/web3.js";
import fs from "fs";
// keypairPath from user message, or WALLET_KEYPAIR from .env
const wallet = Keypair.fromSecretKey(
Uint8Array.from(JSON.parse(fs.readFileSync(keypairPath, "utf-8"))),
);
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
import { Connection } from "@solana/web3.js";
import { Project0Client, getConfig } from "@0dotxyz/p0-ts-sdk";
// RPC_URL from .env or provided by user
const connection = new Connection(RPC_URL, "confirmed");
const config = getConfig("production");
const client = await Project0Client.initialize(connection, config);
The skill directs the agent to retrieve a Jupiter API key from .env or user input and use it in outbound requests. While less sensitive than a wallet private key, this is still credential handling by the agent and can lead to unauthorized third-party API usage, billing abuse, or accidental exposure through logs or error messages.
import { VersionedTransaction } from "@solana/web3.js";
// JUP_API_KEY from .env or provided by user
const inputMint = "So11111111111111111111111111111111111111112"; // SOL
const outputMint = "Bybit2vBJGhPF52GBdNaQfUJ6ZpThSgHBobjWZpLPb4B"; // bbSOL
const amount = 100000000; // raw integer units (0.1 SOL = 100000000 lamports)
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
Deposit funds to earn yield across Solana's highest-yielding venues.
Borrow stablecoins against deposited collateral instead of selling crypto.
Execute advanced yield strategies via rate arbitrage and looping.
All operations are on-chain and permissionless -- no accounts, no approval process.
Note: This skill requires a wallet keypair to sign transactions. Use a dedicated
wallet with limited funds -- never expose your main private key. The agent will
always ask for confirmation before signing. Read-only operations need no keypair.
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.
## On-Chain: Interacting with the Protocol
Use the TypeScript SDK for actions that require signing: create account, deposit,
withdraw, borrow, repay. Requires a Solana keypair and user authorization.
### Prerequisites
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
console.log(Success: https://solscan.io/tx/${sig});
**Never report a transaction as successful without checking
`confirmation.value.err`.** If `err` is not null, the transaction landed
on-chain but the program rejected it — the user's funds were not moved.
The skill explicitly warns elsewhere that confirmTransaction does not guarantee program success, but the Jupiter swap example still reports success immediately after confirmation without checking confirmation.value.err. This can cause the agent to misreport failed swaps as successful, leading to incorrect follow-on actions such as depositing assets that were never received.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
// 1. Get quote
const quoteResponse = await (
await fetch(
`https://api.jup.ag/swap/v1/quote?inputMint=${inputMint}` +
`&outputMint=${outputMint}` +
`&amount=${amount}` +
`&slippageBps=50` +
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
// 1. Get quote
const quoteResponse = await (
await fetch(
`https://api.jup.ag/swap/v1/quote?inputMint=${inputMint}` +
`&outputMint=${outputMint}` +
`&amount=${amount}` +
`&slippageBps=50` +
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
// 2. Build swap transaction
const swapResponse = await (
await fetch("https://api.jup.ag/swap/v1/swap", {
method: "POST",
headers: {
"Content-Type": "application/json",