T09 · Insecure Skill Coding Practices
- Location
scripts/htlc.js:85- Finding
Trade Workflow Releases the Payment Secret Without Enforcing Asset Delivery
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a real on-chain trading helper, but it can move ETH with a raw private key while overstating atomic safety and omitting important safeguards.
Install only if you are prepared to audit the contract and workflow yourself. Use a dedicated low-value wallet, verify the chain and contract bytecode independently, test on a testnet first, and do not rely on the advertised atomic/trustless claims for real NFT or inscription purchases.
scripts/htlc.js:85Trade Workflow Releases the Payment Secret Without Enforcing Asset Delivery
scripts/htlc.js:16ETH Is Sent to a Hard-Coded Contract Without Deployment or Bytecode Verification
scripts/htlc.js:90Documented Timeout and Automatic Refund Guarantees Are Not Implemented by the CLI
The trade workflow explicitly prints the preimage as 'keep secret' and then immediately instructs the user to share that same preimage with the seller. In an HTLC flow, disclosure of the preimage defeats the secrecy property and can let the counterparty or observers use it to claim or redirect value depending on the contract design and trade sequencing, making the workflow unsafe by design.
The README promotes autonomous on-chain trading and ETH locking in HTLC contracts but does not warn users that funds may be irreversibly transferred, locked until timeout, or exposed to loss if counterparties, parameters, or contract addresses are wrong. In an AI-agent context, the omission is more dangerous because it encourages unattended asset movement without explicit human approval, risk limits, or verification steps.
The skill instructs users to export a raw PRIVATE_KEY in their shell environment but provides no warning about key custody, shell history, process leakage, or the risk of draining funds if the key is exposed. In a blockchain trading skill, this omission is materially dangerous because the credential directly controls on-chain assets and is likely to be used on a live wallet.
The documented commands perform ETH locking and release operations for HTLC trading, but the skill does not warn that blockchain transactions are irreversible, can execute against the wrong address or hash, and may permanently lock or transfer funds if parameters are incorrect. Because this skill is specifically designed for atomic swaps and escrow on live EVM chains, the lack of transaction-risk guidance makes operator error and fund loss significantly more likely.
The reveal command broadcasts the preimage on-chain and triggers release of funds without an explicit warning or confirmation. Because reveal is a final state-changing operation in an HTLC, accidental execution, wrong lockHash/preimage pairing, or rushed operator use can cause irreversible asset release.
The trade command automatically performs an on-chain ETH lock as part of a 'full trade workflow' without any confirmation prompt, dry-run summary, or explicit warning that funds will be irreversibly committed. This increases the chance of operator error, misuse, or social-engineering-induced loss, especially because the script is a CLI that may be run with copied parameters.
The dependency version for ethers is specified with a caret range (^6.0.0), which allows installation of newer minor and patch releases that have not been explicitly reviewed. While this is common practice and not inherently malicious, it creates supply-chain risk because a compromised or breaking upstream release could be pulled in automatically.
"keywords": ["htlc", "trade", "inscription", "nft", "evm", "base", "atomic-swap"],
"license": "MIT",
"dependencies": {
"ethers": "^6.0.0"
},
"peerDependencies": {},
"engines": {
No suspicious patterns detected.