T09 · Insecure Skill Coding Practices
- Location
src/dex/oneinch.ts:38- Finding
Arbitrary Remote Transaction Data Is Signed Without Validation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent BSC trading bot skill, but it needs review because live mode can sign high-impact blockchain transactions with weak validation and some advertised safety controls are not reliably enforced.
Install only after careful review. Keep DRY_RUN=true until you have audited the transaction-building path, use a dedicated low-balance wallet, avoid broad token allowances, pin and validate external API origins, rotate any API key used with an untrusted ONEINCH_API_BASE, and do not rely on the panic command as a guaranteed stop for an already-running bot.
src/dex/oneinch.ts:38Arbitrary Remote Transaction Data Is Signed Without Validation
src/dex/oneinch.ts:151inch API Credential Can Be Forwarded to an Arbitrary Host
src/dex/oneinch.ts:20Documented Trading Safety Controls Are Ineffective or Not Enforced
vitest 2.1.9 is a known vulnerable testing framework release with arbitrary file read and possible execution exposure when its UI server is running, plus the redirect-mock traversal issue. Even though it is a dev dependency, this is more concerning than typical tooling flaws because developer workstations and CI runners for a crypto-trading bot may contain wallet keys, RPC credentials, and exchange secrets that could be exposed if the vulnerable server is used.
The file declares vitest with a caret range (^2.1.8), which can resolve to 2.1.9, a version identified by the scanner as affected by arbitrary file read / execution issues in Vitest UI and mocker handling. Although vitest is a devDependency and these issues generally require the test tooling to be installed and used in a vulnerable mode, compromise of developer or CI environments can still expose source, secrets, or enable code execution.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
npm install
cp .env.example .env
The documented purpose centers on news-driven trading, but the skill also includes private key intake, encryption, and filesystem secret storage behavior that is far more sensitive than the description suggests. This mismatch can mislead users into providing wallet credentials without clearly understanding that the skill performs local key-management operations, materially increasing the risk around fund-bearing secrets.
The documented purpose centers on news-driven trading, but the skill also includes private key intake, encryption, and filesystem secret storage behavior that is far more sensitive than the description suggests. This mismatch can mislead users into providing wallet credentials without clearly understanding that the skill performs local key-management operations, materially increasing the risk around fund-bearing secrets.
nanoid 3.3.11 is flagged for multiple denial-of-service and integer handling issues that can cause hangs or unstable behavior with malformed size inputs or custom generators. Here it is only pulled in transitively through dev tooling, so it is less likely to affect the trading bot at runtime, but could still impact build or development services if attacker-controlled input reaches the generator paths.
postcss 8.5.8 has multiple advisories including arbitrary file read and XSS-related issues in processing attacker-controlled content. Since it is present only via dev tooling in this project, risk to the deployed trading bot is reduced, but developers or CI systems processing untrusted styles or sourcemaps could still be exposed.
vite 5.4.21 is associated with path traversal and Windows-specific filesystem disclosure issues in development-server functionality. In this backend trading-bot context Vite is a dev dependency, so the vulnerable surface is not central to production trading operations, but developers running the tooling locally or in CI may still be at risk.
ws 8.17.1 has advisories for memory disclosure and memory exhaustion DoS. Unlike many other findings, ws is a runtime dependency via ethers, so if the bot uses WebSocket RPC connections to BSC nodes, malformed or malicious peer traffic could potentially leak process memory contents or degrade availability; in a trading bot, availability and secret handling are both important.
This is a real safety-control failure. The bot persists panic and safeMode state, and even exposes a panic command, but the start() trading loop never checks either flag before evaluating signals and calling dex.swap(). In a live trading skill, users will reasonably rely on panic/safe mode as a hard stop; failure to enforce them can lead to continued autonomous trades during incidents, losses, or suspected compromise.
The skill description and headings are written entirely in Chinese, which effectively imposes a language requirement on users. Under the policy criteria, locale or language constraints should either be optional for the user or clearly justified as region-specific; this file provides neither.
The skill advertises capabilities that require environment access and outbound network access, but it does not declare any explicit tool scope or permission boundaries. For a trading bot that can read secrets and interact with external services, missing scope declarations increases the chance of unintended access, unsafe execution contexts, or user surprise about what the skill can do.
The skill discusses dry-run mode and trading commands but does not explicitly warn that disabling dry-run can trigger real on-chain transactions affecting user funds. In a financial trading context, omission of that warning is dangerous because users may underestimate the consequences of invoking commands or changing configuration, leading to irreversible asset loss.
The skill references key encryption but does not clearly warn users that private keys or equivalent wallet secrets are required for signing and may be stored as encrypted key material on disk. In the context of a blockchain trading tool, insufficient disclosure around credential handling materially increases the risk of unsafe secret entry, poor key hygiene, and compromise of funds.
The file reads sensitive secret material from environment variables, including EVM_PRIVATE_KEY and KEY_PASSPHRASE. There is no confirmation prompt, logging, comment, or docstring in this file warning users that the skill accesses credential material.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
quoteToken: s('QUOTE_TOKEN', 'USDT'),
dexMode: s('DEX_MODE', 'oneinch'),
oneInchApiBase: s('ONEINCH_API_BASE', 'https://api.1inch.dev/swap/v6.0/56'),
oneInchApiKey: s('ONEINCH_API_KEY'),
pancakeRouter: s('PANCAKE_ROUTER', '0x10ED43C718714eb63d5aA57B78B54704E256024E'),
maxSlippageBps: n('MAX_SLIPPAGE_BPS', 50),
The swap method performs a remote API call to build a swap and then submits an on-chain transaction via wallet.sendTransaction, which is a safety-critical and potentially irreversible operation. Aside from the dry-run log branch, there is no confirmation prompt, user-facing disclosure, or explanatory comment/docstring warning that real funds may be moved.
The code retrieves a blockchain private key directly from configuration or decrypts it from disk, which is a sensitive credential operation. Although the behavior is technically necessary for the bot, this file provides no user-facing prompt, warning, or explanatory comment disclosing that secret key material will be accessed.
The bot executes live token swaps and persists trade records, which is a safety-critical and potentially irreversible operation affecting user funds. While the code logs bot startup and supports dry-run mode, this file does not include a direct warning or explanatory comment that the start command can place real trades when dryRun is false.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const c = new AbortController();
const t = setTimeout(() => c.abort(), this.timeoutMs);
try {
const r = await fetch('https://api.openai.com/v1/chat/completions', {
method: 'POST',
signal: c.signal,
headers: {
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const c = new AbortController();
const t = setTimeout(() => c.abort(), this.timeoutMs);
try {
const r = await fetch('https://api.openai.com/v1/chat/completions', {
method: 'POST',
signal: c.signal,
headers: {
The code sends news.title and news.body to an external OpenAI API endpoint and uses an API key in the request, but there is no confirmation prompt, user-facing log, or explanatory comment/docstring in this file disclosing that data leaves the local system. For a code-file review under this rule, outbound transmission of user or system data without any visible warning qualifies as a missing user warning unless the warning is documented elsewhere.
This CLI prompts for a private key and passphrase, then immediately encrypts the key and writes the resulting secret material to disk without any explicit warning, confirmation, or guidance about secure file handling. In a wallet/trading skill context, users are handling high-value credentials, so silent persistence increases the chance of accidental exposure through backups, repo commits, shared machines, or weak filesystem permissions.
@vitest/mocker 2.1.9 is a known vulnerable dev dependency with a path traversal / arbitrary file read issue in redirect-mock handling. Although it is primarily exercised in test or local development workflows rather than production runtime, it can expose local files if an attacker can influence mock configuration or a developer runs the vulnerable tooling on untrusted input.
esbuild 0.27.3 has a documented arbitrary file read issue tied to its development server on Windows. In this lockfile it appears as a dev dependency, so exposure is limited to development scenarios, but a vulnerable local dev server can still leak files from the developer machine.
No suspicious patterns detected.