Skip to content

Case study · Web3

Digital Asset Investment Management and Web3 Advisory Firm

While private deal data and funds held, testing proved a substring-match CORS bypass and SSE URL bearer-token leak on an incubated due-diligence API, an OAuth redirect relay on the secondaries portal, and public wallet/PnL exposure.

Findings · 12
2 High7 Medium3 Low
FindingVulnerabilitySeverity
3.1Substring-match CORS origin reflection bypass (String.includes())CWE-942The due-diligence backend API checks whether a browser's Origin header contains the legitimate front-end hostname anywhere as a substring, rather than verifying an exact domain match.High
3.2Bearer token leaked in SSE URL query parameterCWE-598In the front-end application bundle, the client stores its bearer token in localStorage and opens new EventSource(baseUrl + "/api/.../batch/" + batchId + "/stream?token=" + token) (CWE-598).High
3.3Unenforced OAuth redirect_to allowlist on the secondaries portalCWE-601The private secondaries deal-flow portal authenticates brokers and administrators via a hosted OAuth authorize endpoint.Medium
3.4PostgREST anonymous schema and RPC signature oracleCWE-200Although the private secondaries database denied every anonymous data read and function call, its REST layer leaked the entire database blueprint through verbose error hints…Medium
3.5Public agent wallets, leaderboard PII, and live client-side RPC keysCWE-200, CWE-798The incubated prediction-market trading platform exposed full agent profiles — including owner user IDs, linked wallet addresses, P&L, and trade reasoning — without authentication, and shipped two blockchain RPC API keys inside client-side browser storage.Medium
Auth error enumeration (4 distinct CORS-readable 401 bodies)dd-api.advisory.example returns four distinguishable 401 JSON bodies (missing auth, invalid JWT, invalid key, wrong password), all readable cross-origin via 3.1; combined with unthrottled /api/auth/verifyMedium
Error-based information disclosure on due-diligence APIUnhandled 500 errors on CORS failure leak request paths; malformed JSON on /api/auth/verify leaks Node/Express parser internalsMedium
Open redirect input reflection via ?next= on /loginsecondaries.advisory.example/login?next= reflects 5 redirect vectors verbatim into the hidden Server Action input (post-auth redirect execution deferred pending access code)Medium
Realtime permissive WebSocket Origin + protocol joindb.advisory.example accepts arbitrary/null Origin on WebSocket 101 and returns phx_reply: ok on 16 public + 5 private channels before denying data push asynchronously (no rows leaked)Medium
Unauthenticated SDK registration returns paper-only sk_live_ keyPOST /api/sdk/agents/register on trading-api.advisory.example issues a live key, strictly bounded to paper trading (sim: true, real_trading: false, $100/trade cap)Low
Public claim-code metadata lookupGET /api/sdk/agents/claim/{code} returns agent metadata without auth (mitigated by ~4.5e11 code space)Low
Internal and test routes published in public OpenAPI specProduction OpenAPI document on trading-api.advisory.example lists /internal/*, /api/test/force-cycle/{id}, and /api/admin/* routesLow

Executive summary

What we were asked to do

A digital-asset investment firm operating a venture studio and a private secondaries deal-flow portal asked us to assess its public estate from an unauthenticated external vantage. Because venture-studio firms incubate multiple independent products on separate cloud platforms, the estate spanned 29 inventoried hostnames across a corporate web front, a job board, a private secondaries portal backed by a hosted database platform, an incubated due-diligence application, a paused preview deployment, an incubated prediction-market trading API, and public smart-contract repositories.

The assessment set out to test whether an external attacker could achieve admin takeover or service_role database compromise on the private secondaries portal, exfiltrate authenticated due-diligence records cross-origin, or reach real trading funds on the incubated trading platform.

Principal findings

No private deal data was read and no real money was reached, but three distinct application surfaces exposed concrete exploitable primitives. On the incubated due-diligence API, a substring-match CORS check (`String.includes()`) reflected arbitrary attacker origins with credentials enabled across all five endpoints, while the front-end passed bearer tokens in Server-Sent Events (SSE) URL query strings (?token=) and the API exposed four distinguishable CORS-readable 401 error responses. On the private secondaries portal, the hosted OAuth `/auth/v1/authorize` endpoint relayed 8 of 9 attacker-chosen `redirect_to` destinations verbatim into the upstream identity-provider 302 with implicit token flow, /login reflected unsanitised ?next= redirect inputs, and a PostgREST error oracle mapped 16 private tables (with columns) and 9 private RPC signatures — including get_app_secret(secret_name) — using only the public anonymous JWT. On the incubated prediction-market trading platform, unauthenticated profile and leaderboard endpoints exposed linked wallet addresses, owner user IDs, P&L, and full trade histories, alongside two client-exposed blockchain RPC keys (one confirmed live, one revoked mid-engagement). Equally important was what held: all 17 secondaries tables and 9 matched RPCs denied anonymous access (401 PGRST42501), a Wave-1 WebSocket channel-join finding was refuted as a data leak in Wave 2, paper-trading SDK keys could not access real funds or other agents, and zero credentials worked across hosts.

What this means in plain terms

Four things a board should take from this.

  • Your private secondaries deal data held against anonymous attack, but the OAuth front door is too permissive. Row-level security blocked reads on all 17 tables, get_app_secret refused anonymous execution, and every framework middleware bypass failed. The risk is the login seam: an attacker can craft an OAuth link that points a consenting broker or administrator's tokens at an external host, and an error oracle already handed out the exact table and RPC map waiting behind that login.
  • The incubated due-diligence backend trusts any domain containing its front-end hostname as a substring. Registering a lookalike domain makes every API response CORS-readable with credentials, and the front end currently places bearer tokens into SSE URL query parameters where logs and referrers capture them. Full authenticated exfiltration was blocked only because no beta password or bearer key shipped in client code.
  • The incubated trading platform leaked public agent wallets and a live RPC key, but real money was properly isolated. Unauthenticated registration returned a live sk_live_ key, which sounds alarming until inspected: it is strictly capped to paper trading ($100/trade, real trading disabled), and cross-agent BOLA probes failed cleanly. Real money requires a wallet-signed session JWT.
  • Estate segmentation worked. Five captured credentials were replayed across every non-owner host and rejected everywhere with 401. No single compromise automatically cascaded across portfolio apps.

The five things that need a decision, not a patch

#What is wrongBusiness impactWho decides
1The due-diligence API validates CORS via substring matching and accepts bearer tokens in SSE query stringsIncubated studio apps often ship with beta-grade auth defaults. Setting a baseline security bar before external beta launch is a studio governance choice.Venture studio + security
2The private secondaries OAuth authorize endpoint relays unvalidated external redirect_to URLs with implicit flowFixing the allowlist and moving from implicit flow to PKCE closes the sole external path toward harvesting a broker or admin session JWT.Secondaries engineering
3The PostgREST error oracle reveals 16 private table schemas and 9 RPC signatures (including get_app_secret) pre-authDeciding whether get_app_secret should even be callable by any browser-authenticated role — rather than restricted to server-side service_role only — is an architecture decision.Platform architecture
4The incubated trading platform exposes user IDs, wallet addresses, and trade reasoning publicly, plus a live RPC key in client storageSeparating intentional public leaderboard optics from owner-linking identifiers (user_id, wallet addresses) and moving RPC calls behind a proxy needs product sign-off.Product + engineering
5Two high-value authenticated chains (secondaries admin/tenant isolation and due-diligence cross-origin data read) remain untested past the login wallExternal unauthenticated testing reached its natural ceiling. Deciding whether to run a credentialed follow-up with test fixtures determines full assurance.Security leadership

What we did not get

No private deal-board or cap-table rows read. No service_role key, admin session, or broker JWT obtained. No authenticated due-diligence records exfiltrated. No cross-agent trading positions accessed. No real funds touched or moved.

Both primary crown-jewel chains — secondaries admin takeover (session -> get_app_secret -> deal data) and authenticated cross-origin read on the due-diligence API — hit verified credential hard-stops after exhausting every unauthenticated path (11/11 unauthenticated tests failed on secondaries; zero hardcoded beta passwords across all surveyed due-diligence client bundles).

Engagement outcome

An authorized external security assessment of a digital-asset investment manager and its venture studio identified cross-origin and token-handling weaknesses on an incubated due-diligence API, an unenforced OAuth redirect allowlist and pre-authentication database schema oracle on a private secondaries portal, and public wallet-metadata exposure plus a client-side RPC key on an incubated trading platform. No private deal records, administrative credentials, or real funds were accessed, and row-level security, cross-agent access controls, and cross-host credential isolation were verified to hold across the estate. All findings were disclosed under a confidentiality agreement with prioritised remediation guidance.


1. The engagement in numbers

MetricValue
Root workstreams2 (estate-wide + dedicated secondaries deep-dive fork)
Total Swarm Size93
Estate hosts inventoried29 (7 core application hosts deeply probed)
Confirmed findings (deduplicated)12 (2 high, 7 medium, 3 low)
Hard-blocked credential-gated chains2 (due-diligence auth read; secondaries D1→D2)
Confirmed negative / refuted controls9 (RLS, Realtime data push, BOLA, cross-host reuse, middleware, etc.)
Private tables mapped via error oracle16–17 (0 rows readable anonymously)
Private RPC signatures mapped via hints9 matched + 1 hinted (0 executable anonymously)
Cross-host credential reuse observed0 of 5 captured credentials
Real funds accessed or moved$0 (paper-only SDK keys + read-only RPC)

Agent topology

RoleSessionsResponsibility
Recon52DNS/OSINT, nested per-host crawl, schema discovery, synthesis
Scout19Door characterization across corporate, secondaries, due-diligence, trading, jobs, and studio hosts
Hunter10Live CORS chain proof, OAuth/PostgREST/Realtime deep-dive, oracle gap-fill, BOLA, and cross-host replay
Advisor5Independent generation reviews, evidence critique, and soft-wall prevention
Research3Target context, business model, and smart-contract repository scoping
Synthesis-verify2Independent verification of merged findings and provenance
Orchestrator2Estate wave coordination and secondaries deep-dive fork
Fig 01 · Agent topology
Fig 01 · Agent topology

2. What held

Six independent security boundaries held across the estate, and proving where they held was essential to separating real risk from hype.

  • The secondaries anonymous data plane was functionally closed. All 17 mapped database tables returned 401 PGRST42501 (row-level security and missing anonymous SELECT grants); all 9 matched RPCs returned 401 PGRST42501 (EXECUTE denied for anon); zero storage buckets, views, or edge functions were exposed; forged JWTs (alg:none, role:service_role) were rejected; and Next.js middleware bypasses (subrequest-header bypass, ;.js/%3B path aliases, deep /admin/* + /api/*, and crafted RSC router trees) were all refuted.
  • Cross-agent BOLA and real-money boundaries held on the trading platform. Unauthenticated registration issued paper-only sk_live_ keys (real_trading_enabled: false, $100 per-trade cap, no linked wallet). Replaying that key against another agent's cooldowns, sim-positions, and wallet pnl endpoints returned 401 Malformed token or 404 — all agent-parameterised routes enforce wallet-signed JWT ownership claims, and mass assignment of real_trading_enabled was rejected.
  • Cross-host credential isolation held (`0/5` reuse). All five captured credentials (database anon JWT, two trading SDK keys, and two RPC keys) returned 401 on every non-owner host, and cross-bundle searches found zero shared secrets or shared database references between the secondaries, due-diligence, and trading applications.
  • The due-diligence authentication boundary held against external minting. Surveying all three client bundles (nearly 270 KB of JS) revealed zero hardcoded beta passwords, no self-registration route, and rejection of wallet-signature payloads (401 Invalid password).
  • The corporate job portal and paused preview deployment exposed no exploitable surface. Sixteen tested attack classes on jobs.advisory.example (including 10 CRLF probes blocked 403 by the WAF) yielded zero findings; the preview app returned 503 DEPLOYMENT_PAUSED.
  • One exposed RPC key was revoked mid-engagement. A second L1 RPC key confirmed live (getHealth: ok) during scout returned 401 Unauthorized across all header and query formats by the hunter wave, while the sibling EVM RPC key from the same storage object still answered — proving active key rotation.
Fig 02 · 2. What held
Fig 02 · 2. What held

Two refutations worth preserving

Two eye-catching early leads were refuted through deeper hunter verification and advisor review:

  1. WebSocket Realtime channel join refuted as a data-read vulnerability. In Wave 1, an anonymous JWT successfully sent phx_join across all 16 public table channels and 5 private auth channels on db.advisory.example, receiving protocol-level phx_reply: ok and accepting arbitrary/null Origin headers on the 101 WebSocket handshake. That looked like a row-level-security bypass. In Wave 2, deep frame inspection revealed that immediately after phx_reply: ok, the server sent an asynchronous system denial frame (Unable to subscribe to changes with given parameters...) for every table, delivering zero data-bearing pushes. The finding was cleanly split: channel-join authorization gap / permissive WebSocket Origin remains a hardening note, while Realtime data exfiltration is refuted.
  2. Smart-contract "supply chain jewel" refuted as an inflated label. Early OSINT flagged a public studio smart-contract repository and a historical exploit against a similarly named third-party protocol. Source inspection showed the studio repository had no deployment network configuration and no active on-chain deployments, and the historical exploit belonged to an unrelated external project. The label was struck cleanly from the findings ledger.
Fig 03 · Two refutations worth preserving
Fig 03 · Two refutations worth preserving

3. The findings that mattered

How the estate was mapped

Fig 04 · How the estate was mapped
Fig 04 · How the estate was mapped

3.1 Substring-match CORS origin reflection bypass (String.includes())High

In plain terms. The due-diligence backend API checks whether a browser's Origin header contains the legitimate front-end hostname anywhere as a substring, rather than verifying an exact domain match. Any attacker who registers dd-app.advisory.example.<attacker-domain> is trusted as if it were the real application, with credentials allowed.

What. On dd-api.advisory.example (Express), 9 of 13 tested attacker-controlled origin shapes containing the front-end hostname substring were reflected verbatim in Access-Control-Allow-Origin alongside Access-Control-Allow-Credentials: true and Vary: Origin across all five API endpoints (/evaluate, /credits, /batch/{id}, /batch/{id}/download, /batch/{id}/stream) plus the undocumented POST /api/auth/verify route (CWE-942, CVSS 7.5).

Re-verified live from hunter vantage with two independent exchanges:

  • GET /api/dd/credits with Origin: https://dd-app.advisory.example.<attacker-domain> returned 401 with ACAO echoing the attacker origin and ACC: true, making the JSON body readable cross-origin.
  • POST /api/auth/verify with the same attacker origin returned a distinct 401 Invalid password body, also CORS-readable.

How we found it. By probing a 13-shape CORS origin matrix (suffix append, subdomain prepend, path/port tricks) and re-confirming live from the hunter wave.

Root cause. Implementing the CORS origin allowlist check with origin.includes("<frontend-host>") instead of parsing the URL and comparing exact origin equality against a fixed set.

Fig 05 · 3.1 Substring-match CORS origin reflection bypass (`String.includes()`)
Fig 05 · 3.1 Substring-match CORS origin reflection bypass (`String.includes()`)

Impact. Any authenticated user visiting an attacker-controlled lookalike domain exposes full API responses cross-origin, and combined with four distinct CORS-readable 401 responses and missing rate limiting on /api/auth/verify, enables cross-origin password brute-force. Note the honest boundary: because no beta password or bearer token shipped in client code, the authenticated 200 data-read step remained blocked pending an operator test credential — which is why this finding is calibrated at High (CVSS 7.5) rather than inflated to Critical.

Fix. Replace String.includes() with an exact allowlist check (ALLOWED_ORIGINS.has(origin) after strict new URL(origin).origin parsing), and remove credentials allowance unless strictly required.


3.2 Bearer token leaked in SSE URL query parameterHigh

In plain terms. To stream batch progress over Server-Sent Events, the due-diligence front end appends the user's bearer authentication token directly to the URL query string — and the server honours the URL parameter ahead of the Authorization header.

What. In the front-end application bundle, the client stores its bearer token in localStorage and opens new EventSource(baseUrl + "/api/.../batch/" + batchId + "/stream?token=" + token) (CWE-598). Server-side testing confirmed the query parameter is accepted and takes precedence over the Authorization header.

How we found it. By auditing the unminified module logic of the due-diligence client bundles while investigating token lifecycle and cross-origin chains.

Root cause. Native browser EventSource cannot send custom Authorization headers, so developers often fall back to ?token= query parameters without replacing them with short-lived, single-use stream tickets.

Fig 06 · 3.2 Bearer token leaked in SSE URL query parameter
Fig 06 · 3.2 Bearer token leaked in SSE URL query parameter

Impact. Long-lived bearer tokens leak into infrastructure access logs, analytics pipelines, browser history, and cross-origin Referer headers. Any leaked token pairs directly with the substring CORS bypass (3.1) to read authenticated API responses.

Fix. Remove ?token= support for long-lived bearer tokens. Either use fetch() streaming with an Authorization: Bearer header or mint a short-lived (15–30 second), single-use, stream-scoped ticket via an authenticated POST before opening EventSource.


3.3 Unenforced OAuth redirect_to allowlist on the secondaries portalMedium

In plain terms. The private secondaries deal-flow portal authenticates brokers and administrators via a hosted OAuth authorize endpoint. That endpoint failed to validate its redirect_to parameter against an allowlist, forwarding attacker-chosen external URLs directly into the identity provider's redirect chain using implicit token delivery.

What. Probing GET /auth/v1/authorize?provider=<idp>&redirect_to=<payload> on secondaries.advisory.example confirmed 8 of 9 tested payloads were relayed verbatim into the upstream 302 redirect with flow_type=implicit (CWE-601, CVSS 6.4):

  • External HTTPS (https://attacker.example/cb), lookalike subdomain, scheme-relative (//attacker.example), cleartext http://, and even data:text/html,x were all accepted and relayed.
  • Only javascript:alert(1) was blocked — and that rejection came from the edge WAF (403), not the authentication server.
  • By contrast, the error-handling legs (/auth/v1/verify and /auth/callback) properly ignored attacker redirect_to values and redirected back to the configured site URL (303/307).
  • Separately, GET /login?next=<payload> wrote five redirect payloads verbatim into a hidden form field bound to the login Server Action (CWE-601, post-auth execution deferred pending an access code).

How we found it. By running a 14-row redirect matrix against /auth/v1/authorize, /verify, /callback, and /login in the dedicated secondaries deep-dive workstream.

Root cause. Overly broad or wildcard redirect-URL allowlist configuration on the hosted authentication service combined with implicit OAuth flow (flow_type=implicit) rather than PKCE authorization-code flow.

Fig 07 · 3.3 Unenforced OAuth `redirect_to` allowlist on the secondaries portal
Fig 07 · 3.3 Unenforced OAuth `redirect_to` allowlist on the secondaries portal

Impact. Provides the sole unauthenticated external vector toward capturing a broker or administrator session JWT — the single missing credential that gates get_app_secret and the 17 RLS-protected deal tables. End-to-end token arrival was intentionally not executed under ROE (no live third-party consent round-trip), keeping the severity calibrated honestly at Medium (mechanism proven).

Fix. Configure a strict exact-match redirect allowlist containing only the portal's own HTTPS callback path, switch from flow_type=implicit to pkce, and validate the /login?next= parameter to permit only relative paths beginning with a single /.


3.4 PostgREST anonymous schema and RPC signature oracleMedium

In plain terms. Although the private secondaries database denied every anonymous data read and function call, its REST layer leaked the entire database blueprint through verbose error hints — naming 16 private tables, their exact columns, and 9 private RPC functions with exact argument lists, including a secret-retrieval function named get_app_secret(secret_name).

What. Using only the public anon JWT embedded in the client bundle against db.advisory.example, two error differentials mapped the private schema (CWE-200):

  • RPC hint oracle (`PGRST202` → `42501`): Calling candidate RPC paths with mismatched arguments returned 404 PGRST202 hints such as Perhaps you meant to call the function public.rate_limit_hit(p_key, p_max, p_window_seconds). Re-issuing with the exact signature flipped the response to 401 PGRST42501 ("permission denied for function"), proving existence. Nine RPCs were confirmed with exact signatures (get_app_secret(secret_name), rls_auto_enable(), rate_limit_hit(p_key, p_max, p_window_seconds), company_key(name), company_profile_lookup(company), captable_sync_crm(), captable_person_key(n), captable_resolve_firm(p_key, p_name), participant_step_order()), plus one additional hinted function (participant_step_at) whose parameter list remained unresolved.
  • Column differential oracle (`42703` → `42501`): Querying GET /rest/v1/<table>?select=c1,c2,... returned 400 PGRST42703 naming the first absent column, and 401 PGRST42501 once all listed columns existed — enumerating columns across 16 tables (deals, app_users, broker_deals, company_profiles, counterparties, projects, watchlist_items, captable_companies, captable_mentions, project_deals, deal_events, deal_dd_answers, rate_limits, app_user_logins, app_settings, admin_activity_seen).

How we found it. After the secondaries deep-hunter advisor explicitly issued FILL_GAPS rather than accepting a premature soft-wall exhaustion, a dedicated read-only oracle pass resolved rate_limit_hit, discovered company_profile_lookup, and completed the 16-table column map.

Root cause. Exposing internal administrative and secret-handling functions in the public schema served by PostgREST, where schema-cache hint messages and PostgreSQL error codes fire before or alongside permission denials.

Fig 08 · 3.4 PostgREST anonymous schema and RPC signature oracle
Fig 08 · 3.4 PostgREST anonymous schema and RPC signature oracle

Impact. Zero rows were read and zero RPCs executed anonymously — the control held on data access. However, exposing get_app_secret(secret_name) and the entire internal schema in public turns any future session compromise (such as via OAUTH-01 in 3.3) into immediate targeted secret extraction.

Fix. Move internal functions (get_app_secret, rls_auto_enable, rate_limit_hit, captable sync helpers) out of the PostgREST-exposed public schema into a private schema (e.g. internal / private) not listed in db_schemas, and revoke EXECUTE from both anon and authenticated roles on get_app_secret.


3.5 Public agent wallets, leaderboard PII, and live client-side RPC keysMedium

In plain terms. The incubated prediction-market trading platform exposed full agent profiles — including owner user IDs, linked wallet addresses, P&L, and trade reasoning — without authentication, and shipped two blockchain RPC API keys inside client-side browser storage.

What.

  • Public profile and leaderboard exposure (`CWE-200`): Unauthenticated GET /api/agents/{name} and /api/agents/{id}/pnl-history returned full agent profiles, linked EVM wallet addresses, per-venue P&L (over $1.5M simulated P&L plus live venue figures), win/loss counts, and dozens of recent trades with full strategy reasoning. GET /api/leaderboard/sdk-agents and /api/leaderboard/all returned 50 agents simultaneously with agent UUIDs, owner user_id UUIDs, trader_id values, and claimed wallet addresses.
  • Exposed mainnet RPC keys (`CWE-798`): Two third-party blockchain RPC keys were embedded in the wallet-authentication SDK configuration stored in localStorage. Re-testing in the hunter wave confirmed the EVM mainnet RPC key was live (eth_blockNumber returned current mainnet block height, read-only), while the second L1 mainnet RPC key — confirmed live (getHealth: ok) during scout — returned 401 on hunter re-test, indicating independent revocation/rotation mid-engagement.

How we found it. By inspecting the public OpenAPI spec, capturing unauthenticated read responses, and testing client-storage SDK keys with single read-only health/block calls.

Root cause. Returning internal owner identifiers (user_id) and linked wallet addresses on public leaderboard endpoints, and embedding directly billed third-party RPC keys in front-end SDK configs.

Fig 09 · 3.5 Public agent wallets, leaderboard PII, and live client-side RPC keys
Fig 09 · 3.5 Public agent wallets, leaderboard PII, and live client-side RPC keys

Impact. Mass correlation of platform accounts (user_id), wallet addresses, and proprietary trading strategies for targeted phishing or on-chain tracking, plus read-only RPC quota exhaustion against the firm's provider billing. Honest bound: zero real money reached — RPC keys are read-only, and SDK registration keys are paper-trading only.

Fix. Strip user_id and non-public wallet addresses from unauthenticated leaderboard/profile responses, rotate the remaining live EVM RPC key, and proxy client blockchain reads through a rate-limited backend endpoint with origin restrictions.


Also confirmed

FindingSeverityContent
Auth error enumeration (4 distinct CORS-readable 401 bodies)Mediumdd-api.advisory.example returns four distinguishable 401 JSON bodies (missing auth, invalid JWT, invalid key, wrong password), all readable cross-origin via 3.1; combined with unthrottled /api/auth/verify
Error-based information disclosure on due-diligence APIMediumUnhandled 500 errors on CORS failure leak request paths; malformed JSON on /api/auth/verify leaks Node/Express parser internals
Open redirect input reflection via ?next= on /loginMediumsecondaries.advisory.example/login?next= reflects 5 redirect vectors verbatim into the hidden Server Action input (post-auth redirect execution deferred pending access code)
Realtime permissive WebSocket Origin + protocol joinMediumdb.advisory.example accepts arbitrary/null Origin on WebSocket 101 and returns phx_reply: ok on 16 public + 5 private channels before denying data push asynchronously (no rows leaked)
Unauthenticated SDK registration returns paper-only sk_live_ keyLowPOST /api/sdk/agents/register on trading-api.advisory.example issues a live key, strictly bounded to paper trading (sim: true, real_trading: false, $100/trade cap)
Public claim-code metadata lookupLowGET /api/sdk/agents/claim/{code} returns agent metadata without auth (mitigated by ~4.5e11 code space)
Internal and test routes published in public OpenAPI specLowProduction OpenAPI document on trading-api.advisory.example lists /internal/*, /api/test/force-cycle/{id}, and /api/admin/* routes

4. Kill chain summary

Fig 10 · 4. Kill chain summary
Fig 10 · 4. Kill chain summary
ChainReachedTerminated atData obtained
Due-diligence cross-origin data readStage 4 (exploit primitive)Missing beta password / bearer tokenCORS-readable 401 errors only; zero authenticated data
Secondaries admin / service_role takeoverStage 2–4 (OAuth relay + schema map)Missing broker/admin JWT (consent ROE-excluded)16 table schemas + 9 RPC signatures; zero rows
Trading platform wallet/profile leakStage 5 (collection)Read-only public endpoints; real trading JWT-gated50+ agent profiles, user_ids, wallets, paper P&L
Trading platform BOLA / real-money abuseStage 2 (weaponize)JWT claim ownership + paper-only key capsNone (401/404 cross-agent)
Cross-host lateral movementStage 2 (weaponize)0/5 credential reuse across hostsNone (401 everywhere off-owner)
Smart-contract supply chainRefutedNo live deployments; homonymous project excludedNone

5. What the shape of this engagement teaches

Venture-studio estates inherit uneven security maturity across incubated apps. The firm's private secondaries database had strict row-level security on all 17 tables, denied all anonymous RPCs, and resisted every Next.js middleware bypass — yet an incubated beta due-diligence API shipped with a String.includes() CORS check and bearer tokens in SSE query strings. Studio-wide security gates before public beta launch prevent one incubated app from becoming the weakest link.

An `ok` WebSocket join frame is not proof of data access. Wave 1 saw phx_reply: ok on 21 Realtime channels and flagged an authorization bypass; Wave 2 stayed on the wire long enough to read the asynchronous system denial frames proving zero rows flowed. Protocol acknowledgements must be separated from actual data delivery.

Refusing premature soft-wall exhaustion pays off. When the secondaries deep-hunter wave hit the anonymous RLS wall, the independent advisor issued FILL_GAPS instead of EXHAUSTED because concrete credential-free oracle work remained. That extra pass resolved rate_limit_hit, uncovered another hidden RPC, and completed the 16-table column map — giving defenders a complete inventory of what sits in the public schema.

Prefix-named credentials (`sk_live_`) must be verified for actual privilege, not assumed critical. Unauthenticated registration returned a key prefixed sk_live_, which looked like a financial breach until live testing proved it was strictly paper-trading only ($100 cap, real_trading: false, 401 on cross-agent endpoints). Honest impact bounding saves boards from panic over non-monetary exposures.

Cross-host credential isolation turns multi-app sprawl into contained blast radii. Replaying all five captured credentials across every host produced zero cross-host hits. Keeping auth systems, databases, and cloud projects isolated per portfolio company worked exactly as intended.

PriorityActionWhy firstEffort
1Replace String.includes() CORS validation on dd-api.advisory.example with exact origin equalityCloses credentialed cross-origin read across all 5 endpointsVery low
1Remove ?token= query-string bearer auth on the due-diligence SSE stream; use header streaming or single-use ticketsStops long-lived bearer token leakage into logs and referrersLow
1Lock secondaries.advisory.example OAuth redirect_to to an exact HTTPS callback allowlist and switch from implicit flow to PKCECloses the sole external path toward broker/admin session theftLow
2Move get_app_secret and internal RPCs out of PostgREST's public schema and revoke EXECUTE from anon and authenticatedRemoves secret-reader reachability even if a user session is compromisedLow
2Rotate the remaining live EVM RPC key and move client blockchain calls behind a rate-limited backend proxyStops unauthenticated RPC quota abuseVery low
3Strip user_id and non-public wallet addresses from public trading leaderboard/profile endpoints; prune internal routes from OpenAPIReduces PII/wallet correlation and recon exposureLow
3Normalise 401 responses, suppress Express parser details, and rate-limit /api/auth/verify on dd-api.advisory.example; sanitise /login?next=Closes cross-origin brute-force oracle and post-auth open redirectLow
4Run a scoped credentialed follow-up with test fixtures (broker session + beta token) if full tenant-isolation assurance is requiredUnblocks the two credential-gated doors left at the external ceilingDecision

Notices

Authorization

This was an authorized security assessment conducted under a written engagement agreement. All testing was confined to in-scope corporate, secondaries, and venture-studio properties.

Read-only and non-destructive discipline applied throughout: no trades were placed on the trading platform; no real user emails or magic-link flows were triggered; no third-party OAuth consent round-trip was executed against third-party identity providers; no brute force was run against access codes or beta passwords; and client-exposed RPC keys were verified with a single read-only eth_blockNumber / getHealth call each.

Redaction

Every hostname, IP address, credential, wallet address, project reference, and identifier in this document has been replaced with a placeholder or generalised.

What was removed:

  • All real domain names, subdomains, deployment build IDs, and cloud project references
  • All IP addresses, edge PoP identifiers, and third-party vendor names (hosting, database, RPC, wallet auth, and prediction venues)
  • All API keys, RPC keys, JWTs, bearer tokens, Server Action hashes, and ETag digests
  • All wallet addresses, agent names, user UUIDs, and partner/firm identifiers
  • Smart-contract repository names, commit hashes, and unrelated third-party protocol names
  • Exact calendar dates and clock times

What was kept, deliberately: vulnerability classes and CWE/CVSS ratings, exact HTTP and PostgREST error codes (401, PGRST202, PGRST42501, PGRST42703), table and RPC counts as magnitudes (16–17 tables, 9 RPCs, 50+ agents, 9/13 CORS shapes, 8/9 OAuth redirect shapes), the Realtime refutation sequence, and the cross-host replay matrix (0/5). These are transferable and identify nobody.

Placeholders used throughout:

PlaceholderMeaning
advisory.examplePrimary corporate domain
secondaries.advisory.examplePrivate secondaries deal-flow web portal
db.advisory.exampleHosted database/PostgREST/Realtime backend for the secondaries portal
dd-app.advisory.exampleIncubated due-diligence front-end application
dd-api.advisory.exampleIncubated due-diligence Express backend API
trading-app.advisory.exampleIncubated prediction-market trading front end
trading-api.advisory.exampleIncubated prediction-market FastAPI backend
jobs.advisory.exampleCorporate job portal
<redacted>Any key, token, wallet address, project ID, or identifier

Data handling

No private deal record, counterparty name, or confidential cap-table entry was accessed or is reproduced. No real agent name, wallet address, user UUID, or RPC key appears in this document. Public trading-profile exposure is described strictly by field class and aggregate count.

Disclaimer

Findings reflect the state of the tested systems during the engagement window. Security posture changes; a finding here does not imply the condition persists today (indeed, one exposed RPC key was already observed returning 401 before the engagement concluded).

Realtime channel-join is reported as refuted for data exfiltration, not as an RLS bypass, based on asynchronous system denial frames observed in Wave 2. Authenticated chains on the secondaries portal and due-diligence API are explicitly marked hard-blocked on operator fixtures, not implied to be vulnerable beyond what was proven.


Methodology and tooling by BlackBit. Two high-confidence external chains mapped to their exact credential gates, one WebSocket bypass cleanly refuted on the wire, and zero real funds touched. Published with the client's permission.

More in Web3

← All case studies