T09 · Insecure Skill Coding Practices
- Location
scripts/save_config.sh:27- Finding
JavaScript Code Injection Through the Wallet Owner Argument
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This payment skill is mostly coherent with its stated Solana purpose, but its scripts handle payment and wallet inputs in unsafe ways that could allow local code execution or unintended transfers.
Install only after the publisher replaces inline node -e/ts-node -e code with checked-in scripts that parse arguments safely, pins dependencies with a lockfile, validates recipient and amount before loading the keypair, protects the keypair with restrictive permissions or a safer signer, and adds clear operator controls such as dry-run, confirmation, and spending-policy guidance.
scripts/save_config.sh:27JavaScript Code Injection Through the Wallet Owner Argument
scripts/execute_payment.sh:34Arbitrary JavaScript Execution Through Payment Arguments
scripts/execute_payment.sh:34Unpinned Runtime Package Execution Through npx
The skill explicitly states that the agent generates and stores a Solana keypair locally in .safeflow/agent-keypair.json, but it provides no guidance on secure storage, filesystem permissions, encryption, rotation, or avoiding accidental exposure through logs, backups, or source control. Because this key authorizes spending within the session cap, compromise of the local private key could let an attacker execute unauthorized payments up to the configured limits.
Using npx ts-node without pinning an exact version allows the script to resolve and execute whatever package version is available from the local environment or registry at runtime. In a payment-execution skill, this creates a supply-chain execution risk: a malicious or compromised ts-node package could run arbitrary code, exfiltrate the Solana keypair loaded from config.keypairPath, or alter payment behavior before the transfer is submitted.
The script performs a real on-chain payment immediately after parsing CLI arguments, with no interactive confirmation, preview, or secondary approval step. In the context of an autonomous payment skill that holds a usable keypair and session budget, operator error, prompt/agent misuse, or parameter tampering could cause irreversible transfers to an unintended recipient.