Back to skill

Security audit

APEX IA Scanner

Security checks for vulnerabilities and agentic risk

Overview

This scanner package includes under-disclosed automated Binance Futures trading code with embedded API credentials and order-placement capability.

Review carefully before installing. Treat this as more than a scanner: do not run the trader, aggressive, final, SMC, or complete launcher scripts unless you intentionally want automated Binance Futures trading, understand the leverage/liquidation risk, and have replaced/rotated credentials safely. Prefer scanner-only use with read-only market data and avoid enabling production trading without explicit safeguards.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
apex-ia-trader.mjs:14
Finding
Hard-Coded Binance API Credentials Exposed in Source Code<![CDATA[ ## Vulnerability Details **File Location**: - `apex-ia-aggressive.mjs:13-14` - `apex-ia-final-20x.mjs:53-54` - `apex-ia-final.mjs:13-14` - `apex-ia-robot.mjs:13-14` - `apex-ia-smc.mjs:53-54` - `apex-ia-trader.mjs:14-15` - `apex-ia-all.mjs:13` contains the same API key and a placeholder secret on line 14. **Vulnerability Type**: Hard-coded authentication credentials **Risk Level**: High ### Vulnerable Code The following credential declarations appear repeatedly in the listed trading programs: ```js const API_KEY = 'Dq0vl5xeDxwQKMBwoJT5A9yxsJiW8hbXyVO7831c4xbI0N1tfiQjsTf1ZKsSVIXL'; const API_SECRET = '1kVF6XZuV5rVnKyIiAjbLTNcN50tQZEI8M5p90piOblTOl4W19rpgIeZMRzDlBBb'; ``` The credentials are actively used to sign and authenticate Binance requests in `apex-ia-trader.mjs:35-62`: ```js function generateSignature(queryString, secret) { return crypto.createHmac('sha256', secret).update(queryString).digest('hex'); } async function binanceRequest(method, endpoint, params = {}, signed = false) { const timestamp = Date.now(); let queryString = `timestamp=${timestamp}`; if (Object.keys(params).length > 0) { queryString += `&${new URLSearchParams(params).toString()}`; } let signature = ''; if (signed) { signature = generateSignature(queryString, API_SECRET); queryString += `&signature=${signature}`; } const url = `${BASE_URL}${endpoint}?${queryString}`; try { const response = await axios({ method, url, headers: { 'X-MBX-APIKEY': API_KEY, 'Content-Type': 'application/json' } }); return response.data; } catch (err) { console.error(`❌ Erro na requisição: ${err.message}`); return null; } } ``` ### Technical Analysis API credentials embedded in distributed source code must be considered compromised. Any person who can download the package, inspect its repo ...[truncated 1898 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Revoke the exposed API key and secret immediately; removal from the current source tree does not invalidate copies in package archives or repository history. 2. Generate separate, user-specific credentials rather than distributing a shared credential. 3. Read credentials from a protected secret manager or environment variables: ```js const API_KEY = process.env.BINANCE_API_KEY; const API_SECRET = process.env.BINANCE_API_SECRET; if (!API_KEY || !API_SECRET) { throw new Error('Binance credentials are not configured'); } ``` 4. Ensure `.env` files, local configuration files, logs, and credential exports are excluded from version control and release archives. 5. Apply least privilege: enable only the minimum futures-trading permissions required and disable withdrawals. 6. Configure Binance IP allowlisting where operationally possible. 7. Use distinct credentials for testnet and production, with production trading disabled by default. 8. Add automated secret scanning to CI and pre-commit workflows. 9. Review repository and package history for previous credential exposure and rotate every exposed credential rather than merely deleting its current declaration. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
start-apex-completo.sh:14
Finding
Bundled Launcher Starts an Automated Leveraged Futures Trader Beyond the Declared Scanner Scope<![CDATA[ ## Vulnerability Details **File Location**: - `SKILL.md:2-26` describes the root skill as an SMA 8/21 Binance Futures scanner. - `start-apex-completo.sh:14-19` launches the automated trader in the background. - `apex-ia-trader.mjs:95-126` submits market, stop-loss, and take-profit orders. - `apex-ia-aggressive.mjs:63-68,88-141` configures leverage and submits orders. - `apex-ia-final-20x.mjs:91,197-203,225-296` supports leverage of up to 20× and automated position creation. **Vulnerability Type**: Undisclosed privileged financial operation and scope violation **Risk Level**: High ### Vulnerable Code The public skill description identifies the package as a scanner: ```yaml name: apex-ia-scanner description: Professional scanner for Binance Futures. SMA 8/21 crossovers. 🇺🇸 | Scanner profissional para Binance Futures. Cruzamentos SMA 8/21. 🇧🇷 ``` The bundled launcher starts a trader in the background before starting the scanner: ```sh # Iniciar o trader em background node apex-ia-trader.mjs & TRADER_PID=$! # Aguardar 2 segundos sleep 2 # Iniciar o scanner node apex-ia-software.mjs ``` The trader submits authenticated market and conditional orders in `apex-ia-trader.mjs:95-126`: ```js async function openPosition(symbol, side, quantity, stopLoss, takeProfit) { const params = { symbol, side: side.toUpperCase(), type: 'MARKET', quantity: quantity.toFixed(3) }; const order = await binanceRequest('POST', '/fapi/v1/order', params, true); if (order && order.orderId) { // Adicionar stop loss e take profit if (stopLoss) { await binanceRequest('POST', '/fapi/v1/order', { symbol, side: side === 'BUY' ? 'SELL' : 'BUY', type: 'STOP_MARKET', quantity: quantity.toFixed(3), stopPrice: stopLoss.toFixed(2), price: stopLoss.toFixed(2) }, true); } i ...[truncated 3178 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove all order-execution programs from the scanner package and distribute automated trading as a clearly separate, explicitly named component. 2. Do not start a trader as a side effect of starting a scanner. 3. Default every trading component to paper trading or testnet and require an explicit configuration change plus interactive confirmation for production. 4. Before enabling trading, display and require confirmation of: - Target environment and account. - Maximum position size. - Maximum simultaneous positions. - Leverage. - Daily loss limit. - Whether execution is automatic. 5. Require a separate command-line flag such as `--enable-live-trading`; reject live execution when the flag is absent. 6. Use read-only API credentials for scanner-only functionality. 7. Add a dry-run mode that prints proposed orders without submitting them. 8. Require confirmation before the first order and whenever environment, leverage, or risk limits change. 9. Document the complete order behavior prominently in the root `SKILL.md`, including liquidation and leveraged-loss risks. 10. Add account-side safeguards such as restricted API permissions, IP allowlisting, low exchange limits, and withdrawals disabled. 11. Add robust position reconciliation with the exchange so local state cannot incorrectly assume a position or protective order exists. ]]>

T08 · Insecure Dependencies

Warning
Location
realtime-scanner.js:149
Finding
Runtime Installation of an Unpinned Dependency Through a Shell Command<![CDATA[ ## Vulnerability Details **File Location**: `realtime-scanner.js:149-155` **Vulnerability Type**: Unsafe runtime dependency installation **Risk Level**: Medium ### Vulnerable Code ```js // Instalar dependência se necessário try { await import('ws'); } catch { console.log('📦 Instalando ws...'); const { execSync } = await import('child_process'); execSync('npm install ws', { stdio: 'inherit' }); } ``` ### Technical Analysis When importing `ws` fails for any reason, the scanner invokes `npm install ws` through `child_process.execSync`. The command does not specify an exact version and does not use the committed lockfile through a deterministic installation process such as `npm ci`. Consequently, the effective dependency retrieved at runtime can differ from the version reviewed with the package. npm installation can also execute dependency lifecycle scripts with the privileges of the user running the scanner. The broad `catch` creates an additional problem: failures unrelated to a genuinely absent package can trigger package installation. For example, a broken or incompatible installed dependency may cause the program to modify the installation unexpectedly rather than failing safely. No evidence shows that the current `ws` package is malicious. The vulnerability is the mutable, unreviewed supply-chain execution path. ### Attack Path 1. The scanner is run in an environment where `ws` is absent or its import fails. 2. The exception handler loads Node.js `child_process`. 3. The process executes `npm install ws`. 4. npm resolves a package version from the configured registry at execution time rather than strictly using the reviewed lockfile. 5. npm downloads and installs the resolved dependency and its transitive dependencies. 6. Any applicable package lifecycle behavior executes with the scanner user's privileges. 7. The scanner subsequently operates with code that may not match the audited dependency graph. An attacker would need to compr ...[truncated 797 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove all runtime package-installation logic from application code. 2. Keep `ws` declared in `package.json` and install dependencies during an explicit setup or deployment phase. 3. Use the committed lockfile and a deterministic command: ```sh npm ci --ignore-scripts ``` Enable lifecycle scripts only when they are required and have been reviewed. 4. Pin dependency versions or enforce exact versions through lockfiles and automated policy. 5. If `ws` is unavailable, terminate with a clear error rather than modifying the environment: ```js try { await import('ws'); } catch { throw new Error('Missing dependency: run npm ci before starting the scanner'); } ``` 6. Verify package integrity through the lockfile, trusted registries, and CI dependency review. 7. Run dependency vulnerability and provenance checks during builds. 8. Execute the application as an unprivileged operating-system user with access only to required project and data paths. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (195)

Description-Behavior Mismatch

Critical
Confidence
100% confidence
Finding
The code places live market orders and take-profit orders on Binance Futures, directly creating leveraged positions. Because the skill is presented as a scanner, this concealed ability can cause immediate unauthorized or unexpected financial loss, especially in a high-risk derivatives environment.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
Running an HTTP server, serving static content, reading local files, and exposing APIs goes well beyond a simple scanner and materially changes the attack surface. Those undeclared services can expose local data, create unintended network listeners, and confuse users about whether the skill is merely analytical or also a persistent application server.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Running an HTTP server, serving static content, reading local files, and exposing APIs goes well beyond a simple scanner and materially changes the attack surface. Those undeclared services can expose local data, create unintended network listeners, and confuse users about whether the skill is merely analytical or also a persistent application server.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
Running an HTTP server, serving static content, reading local files, and exposing APIs goes well beyond a simple scanner and materially changes the attack surface. Those undeclared services can expose local data, create unintended network listeners, and confuse users about whether the skill is merely analytical or also a persistent application server.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Running an HTTP server, serving static content, reading local files, and exposing APIs goes well beyond a simple scanner and materially changes the attack surface. Those undeclared services can expose local data, create unintended network listeners, and confuse users about whether the skill is merely analytical or also a persistent application server.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Running an HTTP server, serving static content, reading local files, and exposing APIs goes well beyond a simple scanner and materially changes the attack surface. Those undeclared services can expose local data, create unintended network listeners, and confuse users about whether the skill is merely analytical or also a persistent application server.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
Running an HTTP server, serving static content, reading local files, and exposing APIs goes well beyond a simple scanner and materially changes the attack surface. Those undeclared services can expose local data, create unintended network listeners, and confuse users about whether the skill is merely analytical or also a persistent application server.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
Running an HTTP server, serving static content, reading local files, and exposing APIs goes well beyond a simple scanner and materially changes the attack surface. Those undeclared services can expose local data, create unintended network listeners, and confuse users about whether the skill is merely analytical or also a persistent application server.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Running an HTTP server, serving static content, reading local files, and exposing APIs goes well beyond a simple scanner and materially changes the attack surface. Those undeclared services can expose local data, create unintended network listeners, and confuse users about whether the skill is merely analytical or also a persistent application server.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Running an HTTP server, serving static content, reading local files, and exposing APIs goes well beyond a simple scanner and materially changes the attack surface. Those undeclared services can expose local data, create unintended network listeners, and confuse users about whether the skill is merely analytical or also a persistent application server.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Running an HTTP server, serving static content, reading local files, and exposing APIs goes well beyond a simple scanner and materially changes the attack surface. Those undeclared services can expose local data, create unintended network listeners, and confuse users about whether the skill is merely analytical or also a persistent application server.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
Running an HTTP server, serving static content, reading local files, and exposing APIs goes well beyond a simple scanner and materially changes the attack surface. Those undeclared services can expose local data, create unintended network listeners, and confuse users about whether the skill is merely analytical or also a persistent application server.

Context-Inappropriate Capability

High
Confidence
100% confidence
Finding
Hardcoded API credentials in source code are a severe secret-management failure, especially in software that can place leveraged futures orders. Anyone with access to the file can reuse the credentials, and if they correspond to a real account, they could query account data or submit orders, leading to account compromise and direct financial loss.

Missing User Warnings

High
Confidence
100% confidence
Finding
The program uses hardcoded exchange credentials without any user-facing disclosure, which conceals a highly sensitive capability from the operator. In the context of a supposed scanner, undisclosed credentialed access is especially dangerous because it can silently connect to and act on an exchange account.

Missing User Warnings

High
Confidence
99% confidence
Finding
Automatic market-order trading is enabled by default, and there is no confirmation prompt before trades are placed. In a leveraged futures context, this can immediately create positions and losses for users who expected monitoring-only behavior or who did not understand the default mode.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The file is presented as a scanner, but it contains authenticated Binance account access, leverage changes, market order placement, take-profit order creation, and position management. This is a significant capability mismatch that can cause real trading activity, account exposure, and financial loss if a user runs it expecting passive market scanning only.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The code automatically executes trades from scan results when autoTrade is enabled, which exceeds the declared purpose of a scanner. Because this behavior is tied directly to signal generation, a user may unknowingly grant the program authority to open leveraged positions instead of merely reporting opportunities.

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
The code includes signed Binance API requests and account-balance access, which are sensitive capabilities not justified by a scanner-only description. Even if intended for demo use, these primitives enable authenticated actions and increase the blast radius if keys are present, leaked, or reused in production.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The skill is ներկայացված as a scanner, but this code can place and close Binance Futures orders, including market, stop, and take-profit orders. That is a significant capability expansion beyond passive analysis and creates a real risk of unauthorized or unexpected trading if a user runs the skill believing it is scanner-only.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The auto-trading path executes trades from scan results, which exceeds the declared scanner-only purpose and changes the skill from informational to transactional. This mismatch is dangerous because users may grant trust or credentials based on the less risky description while the code can take market actions on their behalf.

Missing User Warnings

High
Confidence
97% confidence
Finding
Automatic live order execution can be enabled without any meaningful warning, acknowledgement, or confirmation about financial risk and order-placement behavior. In a trading context this is especially dangerous because a single keypress can transition the tool from passive monitoring to repeated market activity.

Context-Inappropriate Capability

High
Confidence
100% confidence
Finding
Hardcoded Binance API credentials are embedded directly in the source. Anyone with file access can extract and misuse them for authenticated trading/account actions, and leaked secrets are difficult to contain once distributed.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The skill metadata claims to be a scanner, but the code enables automated trading behavior by default and maintains state for leveraged positions. This mismatch is dangerous because users may grant trust or permissions appropriate for passive market scanning while the code is actually capable of taking account-affecting actions.

Missing User Warnings

High
Confidence
99% confidence
Finding
Automated leveraged trading is enabled by default via `autoTrade = true`, and the main loop can execute trades without any upfront confirmation. In a futures-trading context, default-on automation can rapidly open multiple risky positions before a user understands the behavior.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
This section changes account leverage through the Binance API, which is an active trading-account modification rather than passive scanning. In the context of a skill presented as a scanner, hidden leverage changes materially increase financial risk and violate user expectations.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.exposed_secret_literal

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
realtime-scanner.js:155

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
apex-ia-aggressive.mjs:13

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
apex-ia-all.mjs:13

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
apex-ia-final-20x.mjs:53

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
apex-ia-final.mjs:13

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
apex-ia-robot.mjs:13

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
apex-ia-smc.mjs:53

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
apex-ia-trader.mjs:14