Executive summary
What we were asked to do
A multi-chain non-custodial crypto trading terminal — combining a single-page web client, a hosted reactive backend-as-a-service (BaaS), delegated wallet signing, perpetuals trading, MEV bundle submission, and cross-chain bridging — commissioned a full-compromise red team assessment. Six crown jewels were defined upfront: delegated signing policy bypass, MEV bundle relay integrity, perpetuals agent-key compromise, cross-tenant BaaS wallet-state access, cross-chain bridge abuse, and staging or shadow-IT takeover.
The engagement ran across five waves, progressing from black-box reconnaissance through deep unauthenticated BaaS boundary testing and an operator-supplied token replay wave. The result is an instructive picture of a platform with strong core server-side authentication paired with two high-impact edge and DNS exposures.
Principal findings
Three dangling edge-hosting CNAME subdomains returned `DEPLOYMENT_NOT_FOUND` while remaining claimable by any external account — including a staging swap subdomain sharing the exact same DNS edge hash as the live production swap service. Separately, the production-referenced BaaS deployment deserialized unauthenticated `POST` requests to `/api/mutation` and `/api/action` before any deployment-level authentication gate (returning 400 BadJsonBody rather than 401, alongside credentialed CORS preflight headers), leaving per-function identity checks as the sole defense against cross-tenant state changes. Exhaustive testing across 205 HTTP and 50 WebSocket probes in Round 2, plus 202 deep probes and 6 endpoint controls across 136 bundle-reconstructed functions in Round 4, confirmed that per-function server-side authentication held without exception — zero data leaked and zero mutations executed. A fifth wave using an operator-supplied test-account JWE token confirmed strict token-validation boundaries across every host.
What this means in plain terms
Three things leadership should take from this assessment.
- Three abandoned subdomains can be claimed by an outsider on the hosting provider's platform. Because their DNS records still point to deleted deployments — and one shares an edge hash with a live production swap host — an attacker with a free account could serve trusted content under the company's domain for phishing, session-cookie abuse, or cross-origin attacks.
- The backend database API currently relies on every individual function remembering to check authentication. Requests to mutation and action endpoints pass straight into the JSON parser without a deployment-wide auth gate. Today, every tested function failed safely; tomorrow, a single newly shipped function missing an identity check becomes an immediate cross-tenant vulnerability.
- Core authentication held under sustained pressure, and zero criticals were fabricated to fill the board. Over 450 unauthenticated BaaS probes, 13 trading-API auth-bypass variants, and a full authenticated token-replay matrix produced zero unauthorized reads or writes.
The five things that need a decision, not a patch
| # | What is wrong | Business impact | Who decides |
|---|---|---|---|
| 1 | Three subdomains point to deleted edge-hosting deployments (DEPLOYMENT_NOT_FOUND) | One shares a DNS edge hash with live production swap infrastructure. Deleting or reclaiming DNS records is urgent, and DNS lifecycle governance needs ownership. | Infrastructure + security |
| 2 | BaaS /api/mutation and /api/action parse unauthenticated request bodies before any auth check | Per-function auth holds today, but relying on every developer to remember identity checks on 136+ functions is an architectural cliff. | Backend engineering |
| 3 | A 2.1 MB production TypeScript source map is publicly served on an analytics subdomain | It ships 101 source entries with full sourcesContent and hardcodes a live backend URL, dropping adversary reconnaissance cost to zero. | Frontend engineering |
| 4 | A public source repository documents private v2 order endpoints and a fixed 128-hex signature placeholder | Engineering must confirm the hardcoded placeholder is non-functional in production and decide whether private trading API schemas belong in a public repository. | Protocol engineering + security |
| 5 | Four of six crown jewels remain blocked pending live delegated-wallet credentials and signed on-chain scope | An unauthenticated assessment cannot evaluate authenticated BOLA or delegated signing policies; leadership decides whether to run a credentialed follow-up. | Security leadership |
What we did not get
No delegated wallet key compromise. No cross-tenant wallet-state read. No unauthenticated mutation or order forgery. No live subdomain was claimed (intentionally stopped at DNS + HTTP proof under rules of engagement). No public-by-design frontend key was inflated into a finding.
Every unauthenticated BaaS function call failed safely, all 13 trading-API authentication bypass attempts returned 401, and the Round-5 encrypted session token was rejected across every direct BaaS, WebSocket, and trading-API boundary.
Engagement outcome
An authorized external red team assessment of a multi-chain crypto trading terminal identified two high-severity configuration issues — three dangling hosting subdomains and an unauthenticated edge surface on its reactive backend API — alongside two medium-severity information disclosures. All server-side authentication controls on the trading API and backend functions were verified to fail safely across more than 450 targeted probes, with zero unauthorized access to user funds, wallets, or account state. Remediation guidance and prioritized hardening steps were delivered under confidentiality.
1. The engagement in numbers
| Metric | Value |
|---|---|
| Root workstreams | 1 |
| Total Swarm Size | 36 |
| Subdomains enumerated | 33 (plus primary domain) |
| BaaS deployments mapped | 4 (1 production-referenced, 3 identical staging clones) |
| Canonical BaaS functions reconstructed | 136 (from public client bundles) |
| Unauthenticated BaaS probes executed | 457 (205 HTTP + 50 WS in Round 2; 202 deep + 6 controls in Round 4) |
| Trading API auth-bypass variants tested | 13 (all returned 401) |
| Confirmed findings | 6 (2 high, 2 medium, 2 low, 0 critical) |
| Crown jewels proven | 0 of 6 (1 partially proven, 1 exhausted, 4 blocked) |
The zero-critical outcome after five waves is an intentional indicator of forensic discipline. No public client key was promoted to fill the scoreboard, and the dangling subdomain takeover stopped at non-destructive DNS and HTTP verification rather than claiming third-party hosting resources.
Agent topology
| Role | Sessions | Responsibility |
|---|---|---|
| Recon | 13 | Subdomain, port, path, auth, Web3 signal mapping, and wave syntheses |
| Exploit | 13 | BaaS BOLA, subdomain takeover, API order probes, deep mutation & token waves |
| Vulnerability analyst | 8 | OWASP battery, Web3 detection, chain-host enumeration, API deep probes |
| Advisor | 1 | Recon gate review and priority ranking |
| Orchestrator | 1 | Five-wave red-team execution, ROE enforcement, final synthesis |
2. What held
Across five waves of active probing, the platform's core server-side access controls held reliably.
- Per-function authentication on the reactive BaaS failed safely across every probe. Across 205 HTTP and 50 WebSocket probes in Round 2 — followed by 202 deep probes in Round 4 (126 public-data probes across 14 functions, 66 canary mutation probes across 22 state-changing paths on 3 clone deployments, and 10 forged/self-signed token probes) — zero data returned, zero canary values persisted, and zero self-service tokens minted.
- Masked error handling prevented blind function-existence confirmation. Six endpoint controls in Round 4 proved that guaranteed-nonexistent function names, wrong HTTP verbs, invalid argument shapes, and missing format fields all returned the identical masked
Server Error, neutralizing blind error-based function discovery on the clone deployments. - The trading API v2 enforced authentication strictly. All 13 authentication-bypass variants on both
api.terminal.exampleandapi-staging.terminal.examplereturned401. Host-header and forwarded-host manipulations returned403or401. - The core SPA resisted standard web injection classes. Unauthenticated OWASP testing found no XSS, SQL/NoSQL injection, SSRF, template injection, deserialization, or path traversal, and edge CDN cache-poisoning probes returned clean baselines.
Round 5: encrypted token replay and boundary verification
After unauthenticated BaaS BOLA was exhausted in Round 4, an operator-supplied test-account Bearer token was tested in Round 5 to evaluate authenticated cross-tenant access and cross-host replay.
Decoding the token's plaintext header revealed an encrypted JWE ({"alg":"dir","enc":"A128CBC-HS256"} with 128-bit IV, ~446-byte ciphertext, and 128-bit authentication tag) rather than a plain signed JWT. Replaying that token across every in-scope surface mapped a tight cryptographic boundary:
- Direct BaaS
POST /api/queryrejected it withHTTP 401 InvalidAuthHeader; alternate custom BaaS auth header placement was ignored and fell back to null-identityServer Error. - Direct WebSocket sync upgraded (
101 Switching Protocols) and immediately rejected the token withAuthErroron both the custom WebSocket domain and the direct clone deployment. - Eleven attempts against the token-exchange action across six login methods and all four BaaS deployments returned
Server Error(or404on the empty production-referenced deployment). - Production and staging trading APIs both parsed and rejected the token with
401 Unauthorized(distinct from the unauthenticated401 Unauthorized: Missing or invalid token), confirming the gate validates the token cryptographically while revealing that prod and staging share the same parsing path.
3. The findings that mattered
How the estate was mapped
3.1 Three dangling edge-hosting CNAME subdomainsHigh
In plain terms. Three subdomains under the terminal's primary domain still have live DNS CNAME records pointing to decommissioned deployments on the edge hosting provider. Any unauthenticated person with a free hosting account can add those hostnames to their own project, pass the provider's CNAME ownership check automatically, and serve arbitrary web content under the client's trusted domain.
What. All three subdomains (test.staging.swap.terminal.example, test.meta.terminal.example, and staging.test.meta.terminal.example) returned HTTP 404 with the hosting provider's DEPLOYMENT_NOT_FOUND error header while resolving via active CNAMEs to provider edge DNS (CWE-350). Critically, test.staging.swap.terminal.example pointed to the exact same edge CNAME hash as the live production swap host (swap.terminal.example, returning HTTP 200).
How we found it. Subdomain enumeration across 33 hostnames paired with live DNS and HTTP correlation flagged all three DEPLOYMENT_NOT_FOUND responses and compared their CNAME targets against active production subdomains. Per rules of engagement prohibiting third-party infrastructure creation, the takeover chain was documented with full DNS and HTTP captures without claiming the names.
Root cause. Decommissioning staging and test deployments on the edge hosting platform without removing the corresponding CNAME records from the authoritative DNS zone.
Impact. An attacker controlling a *.terminal.example subdomain can host convincing wallet-drain phishing pages on the company's genuine domain, abuse parent-domain cookie scope, and satisfy subdomain-matching CORS or postMessage trust checks.
Fix. Remove the three dangling CNAME records from the authoritative DNS zone immediately (or re-claim them inside the organization's own hosting account), and add automated DNS-to-deployment reconciliation so deleted previews cannot leave orphaned records behind.
3.2 Unauthenticated state-changing BaaS API surfaceHigh
In plain terms. The platform's production-referenced BaaS deployment accepts unauthenticated POST requests directly to /api/mutation and /api/action and parses the JSON body into its typed function router before checking whether the caller is authenticated. Because the edge returns 400 BadJsonBody ("missing field path") rather than 401 Unauthorized, authentication is pushed entirely down into individual backend functions.
What. Sending an unauthenticated POST with {} to /api/mutation or /api/action on baas-prod.backend.example returns HTTP/2 400 with a JSON deserialization error rather than 401 (CWE-306). OPTIONS preflight responses return Access-Control-Allow-Credentials: true alongside GET,POST,OPTIONS,PATCH,DELETE,PUT. The deployment was confirmed first-party via the main SPA bundle and the production CSP connect-src directive.
How we found it. Bundle analysis extracted the client initialization URL and matched it to the CSP allowlist; OWASP battery probes tested /api/mutation and /api/action anonymously and identified the pre-auth deserialization response. Subsequent waves reconstructed 136 canonical function paths from client bundles and ran 457 live probes across four deployments to test whether any individual function lacked an identity check.
Root cause. Absence of a deployment-level authentication gate or authenticating API proxy in front of the BaaS HTTP function router, combined with permissive credentialed CORS preflight headers.
Impact. While per-function authentication held across every tested function — including sensitive limit-order, sniper-order, and gasless-transaction actions — this is a high-risk defense-in-depth failure on a crown-jewel financial backend. In addition, bundle inspection revealed order-creation actions whose schemas accept a client-supplied privateKey parameter, amplifying the blast radius of any future missing identity check.
Fix. Enforce authentication before the function router runs (either via deployment-level auth configuration or an authenticating reverse proxy returning 401 on unauthenticated /api/mutation and /api/action calls), restrict credentialed CORS strictly to the production terminal origin, and add CI checks verifying an explicit identity guard on every non-public mutation and action.
3.3 Full production TypeScript source map exposed on an analytics subdomainMedium
In plain terms. The analytics subdomain (analytics.swap.terminal.example) serves a 2.1 MB production JavaScript source map publicly. Downloading a single static file recovers 101 source entries — including complete, unminified TypeScript source code for environment configuration, routing, and BaaS client setup.
What. GET /assets/<bundle>.js.map returns HTTP 200 with 2,096,833 bytes of valid source map v3 JSON containing full sourcesContent (CWE-540). Fourteen original application TypeScript files were recovered directly, including environment validation schemas, route definitions, provider wrappers, and a hardcoded live clone BaaS URL (baas-clone-1.backend.example).
How we found it. Static asset inspection on discovered subdomains checked for .js.map companions alongside compiled production bundles and verified the full source map payload on disk.
Root cause. Production bundler configuration shipped public source maps to the edge hosting deployment instead of disabling them or uploading them privately to an error-tracking service.
Impact. Acts as a direct reconnaissance multiplier for the backend estate: an attacker recovers internal application architecture, typed schemas, and live non-production backend URLs in one HTTP request without reverse-engineering minified code.
Fix. Disable public source maps in production builds (sourcemap: false or hidden), upload maps strictly to a private error-monitoring platform if needed, and remove stale backend URLs from shipped client configurations.
3.4 Public repository documenting private trading API and fixed signature placeholderMedium
In plain terms. A public source code repository maintained for the trading API documents the exact schemas for private v2 order creation and completion endpoints, supported network identifiers, and an interactive trade-execution sample containing a hardcoded 128-character hex SIGNATURE_PLACEHOLDER commented as "Fixed value, don't change it."
What. Public documentation exposes POST /api/v2/order and POST /api/v2/order/complete, full request/response structures, and a fixed hex signature constant (CWE-200). Both endpoints were confirmed live on production (api.terminal.example) and staging (api-staging.terminal.example), returning 401 to unauthenticated callers.
How we found it. OSINT and repository correlation mapped the public API repository to live trading endpoints, then verified endpoint reachability and auth behavior without submitting state-changing orders.
Root cause. Publishing internal or partner-scoped trading API contracts and sample signing constants in a public repository without authentication gating.
Impact. Reduces the effort required to craft valid trading requests once any API credential is compromised, and raises an unresolved verification question around whether the hardcoded signature placeholder has any special-case acceptance on staging or production order handlers.
Fix. Confirm in backend code that the hardcoded placeholder string is never accepted as a valid signature in any environment, and move private trading API documentation behind an authenticated developer portal if partner-only access is intended.
Also confirmed
| Finding | Severity | Content |
|---|---|---|
Direct BaaS deployment URLs bypass edge CDN controls and expose 4-deployment topology (CWE-200) | Low | Custom WebSocket/API hostnames return edge-proxy block 1010 on direct POST, while direct *.backend.example URLs bypass the edge proxy entirely and reveal 1 empty/mismatched prod-ref deployment plus 3 identical staging clones sharing one build hash |
BaaS function-surface discovery and error-masking characterization (CWE-200) | Low | Initial 200-vs-404 enumeration flagged 66 functions across 3 clones; Round-4 controls refined this honestly by proving masked Server Error fires identically for nonexistent paths, while confirming 136 canonical function names remain directly extractable from public client bundles |
4. Kill chain summary
| Chain | Reached | Terminated at | Data obtained |
|---|---|---|---|
| Dangling hosting CNAMEs (CJ #6) | Stage 3 (delivery proof) | Stopped before claiming third-party infra (ROE) | DNS CNAME + HTTP 404 proofs |
| Unauthenticated BaaS BOLA (CJ #4) | Stage 4 (exploit attempts) | Fail-safe per-function auth (457 probes) | None (error masks only) |
| Source map -> backend recon (enabler) | Stage 5 (collection) | Static asset read | 14 TS modules + clone URL |
| Public repo -> v2 order API (enabler) | Stage 3 (delivery) | 401 enforced across 13 bypasses | Public schemas + placeholder |
| Round-5 JWE token replay (CJ #4/#1) | Stage 3 (delivery) | 401 / AuthError / exchange rejection | Token structure (A128CBC-HS256) |
| On-chain / wallet jewels (CJ #1/#2/#3/#5) | Stage 1 (recon) | Active wallet session + signed RPC scope required | 490 EVM + 198 non-EVM addresses enumerated |
5. What the shape of this engagement teaches
An empty critical column after honest exhaustion is a real result. Testing 457 unauthenticated BaaS probes, 13 API bypass variants, and a full encrypted-token replay matrix proved that core server-side authentication actually works. Refusing to inflate public frontend keys or unexecuted takeovers into fake criticals makes the two real high-severity findings stand out clearly.
Dangling preview DNS is the fastest path to trusted-domain compromise. When a staging subdomain shares a CNAME edge hash with a live production swap service, leaving that record behind after deleting a deployment hands any outsider a ready-made phishing surface on the company's real domain.
Per-function authentication without an edge gate is fragile by construction. Deserializing unauthenticated POST bodies into /api/mutation and /api/action works safely only as long as every single function across every deployment remembers its identity check. Adding an edge auth gate converts a 136-point human discipline problem into one enforced boundary.
Controls separate real oracles from masked errors. Round 2 appeared to show a clean 200-vs-404 function-existence oracle; Round 4's six negative controls proved the masked Server Error fired identically even for guaranteed-nonexistent paths. Running negative controls keeps error-masking behavior from being misreported as a blind enumeration primitive.
Encrypted session tokens need cross-environment key separation. Round 5 showed that both production and staging trading APIs parsed the supplied Bearer token before rejecting it, confirming that shared token-parsing paths across environments require distinct signing/encryption keys so a staging credential can never replay against production.
Recommended sequence
| Priority | Action | Why first | Effort |
|---|---|---|---|
| 1 | Delete or reclaim the 3 dangling edge-hosting CNAME records | Immediately claimable by any free hosting account; one shares a live production swap CNAME hash | Very low |
| 1 | Gate BaaS /api/mutation and /api/action before the function router (return 401) | Eliminates single-omission cross-tenant BOLA cliff across 136+ functions | Low |
| 2 | Disable public source maps on the analytics subdomain and remove stale backend URLs | Stops instant recovery of full TypeScript source and internal clone deployments | Very low |
| 2 | Audit the hardcoded SIGNATURE_PLACEHOLDER in backend code and review public repo scope | Ensures sample constants cannot be accepted on any environment | Low |
| 3 | Restrict direct BaaS deployment URLs or align edge-proxy protections; retire unused clones | Prevents bypassing edge controls via direct *.backend.example hostnames | Medium |
| 3 | Verify distinct token encryption/signing keys between production and staging trading APIs | Prevents cross-environment token replay if a valid credential is obtained | Low |
| 4 | Run a scoped authenticated follow-up with a fresh live delegated-wallet session | Unblocks testing of crown jewels #1, #3, #4 (auth BOLA), and #5 | Medium |
Notices
Authorization
This was an authorized external red team assessment conducted under written engagement terms. All probing stayed within in-scope hostnames and respected strict safety boundaries: no real hosting projects were created to claim dangling subdomains, no mainnet transactions were broadcast, state-changing probes used neutral canaries exclusively on non-production clone deployments, and production remained read-only.
Redaction
Every hostname, IP address, backend deployment slug, CNAME hash, build hash, repository name, wallet/signing vendor name, and calendar date in this document has been replaced with a placeholder or generalized.
What was removed:
- All real domains, subdomains, BaaS deployment slugs, and edge CNAME hashes
- All IP addresses, hosting-region codes, and build hashes
- All organization, terminal, repository, wallet-provider, hosting-provider, and DeFi protocol names
- All raw tokens, ciphertext values, wallet addresses, and organization UUIDs
- Exact calendar dates and session identifiers
What was kept, deliberately: vulnerability classes and CWE identifiers, exact probe and control counts, HTTP status codes and deserialization/error differentials, JWE algorithm metadata (dir/A128CBC-HS256), and the honest separation of confirmed findings, exhausted paths, and credential-blocked crown jewels. These are transferable engineering lessons and identify nobody.
Placeholders used throughout:
| Placeholder | Meaning |
|---|---|
terminal.example | Primary trading terminal domain and estate |
swap.terminal.example / test.staging.swap.terminal.example | Live production swap host and dangling staging sibling |
analytics.swap.terminal.example | Subdomain serving the 2.1 MB production source map |
api.terminal.example / api-staging.terminal.example | Production and staging v2 trading APIs |
baas-prod.backend.example / baas-clone-1..3.backend.example | Production-referenced and clone BaaS deployments |
<redacted> | Any key, token, address, hash, or identifier |
Data handling
No user wallet data, account balances, private keys, or live credentials were obtained or reproduced. The operator-supplied test-account token was analyzed strictly for header structure and boundary rejection behavior and is never printed.
Disclaimer
Findings reflect the state of the tested systems during the engagement window. Security posture changes over time; a finding documented here does not imply the condition persists today.
The dangling subdomain takeover is reported as high severity based on verified DNS CNAME and `HTTP 404 DEPLOYMENT_NOT_FOUND` evidence; takeover was deliberately not executed under rules of engagement.
Four of six crown jewels are reported as blocked rather than passed because unauthenticated testing cannot verify authenticated delegated-signing, bridge, or cross-tenant BOLA controls.
Methodology and tooling by BlackBit. Two real high-severity edge and DNS exposures proven cleanly; zero criticals fabricated after 457 fail-safe backend probes and an authenticated JWE replay matrix. Published with the client's permission.
More in Web3
- Open-Source Payments Cryptocurrency Network and Masternode Ecosystem
- On-Chain Multi-Asset Markets and Perpetuals Trading Platform
- On-Chain Real-World Asset Perpetuals Trading Protocol
- Mobile-First Social Crypto Trading App
- On-Chain Automated Liquidity, Borrowing, and Leverage Protocol
- Decentralised Stablecoin and Institutional Yield Protocol
- View all 33 Web3 case studies