T09 · Insecure Skill Coding Practices
- Location
scripts/wallet.js:7- Finding
Live Wallet Operations Are Executed by the Package Test Command
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Lightning payments skill is mostly purpose-aligned, but it includes under-disclosed live wallet operations that can move real funds, including through the package test command.
Review before installing. Use only a dedicated Alby NWC connection with strict spending limits, do not run npm test, and treat ALBY_NWC_URL as a wallet-spending secret. The undocumented scripts/wallet.js should be removed or made non-spending before trusting this package in an agent workflow.
scripts/wallet.js:7Live Wallet Operations Are Executed by the Package Test Command
send_sats.mjs:58LNURL Requests Can Reach Private Networks Through DNS Resolution or Rebinding
send_sats.mjs:20Payment Amounts Use Unsafe Floating-Point Integer Conversion
The script initiates real outgoing Lightning payments programmatically via both invoice payment and Lightning address payment with no confirmation, authorization gate, recipient validation, or spending limit. In an agent or automation context, this can directly cause unauthorized fund transfers if the script is triggered unexpectedly, supplied attacker-controlled payment details, or run with a wallet that has available balance.
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.
mkdir -p ~/.openclaw/workspace/skills/alby-lightning
cd ~/.openclaw/workspace/skills/alby-lightning
npm init -y
npm install @getalby/sdk
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.
mkdir -p ~/.openclaw/workspace/skills/alby-lightning
cd ~/.openclaw/workspace/skills/alby-lightning
npm init -y
npm install @getalby/sdk
The script directly pays any BOLT11 invoice provided on the command line as soon as it is invoked, with no explicit confirmation, amount display, recipient verification, or policy check before funds are spent. In an agent/skill context, this is risky because upstream tooling or prompt-influenced input could cause unintended real-money payments to attacker-controlled invoices.
This code accesses a sensitive credential-like value via process.env.ALBY_NWC_URL to establish wallet connectivity, but the file provides no user-facing disclosure beyond implementation details. Under the code-file criteria, sensitive environment-variable access should be flagged when there is no confirmation prompt, visible warning, or explanatory documentation in the file.
Request target host is built from a dynamic or untrusted value. If the host is attacker-influenced, this enables SSRF to arbitrary internal or metadata endpoints.
try {
// 1. Resolve lightning address → LNURL metadata
const lnurlRes = await fetch(
`https://${domain}/.well-known/lnurlp/${encodeURIComponent(user)}`,
{ redirect: "error", signal: AbortSignal.timeout(10_000) }
);
The dependency is specified with a caret range (^7.0.0), which allows automatic installation of future minor and patch releases. This creates supply-chain risk because a compromised upstream release or unexpected breaking/security-relevant behavior change could be pulled in without explicit review, which is particularly relevant here because the package handles Lightning wallet/payment functionality.
"license": "MIT",
"type": "module",
"dependencies": {
"@getalby/sdk": "^7.0.0"
}
}