Skip to content

Security: AlgorithmicMind/regimelab

SECURITY.md

Security Policy

Supported Versions

Security fixes are applied to the latest minor release on the main branch.

Version Supported
0.5.x (latest) ✅
< 0.5.1 ❌ (upgrade to >=0.5.1)

Security Model & Threat Boundaries

RegimeLab is designed with defensive controls around model loading, local artifact storage, external volatility feeds, configuration parsing, and HTML report generation:

  • Safe Model Serialization (FittedRegime): .npz model bundles are loaded strictly with allow_pickle=False to prevent arbitrary code execution via NumPy object arrays, reject symlinks, enforce bounded metadata (10 MiB) and uncompressed ZIP archive limits (200 MiB), and validate array shapes, numeric dtypes, finiteness, positive scale, state mappings, and row-stochastic transition matrices.
  • Path-Traversal & Storage Hardening: RunStore, ParquetProvider, and load_aligned_panel validate artifact names and ticker symbols against strict allow-lists, reject symlinks, directory escapes (is_relative_to), and Windows reserved device names, persist files atomically via os.replace(), and redact home directory paths (~) in run manifests and provider identifiers.
  • External Data Ingestion: official volatility feeds (CBOE/FRED) enforce https://-only URLs and redirects, bound downloaded CSV payloads (20 MiB), and fail closed on TLS verification errors (ssl.SSLError). Third-party market data feeds (yfinance and upstream vendors) operate outside RegimeLab's trust boundary.
  • Configuration & Reporting: --config TOML loading fails closed on missing or malformed files, blocks unknown keys and Pydantic settings keyword injection (_env_file, _secrets_dir), and rejects non-finite floats (NaN/Inf). HTMLReport escapes dynamic values with html.escape(..., quote=True) and defaults to offline embedded Plotly scripts rather than external CDN injection.

Important boundary: RegimeLab is a quantitative research, regime-detection, and backtesting library — not a brokerage gateway, order-execution engine, or investment advisor. Regime outputs and backtest metrics carry no guarantee of live trading performance, and upstream market-data vendor outages or corrupted quotes must be validated independently before live deployment.

Reporting a Vulnerability

Please do not open a public GitHub issue for suspected security vulnerabilities.

Instead, report vulnerabilities privately via GitHub Security Advisories:

Include a concise description of the issue, affected version, reproduction steps, and potential impact. We aim to acknowledge reports within 72 hours and coordinate a fix before public disclosure.

There aren't any published security advisories