Back to skill

Security audit

Neuro Scalp

Security checks for vulnerabilities and agentic risk

Overview

This disclosed crypto trading bot needs Review because it can place live OKX orders while testnet mode, risk controls, Redis access, and dashboard security are not safely scoped.

Do not install this with real OKX credentials or funded accounts as written. Treat it as research/prototype code until live trading is explicitly gated, testnet mode is enforced, Redis and the dashboard are private/authenticated, risk limits are actually applied, dependencies are updated, and model checkpoints come only from trusted verified sources. If testing, use isolated paper/testnet credentials with withdrawals disabled and strict exchange-side limits.

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 (5)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
docker-compose.yml:3
Finding

Unauthenticated Redis Exposure Enables Forged Market Data and Unauthorized Trade Influence

Content
View full analysis
0.5: await self.exec_engine.execute_signal( signal=signal_strength, price=data['last_price'] ) ``` ### Technical Analysis Docker publishes Redis port 6379 on the host without configuring authentication, ACLs, or transport encryption. Unless restricted by an external firewall, Docker's port publication makes the service reachable through host network interfaces. The strategy process treats messages received from the Redis channel as authentic exchange market data. It performs no producer authentication, message signing, freshness enforcement, schema constraints, numeric range validation, or comparison against an independent exchange p ...[truncated 1503 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
core/engine/execution.py:2
Finding

Configured Testnet and Financial Risk Controls Are Not Enforced in the Live Execution Path

Content
View full analysis
0 else 'sell' size = self.calculate_kelly_size(signal) try: # Post-only limit order to save fees (Scalping requirement) order = await self.exchange.create_order( symbol="BTC/USDT:USDT", type='limit', side=side, amount=size, price=price, params={'postOnly': True} ) logger.info(f"Order Placed: {side} {size} @ {price}") return order except Exception as e: ...[truncated 2433 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
models/agent.py:26
Finding

PyTorch Checkpoint Loading Permits Unsafe Pickle-Compatible Deserialization

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
dashboard/app.py:18
Finding

Public Dashboard WebSocket Exposes Trading Telemetry Without Authentication

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
dashboard/templates/index.html:5
Finding

Dashboard Executes Third-Party CDN Scripts Without Integrity Verification

Content
View full analysis
``` ### Technical Analysis The dashboard loads executable JavaScript from third-party CDN origins at page-render time. Neither script includes a Subresource Integrity hash. The Tailwind CDN URL is also not pinned to an immutable version. If a CDN account, upstream distribution system, DNS path, or mutable asset is compromised, altered JavaScript executes in the dashboard's browser origin. HTTPS protects transport against ordinary interception but does not protect against malicious or compromised upstream content. No restrictive Content Security Policy is shown that would reduce the consequences of injected script. ### Attack Path 1. A third-party CDN asset or its publishing pipeline is compromised, or a mutable asset is replaced upstream. 2. An operator opens the dashboard. 3. The browser downloads the altered JavaScript because the page contains no integrity hash. 4. The browser executes the script in the dashboard origin. 5. The injected code can read displayed telemetry, manipulate the dashboard, initiate network requests allowed by the browser, and access origin-scoped data available to the page. ### Impact Assessment Successful supply-chain compromise can execute arbitrary JavaScript in every dashboard user's browser. The immediate scope includes dashboard telemetry and any browser-accessible credentials or session data later added to the same origin. The reviewed implementation does not place OKX API credentials in the browser, so direct theft of those credentials is not established by the available code. ]]>
Remediation
View remediation
``` 3. Avoid Tailwind's runtime CDN script in production; compile a pinned Tailwind version into static CSS during the build. 4. Deploy a restrictive Content Security Policy that permits scripts only from required sources and avoids `unsafe-inline` where practical. 5. Pin frontend dependencies in a lockfile and include them in dependency-update and vulnerability-monitoring processes. 6. Review and update Plotly because the referenced version is old, while regression-testing dashboard behavior after upgrades. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
Findings (21)

Known Vulnerable Dependency: torch==2.1.0 — 16 advisory(ies): CVE-2025-2953 (PyTorch susceptible to local Denial of Service); CVE-2025-32434 (PyTorch: `torch.load` with `weights_only=True` leads to remote code execution); CVE-2024-31580 (PyTorch heap buffer overflow vulnerability) +13 more

Critical
Category
Supply Chain
Confidence
98% confidence
Finding

The requirement pins PyTorch to version 2.1.0, which the supplied finding indicates is affected by multiple published advisories, including severe memory safety issues and unsafe deserialization/RCE conditions. In an agent skill context, ML frameworks are often used to load model artifacts or process untrusted inputs, which makes a vulnerable torch version especially dangerous because exploitation could lead to code execution or denial of service in the host environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README directs creation of a fully automated 24/7 live-trading system without prominently warning users about the possibility of rapid financial loss, model error, exchange failure, or unattended execution risk. In the context of autonomous trading, the absence of an upfront warning can normalize unsafe deployment and increase the chance that a user runs real-money strategies without understanding the operational and financial hazards.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The README explicitly targets perpetual futures and later mentions dynamic leverage adjustment, but does not clearly warn about leverage, liquidation, funding, and derivatives-specific risks. That omission is especially dangerous because leveraged perpetual products can amplify losses very quickly, and an autonomous system may increase exposure faster than a human operator can intervene.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The strategy loop autonomously converts model output into market actions by calling execute_signal whenever a threshold is met. Because this happens continuously on incoming Redis messages with no human approval, kill-switch check, risk-limit check, or anomaly validation shown here, malformed data, model failure, or misuse can trigger unwanted live trades at machine speed.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

Automated trade execution occurs with no user-facing warning, confirmation, or visible consent mechanism in the file. In a system that can act on exchange credentials, this omission materially increases the chance of unauthorized or accidental financial activity, especially if the component is reused in a broader agent environment.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: fastapi==0.104.0 — 1 advisory(ies): CVE-2024-24762 (FastAPI is a web framework for building APIs with Python 3.8+ based on standard )

High
Category
Supply Chain
Confidence
90% confidence
Finding

The dependency is pinned to FastAPI 0.104.0, which the finding maps to a known advisory. Because FastAPI is an internet-facing web framework, known flaws can often be reached remotely through HTTP request handling, making the issue more dangerous in a service-oriented skill than a purely local utility.

Content

No source excerpt is available for this finding.

Possible Typosquatting: 'uvicorn' resembles popular package 'gunicorn'

High
Category
Supply Chain
Confidence
70% confidence
Finding

Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The title and core description are presented entirely in Chinese, and the file does not indicate that language selection is optional or that the skill is region-specific. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code places a live order on a real exchange directly from a trading signal with no user confirmation, simulation guard, environment separation, or explicit dry-run mode. In an automated trading skill, this is dangerous because any bad signal, misconfiguration, compromised upstream component, or accidental invocation can immediately trigger real financial transactions and losses.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The WebSocket endpoint accepts any client and forwards Redis pub/sub messages directly to them with no authentication, authorization, origin checks, or filtering. In this monitoring context, those channels may contain sensitive operational or trading data, so any party able to reach the endpoint can passively observe internal events in real time.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The page creates a WebSocket using plain ws://, which provides no transport encryption or integrity protection. If this dashboard is accessed over an untrusted network, an attacker on-path can observe or tamper with live trading metrics and event data, potentially misleading operators or exposing sensitive operational information.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code pulls live exchange credentials from environment variables and immediately initializes an execution engine capable of placing real orders. In this file's context, the program is an autonomous trading orchestrator with no safety gate, sandbox mode, permission prompt, or explicit restriction to paper trading, so compromise or accidental deployment could directly affect a funded account.

Content

No source excerpt is available for this finding.

Insecure deserialization: torch.load() without weights_only=True

Medium
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

This is a true vulnerability because torch.load(model_path) uses Python pickle-based deserialization, which can execute attacker-controlled code during loading if the model file is untrusted or tampered with. In this trading-agent context, model paths may be externally supplied or updated from files, making unsafe model loading especially risky because compromise could lead to arbitrary code execution in the environment running the trader.

Content

Scanner excerpt · models/agent.py (reported line 31)May include surrounding context.

python
def __init__(self, model_path=None):
        self.model = ScalpingActorCritic(input_dim=3, action_dim=1)
        if model_path:
            self.model.load_state_dict(torch.load(model_path))
        self.optimizer = torch.optim.Adam(self.model.parameters(), lr=1e-4)
    
    def predict(self, features):

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file includes operational guidance only in Chinese in the comments about how to provide API credentials. This is a natural-language locale policy issue because it imposes a single language without offering a choice or indicating that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The constructor receives API key, secret, and password and immediately uses them to initialize the exchange client. This accesses sensitive credentials, but the file provides no docstring, comment, or user-facing disclosure about credential use or the risks of supplying live trading secrets.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The comment at L57 says the test data is saved to CSV so the backtester can pick it up, but immediately afterward the code sets bt.df = test_data at L63 to avoid that file-based path. This is an active contradiction between the inline documentation and the actual execution path, not merely omitted detail.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code exports out-of-sample test data to a CSV file, which is a file write affecting local user/system data. Although there are internal comments and logger messages elsewhere, there is no user-facing print, confirmation, or explicit warning at the point where this temporary file is created.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The training simulation persists model weights to a checkpoint path using torch.save, which is a file write operation. The docstring explains the function purpose, but it does not warn the user that files will be created on disk or where they will be stored.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The docstring at L17-L21 states that get_features generates only Order Book Imbalance and Microprice. However, the implementation also computes volatility at L34-L35 and returns it as the third element at L37, so the documentation contradicts the actual output.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
71% confidence
Finding

The comment explicitly treats Windows as unsupported for full signal handling and silently falls back with 'pass # Windows', which communicates a platform-specific constraint without any user choice or clear runtime disclosure. This is a natural-language policy concern because the file embeds a fixed platform limitation rather than surfacing it as an explicit opt-in or documented requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This manifest contains user-facing natural-language labels and descriptions only in Chinese, such as plan names, features, and comments, with no indication that the skill is intended exclusively for a Chinese-speaking audience. Under the language/locale policy, forcing a single language without user opt-in or documented justification can be a policy issue.

Content

No source excerpt is available for this finding.