Skip to content

fix(security): harden strategy execution boundaries - #389

Merged
brokermr810 merged 57 commits into
mainfrom
test
Nov 19, 2026
Merged

brokermr810 merged 57 commits into
mainfrom
test

Conversation

@brokermr810

Copy link
Copy Markdown
Collaborator

Summary

  • Isolate strategy and indicator callbacks in terminable, credential-free worker processes.
  • Harden sandbox validation and NumPy file-I/O restrictions.
  • Enforce trading-role authorization, agent/MCP secret redaction, and broker endpoint policy consistently.
  • Add isolated multi-timeframe indicator market-data support and update security/development documentation.

Root cause

User-authored strategy and indicator code crossed several execution and API boundaries that did not share one fail-closed isolation, authorization, and secret-redaction policy. Some callback paths still executed in shared processes, and related endpoints relied on local checks rather than a common boundary.

Validation

  • 227 focused Linux regression tests passed.
  • 20 instrument-rule snapshot tests passed.
  • Ruff checks passed.
  • Documentation validation passed.
  • Docker Compose configuration validation passed.

Deployment impact

The sandbox and strategy runtime workers now require the documented Linux isolation capabilities and sanitized environments. Existing strategy contracts remain supported, while unsafe runtime capabilities fail closed. The updated .env.example and production-hardening documentation describe the relevant controls.

Remaining risk

Execution isolation remains defense in depth and should continue to be paired with least-privilege container credentials, minimal filesystem access, and production monitoring.

tianhe added 30 commits November 1, 2026 17:17
Signed-off-by: TIANHE <[email protected]>

# Conflicts:
#	backend_api_python/app/routes/community.py
brokermr810 and others added 19 commits November 8, 2026 15:46
#362 normalized the Binance protection orders, but Bitget (UTA and
classic) and Bybit still sent percentage-derived prices with str(), e.g.
stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are
off the contract tick, so the venue rejects the protection order.

Run the stop-loss, take-profit and trailing activation prices (and the
Bybit trailingStop distance) through each client's _normalize_price, the
same way #362 does for Binance, and raise when the result falls below the
minimum.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: aliassar <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@brokermr810
brokermr810 merged commit d0f3cbb into main Nov 19, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants