T09 · Insecure Skill Coding Practices
- Location
scripts/lib/part2-planner.js:1393- Finding
Raw Wallet Private Keys Are Persisted in Plaintext Workflow Artifacts
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This live DeFi execution skill is purpose-aligned, but it has review-worthy wallet-safety issues around plaintext private keys, unlimited token approvals, and unguarded zero-slippage swaps.
Review carefully before installing or using live mode. Use only throwaway or tightly scoped wallets, avoid putting raw private keys in request files, disable artifact persistence when secrets are present, revoke allowances after tests, and do not run live swaps unless a nonzero minimum output and trusted router are explicitly verified.
scripts/lib/part2-planner.js:1393Raw Wallet Private Keys Are Persisted in Plaintext Workflow Artifacts
scripts/evk_live_borrow_proof.js:166Borrow-Proof Executor Grants Unlimited Token Approvals Without Explicit Opt-In
scripts/evk_live_borrow_proof.js:181Live Swaps Can Execute With Zero Minimum Output
This mismatch is more concerning because the skill text explicitly normalizes powerful live actions while also mentioning additional side effects such as debt repayment, swaps, and EVC reconfiguration in the bundled executor. If those effects are not prominently declared in the primary purpose and permission model, an operator may authorize what appears to be a lending workflow while unintentionally permitting broader asset-moving or position-altering operations.
This mismatch is more concerning because the skill text explicitly normalizes powerful live actions while also mentioning additional side effects such as debt repayment, swaps, and EVC reconfiguration in the bundled executor. If those effects are not prominently declared in the primary purpose and permission model, an operator may authorize what appears to be a lending workflow while unintentionally permitting broader asset-moving or position-altering operations.
This mismatch is more concerning because the skill text explicitly normalizes powerful live actions while also mentioning additional side effects such as debt repayment, swaps, and EVC reconfiguration in the bundled executor. If those effects are not prominently declared in the primary purpose and permission model, an operator may authorize what appears to be a lending workflow while unintentionally permitting broader asset-moving or position-altering operations.
This mismatch is more concerning because the skill text explicitly normalizes powerful live actions while also mentioning additional side effects such as debt repayment, swaps, and EVC reconfiguration in the bundled executor. If those effects are not prominently declared in the primary purpose and permission model, an operator may authorize what appears to be a lending workflow while unintentionally permitting broader asset-moving or position-altering operations.
This mismatch is more concerning because the skill text explicitly normalizes powerful live actions while also mentioning additional side effects such as debt repayment, swaps, and EVC reconfiguration in the bundled executor. If those effects are not prominently declared in the primary purpose and permission model, an operator may authorize what appears to be a lending workflow while unintentionally permitting broader asset-moving or position-altering operations.
This mismatch is more concerning because the skill text explicitly normalizes powerful live actions while also mentioning additional side effects such as debt repayment, swaps, and EVC reconfiguration in the bundled executor. If those effects are not prominently declared in the primary purpose and permission model, an operator may authorize what appears to be a lending workflow while unintentionally permitting broader asset-moving or position-altering operations.
Referenced artifact was not completely inspected
6. Use the bundled executor at `scripts/evk_live_borrow_proof.js`
Referenced artifact was not completely inspected
6. Use the bundled executor at `scripts/evk_live_borrow_proof.js`
Referenced artifact was not completely inspected
6. Use the bundled executor at `scripts/evk_live_borrow_proof.js`
Referenced artifact was not completely inspected
6. Use the bundled executor at `scripts/evk_live_borrow_proof.js`
Artifact persistence writes the raw request object to disk, and the request schema can contain secrets such as send.privateKey and feedFunding.privateKey. In a signer-backed DeFi workflow, persisting private keys in plaintext artifacts creates a direct credential exposure path through local disk access, logs, backups, CI artifacts, or later exfiltration by other tools.
The skill description promises a post-deploy borrowability proof/canary borrow, but the workflow implemented here ends at deployment and handoff verification. In a lending-market deployment context, that gap can cause operators or downstream agents to treat an unproven market as successfully deployable/borrowable, leading to false success claims and unsafe operational decisions on live infrastructure.
The skill advertises execution-capable behavior involving environment variables, network access, browser-assisted actions, and potential live onchain writes, but it declares no explicit tool scope or permission boundary. In an agent setting, this increases the risk of overbroad tool access and accidental or unauthorized execution, especially because the workflow includes approvals, swaps, deployments, and borrow canaries.
This reference file explicitly wires a live signer environment variable and an operator acknowledgement placeholder into a workflow whose stated purpose includes real onchain writes, approvals, swaps, feed funding, and borrow execution. In this context, the configuration materially lowers the barrier to accidental asset-moving execution because the file itself provides no embedded warning, safety gating semantics, or human-confirmation context beyond a placeholder string, making misuse or unsafe automation more likely.
This code accesses a sensitive credential via process.env to construct a signing wallet for live transactions. While the usage text mentions that live mode requires the environment variable, it does not clearly warn that the script will read sensitive private-key material from the environment, which is a safety-relevant operation.
This helper builds a request object preconfigured for live onchain execution: broadcast.enabled: true, send.enabled: true, dryRun: false, and a runtime-injected private key field. Even though the key and RPC URL are placeholders, the function normalizes unsafe defaults for transaction submission, which is dangerous in an agentic lending skill because downstream components may execute the returned payload without a strong, user-visible consent gate, leading to unintended approvals, deployments, funding, swaps, or borrows.
The planner advertises itself as EVK-first and the skill metadata says not to use it for Morpho, yet the code still accepts 'morpho' in SUPPORTED_PROTOCOLS and validates Morpho requests in multiple entry points. That mismatch expands the tool's reachable surface and can let callers route unsupported protocol inputs through logic not designed for them, creating incorrect plans or unsafe automation decisions.
The write site persists full request data without an immediate warning, and those requests may include live private keys and RPC details. In this skill context, which can perform real onchain writes, silent persistence of such secrets materially raises the chance of accidental credential leakage and unauthorized transaction signing.
The manifest focuses on resolving oracle routes, funding feeds, preparing Euler oracle paths, deploying EVK markets, and proving borrowability. This file adds an OffchainRegistry publication step and builds an offchain-publication transaction payload for market manifests, which is ancillary coordination behavior not explicitly covered by the stated purpose.
This code performs irreversible on-chain transaction submission when dryRun is false. While the file enforces an acknowledgement token and accumulates warnings elsewhere, the actual execution path has no confirmation prompt or visible user-facing log immediately before sending transactions.
The package uses caret ranges for security-sensitive runtime dependencies, which allows newer minor/patch releases to be installed without explicit review. In a skill that can perform live onchain actions such as approvals, swaps, feed funding, deployment, and borrowing, a compromised or breaking upstream release could alter transaction construction or execution behavior and materially increase supply-chain risk.
"check": "node --check scripts/bin/agentic-lending-evk.js && node --check scripts/bin/api3-feed-manager.js && node --check scripts/bin/part2-planner.js && node --check scripts/evk_live_borrow_proof.js && node --check scripts/lib/api3-feed-manager.js && node --check scripts/lib/part2-chain-bootstrap.js && node --check scripts/lib/part2-planner.js && node --check scripts/lib/part2-recipes.js"
},
"dependencies": {
"@api3/contracts": "^37.0.0",
"@api3/dapi-management": "^4.15.0",
"ethers": "^6.15.0"
}
The dependency is not strictly pinned and may resolve to different package contents over time, creating a supply-chain exposure. Because this skill is specifically designed for agentic lending workflows involving oracle/feed management and potential live signer-backed execution, an unexpected upstream change could influence high-value blockchain operations.
},
"dependencies": {
"@api3/contracts": "^37.0.0",
"@api3/dapi-management": "^4.15.0",
"ethers": "^6.15.0"
}
}
Using a caret range for ethers permits automatic uptake of later compatible releases, which can still introduce behavioral changes, bugs, or a malicious supply-chain event. Given that ethers is the core transaction/signing library for blockchain interactions, any compromised or incompatible update could directly affect wallet operations, approvals, deployments, or borrow transactions executed by the skill.
"dependencies": {
"@api3/contracts": "^37.0.0",
"@api3/dapi-management": "^4.15.0",
"ethers": "^6.15.0"
}
}
Detected: suspicious.exposed_secret_literal