T09 · Insecure Skill Coding Practices
- Location
resources/crypto-wallets.ts:122- Finding
Incorrect BNB Chain Token Decimals Permit Near-Zero Underpayments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent crypto-payment skill, not apparent malware, but it needs review because its payment-confirmation code and install guidance can create real financial and credential risk.
Review and fix the payment verifier before production use. Pin the skill and installer source, generate the wallet mnemonic offline, store secrets only in a trusted secret manager, avoid giving CRON_SECRET to third-party schedulers, validate token decimals per chain, and make payment fulfillment transactionally idempotent.
resources/crypto-wallets.ts:122Incorrect BNB Chain Token Decimals Permit Near-Zero Underpayments
resources/check-crypto-payments-route.ts:206Non-Atomic Payment Claim Allows Duplicate Fulfillment
SKILL.md:102External Scheduler Guidance Exposes a Privileged Cron Bearer Secret to a Third Party
README.md:22Unpinned npx Installation Command Creates a Mutable Supply-Chain Execution Path
SKILL.md:78Web-Based Master Mnemonic Generation Guidance Introduces an Avoidable Secret-Exposure Boundary
Referenced artifact was not completely inspected
| `crypto-checkout-route.ts` | `src/app/api/billing/crypto-checkout/route.ts` |
Referenced artifact was not completely inspected
| `crypto-checkout-route.ts` | `src/app/api/billing/crypto-checkout/route.ts` |
Referenced artifact was not completely inspected
| `crypto-checkout-route.ts` | `src/app/api/billing/crypto-checkout/route.ts` |
Referenced artifact was not completely inspected
| `crypto-checkout-route.ts` | `src/app/api/billing/crypto-checkout/route.ts` |
Referenced artifact was not completely inspected
| `crypto-checkout-route.ts` | `src/app/api/billing/crypto-checkout/route.ts` |
Referenced artifact was not completely inspected
| `crypto-payment-modal.tsx` | `src/components/dashboard/crypto-payment-modal.tsx` |
Referenced artifact was not completely inspected
| `crypto-payment-modal.tsx` | `src/components/dashboard/crypto-payment-modal.tsx` |
The skill uses 'env' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.
The skill uses 'network' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.
The Bitcoin checker uses funded_txo_sum, which is the cumulative amount ever received by the address and does not decrease when coins are later spent. An attacker can send funds to the address, move them away, and future checks may still treat the payment as satisfied, causing false confirmations and crediting unpaid orders.
The README instructs users to run npx skills add Flacko2048/self-hosted-crypto-payments without pinning a specific version, commit, or digest of the installer/source. That allows a future upstream change, account compromise, or package substitution to alter what gets fetched and executed at install time, creating a supply-chain risk rather than a direct flaw in the crypto logic itself.
Confirmation is based solely on whether the current address balance meets a threshold, not whether a specific payment transfer for this invoice occurred. If addresses are ever reused, or if unrelated funds already exist at the address, a pending payment can be marked confirmed without the payer actually sending the required funds for that order.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if (!geckoId) throw new Error(`No CoinGecko ID for coin: ${coin}`)
const res = await fetch(
`https://api.coingecko.com/api/v3/simple/price?ids=${geckoId}&vs_currencies=usd`,
{ cache: 'no-store', signal: AbortSignal.timeout(6000) }
)
if (!res.ok) throw new Error(`CoinGecko API failed: ${res.status}`)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
arbitrum: { rpc: 'https://arb1.arbitrum.io/rpc', chainId: 42161 },
optimism: { rpc: 'https://mainnet.optimism.io', chainId: 10 },
bnb: { rpc: 'https://bsc-dataseed.binance.org', chainId: 56 },
avalanche: { rpc: 'https://api.avax.network/ext/bc/C/rpc', chainId: 43114 },
}
// ERC-20 token contract addresses per network
This code accesses a highly sensitive credential source, CRYPTO_MASTER_MNEMONIC, to derive wallet addresses. Although comments state the mnemonic is server-only, there is no confirmation prompt, user-facing log, or other disclosure mechanism warning that a master wallet secret is being used.
This code reads a secret from process.env.CRON_SECRET to authorize access, which is a sensitive credential-handling operation. Although the logic is implemented safely, the file provides no docstring or comment disclosing that the route depends on a secret-bearing Authorization header, which matches the code-file warning criterion for sensitive environment variable access lacking disclosure.
The balance-check helpers transmit wallet addresses to external providers such as EVM RPC endpoints, the Bitcoin API, and Solana RPC. These are network operations involving user/payment data, but the file contains no user-facing warning, disclosure comment, or docstring explaining that payment addresses will be queried against third-party services.
Detected: suspicious.env_credential_access