F-2026-0008·insecure-defaults

`bypassChecks` Flag Disables Risk Controls in Development

Fixedpentestbackendapigithub.com/bloom-art/api
TL;DR

A documented `bypassChecks=true` query parameter (callable by any sandbox JWT) disabled the entire risk engine in non-prod, allowing unrestricted leveraged trading if dev infrastructure shared signing keys or CLOB accounts with production.

Severity
LOW
Impact
HIGH
Likelihood
LOW
Method
MManual review
CAT.
Complexity
LOW
Exploitability
LOW
02Section · Description

Description

typescript
// offer.controller.ts L99-L103
const isSandbox = this.sandboxService.isSandboxRole(customer.role);
const bypassChecks = isSandbox || (query.bypassChecks ?? false);
if (bypassChecks && !isSandbox && this.environmentService.isInProdEnvironment()) {
throw new ForbiddenException("bypassChecks is not allowed in production");
}
// In dev: any customer JWT holder can bypass ALL risk checks
typescript
// offer.service.ts L69
const bypassChecks = input.isSandbox || (input.bypassChecks && !this.environmentService.isInProdEnvironment());
// When bypassChecks is true, the following are skipped:
// - Position limits (global, market, partner, user, side), offer.service.ts ~L110
// - Slippage validation, offer.service.ts ~L118
// - Entry filters (depth, spread, volume, staleness), offer.service.ts ~L122
// - Leverage clamping from risk model, offer.service.ts ~L191
// - Market eligibility checks, offer.service.ts ~L139

Frontend / on-chain mitigation analysis: This is just a dev sandbox bypassChecks=true of course. However, it's a documented query parameter in offer.args.ts and any direct API caller can include it. The on-chain contract enforces its own invariants (collateral requirements, signature expiry, state machine) regardless of bypassChecks, providing partial mitigation. But the risk engine's slippage, leverage, and market eligibility checks exist precisely because on-chain invariants alone are insufficient to prevent bad trades, the backend signs offers that the contract trusts, so a badly-checked offer translates to real financial exposure.

03Section · Impact

Impact

Complete bypass of the risk engine in non-production environments. If dev infrastructure shares signing keys or CLOB accounts with production, this enables unrestricted leveraged trading.

04Section · Recommendation

Recommendation

Restrict bypassChecks to admin API keys only. Even in dev, apply minimum safety guards (notional caps).

05Section · Resolution

Resolution

Resolved, the bypassChecks query parameter and the isSandbox bypass branch have been removed from offer creation; every environment now enforces the full check set.

Status
Fixed
F-2026-0008

oog
zealynx

Smart Contract Security Digest

Monthly exploit breakdowns, audit checklists, and DeFi security research — straight to your inbox

© 2026 Zealynx