Skip to content

Case study · Web3

On-Chain Real-World Asset Perpetuals Trading Protocol

A static HTTP Basic credential shipped in public frontend JavaScript unlocked authenticated historical price-candle twins, paired with a market-volume authorization gap and three verbatim-evidenced refutations.

Findings · 8
2 High5 Low1 Other
FindingVulnerabilitySeverity
3.1Hardcoded HTTP Basic service credential in public bundles unlocks OHLC twinsCWE-798Anonymous POST requests to the historical OHLC endpoint fail with HTTP 403 and {"message":"Please provide token"}.High
3.2Flapping authorization gate on the production market-volume metadata APICWE-285An authorization gate on a production metadata endpoint intermittently drops and returns across deployment or replica boundaries (CWE-285), exposing the endpoint anonymously without authentication and producing inconsistent security posture over time.High
3.3Direct load-balancer exposure and unhandled CORS preflight errors on the loyalty backendCWE-755Direct origin reachability allows callers to bypass CDN-level controls on the loyalty service, and a fourth unhandled response class (HTTP 500 on preflight OPTIONS, CWE-755) points to fragile CORS middleware error handling.Low
Eight stale dangling CNAME records to deleted cloud ELBs (CWE-350)CWE-350Staging GitOps, monitoring, cluster-management, and bot hostnames resolve to NXDOMAIN hash-derived ELBs; 0 of 8 claimableLow
Four incomplete distribution-CDN cleanups (CWE-459)CWE-459Two hosts return empty 404 CDN errors and two return 502 origin-unresolvable errors; safely behind the client's reverse proxy, 0 claimableLow
Gasless relay CORS reflection, verbose schemas, strip-mode, and stage-host disclosureArbitrary Origin reflected without credentials on read routes; 400 responses expose full typed intent schema and name relay.stage.core.perp.example when given a testnet chain ID; unknown intent fields stripped rather than rejectedLow
Unauthenticated route breadth and code-existence oracles14 newly mapped anonymous metadata/loyalty routes plus unauthenticated access-code (400) and referral-code (404) existence oraclesLow
First-party telemetry proxy hygiene (CWE-1230 hardening note)CWE-1230Public telemetry SDK key shipped in client JS; /ingest proxy forwards cross-site Set-Cookie headers and advertises X-Internal-API-Key in preflight headers; no unauthenticated read/write surface foundInfo

Executive summary

What we were asked to do

An on-chain perpetuals trading protocol offering leveraged exposure to real-world assets and digital currencies commissioned an external assessment of its public web, API, and cloud-edge estate. The architecture separates on-chain execution on a Layer-2 network from a cluster of off-chain support services: historical price-candle feeds, market-volume metadata, a gasless partner order relay, a trader loyalty backend, an authenticated GraphQL gateway, and a first-party telemetry proxy.

The engagement ran across five structured waves and produced two high-severity findings on the production data plane — alongside three rigorous refutations that closed apparent critical paths and prevented unnecessary incident response.

Principal findings

A static HTTP Basic service credential shipped inside two public frontend JavaScript bundles and replayed directly against authenticated historical price-candle endpoints across two production twins, turning anonymous 403 rejections into 201 responses carrying live historical OHLC market data. Separately, an authorization gate on the production market-volume metadata API was observed flapping across deploy or replica boundaries — returning 404 anonymously on an initial pass while accepting the shipped credential (200), then opening to anonymous 200 requests, briefly re-gating to 404, and reopening anonymously three consecutive times within roughly two hours. That measurement forced an honest retraction of an earlier "estate-wide credential sharing" claim and narrowed the shipped credential's unique privilege to the historical price-feed pair alone. Three apparent takeover and bypass leads — a staging GitOps control plane, a gasless partner relay, and four distribution-CDN hostnames — were each refuted with verbatim network evidence.

What this means in plain terms

Three things leadership should take from this assessment.

  • A backend service credential was embedded in public client code. Any visitor loading the trading web app received an HTTP Basic credential that unlocked authenticated historical price-data endpoints. A sweep of all 105 public frontend chunks confirmed this was a one-off mistake rather than a systemic pattern, which makes cleanup straightforward.
  • An API access gate flapped open and closed across live observations. An endpoint that required credentials during one pass answered anonymously during the next, returned to gated briefly, and then opened again within two hours. Inconsistent authorization across replicas or deploys is a reliability and governance risk even when the exposed dataset is public market volume.
  • Three alarming leads were disproven before anyone spent time fixing ghosts. A staging deployment-automation console turned out to be a deleted cloud load balancer returning NXDOMAIN; four dead CDN hostnames were safely anchored behind the client's own reverse-proxy edge; and the gasless order relay enforced partner allowlisting and source-IP rate limiting correctly.

The five things that need a decision, not a patch

#What is wrongBusiness impactWho decides
1A static HTTP Basic credential ships in public JavaScript and unlocks historical OHLC feedsSecrets shipped to browsers are public by definition. Whether historical candles should be public or gated behind per-client tokens is a product and API-governance choice.Platform engineering + product
2A production market-volume route's access gate flaps between 404 and anonymous 200The data itself is market volume, not private user balances, but a gate that silently drops across deploys means route-level authorization is not enforced as code.Platform engineering + SRE
3Eight stale CNAME records and four dead CDN entries remain published in production DNSNone are currently claimable by an attacker, so there is no active takeover, but dead infrastructure records create recurring monitoring noise and future hygiene risk.Infrastructure
4A loyalty backend is directly reachable at its cloud load balancer, bypassing the edge CDNBecause the origin accepts direct traffic, the edge CDN is not a security boundary for that service, and CORS preflight requests trigger unhandled 500 errors.Infrastructure + backend
5Authenticated GraphQL tenant isolation remains untested without a live wallet sessionPublic bundle analysis mapped the exact identity-token path to the GraphQL gateway, leaving a concrete operator-gated follow-up to verify cross-user isolation.Security leadership

What we did not get

No control-plane compromise. No unauthorized gasless order submission. No subdomain takeover. No private user balance, private key, or trading account takeover. No second hardcoded service credential anywhere in the 105-chunk client bundle.

Every apparent takeover candidate proved unclaimable, every unauthenticated per-user endpoint on the metadata service rejected missing or forged identity tokens with 401, and the gasless order relay rejected unauthorized traders before reaching cryptographic signature verification.

Engagement outcome

An authorized external security assessment of an on-chain perpetuals trading protocol identified a hardcoded service credential shipped in public client code and an intermittently flapping authorization gate on a market-volume metadata route. No user funds, private keys, trading sessions, or control-plane systems were compromised, and three initially suspected takeover and relay-bypass paths were independently refuted. All confirmed findings and hardening recommendations were delivered under confidentiality with prioritized remediation guidance.


1. The engagement in numbers

MetricValue
Root workstreams1
Total Swarm Size229
Protocol hostnames in scope33
Dead origins monitored for revival13 (0 revived)
Frontend JS chunks audited105
Hypotheses tracked29 (17 confirmed, 9 rejected, 1 unverified, 2 not a vulnerability)
Crown jewels achieved1 of 5 (3 refuted, 1 operator-gated)
Distinct high-severity issues2 (hardcoded OHLC credential; flapping metadata auth gate)
State-changing requests sent0 (strict read-only discipline throughout)

The zero state-changing request count was maintained across all five waves. Even when verifying the gasless order relay and the first-party telemetry proxy, probes used invalid signatures or read-only verbs so no live order, account, or telemetry record was ever mutated.

Agent topology

RoleSessionsResponsibility
Recon151OSINT, DNS, port scanning, HTTP triage, per-host depth across two cycles
Advisor41Phase gates, evidence critiques, convergence audits
Scout25Surface promotion, credential blast-radius scoping, initial door checks
Hunter9Multi-wave verification, differential testing, negative controls
Synthesis verify2Cross-artifact completeness and evidence integrity checks
Orchestrator1Wave planning, budget control, board convergence
Fig 01 · Agent topology
Fig 01 · Agent topology

2. What held

Three of the five target crown jewels were refuted with verbatim evidence, and multiple security controls held under targeted differential testing.

  • The gasless order relay enforced strict pre-signature partner allowlisting and source-IP rate limiting. Schema validation (400) ran first, followed by a partner-allowlist check (403) before cryptographic signature verification. An interleaved 21-request paired burst alternating X-Forwarded-For values proved the rate limiter keys on the true connection source IP rather than spoofed forwarding headers. Probing three on-chain fee-earning builder addresses alongside random and zero-address controls returned byte-identical 68-byte 403 responses, closing the unauthenticated membership-oracle branch.
  • Per-user metadata and GraphQL authentication rejected forged tokens. User profile, username, and referral endpoints returned 401 on both missing and fabricated identity headers. On the authenticated GraphQL gateway, 37 JWT issuer candidates — including the backend hostname recovered directly from shipped frontend code — were uniformly rejected with 401 Invalid token issuer.
  • Every suspected subdomain takeover path was dead and unclaimable. Eight dangling CNAME records pointed to deleted hash-derived cloud load balancers returning NXDOMAIN across three independent resolvers; four dead distribution-CDN hostnames sat behind the client's own reverse-proxy edge with owner-issued TLS certificates. Zero of 13 dead origins revived across the assessment window.
  • The hardcoded credential was isolated, not systemic. A full sweep of all 105 public client JavaScript chunks confirmed zero second service credentials. Every other embedded API key bound to third-party client SDKs or user-scoped wallet-auth tokens.
Fig 02 · 2. What held
Fig 02 · 2. What held

Refutation and self-correction: why two high-profile claims were closed

Two disciplined verification steps prevented false reporting during the engagement.

First, passive reconnaissance flagged a staging GitOps control plane (deploy-stage.perp.example) with two published control-plane CVEs (an anonymous-access bypass and a settings-endpoint exposure). Live resolution proved the CNAME pointed to a deleted cloud load balancer returning NXDOMAIN with zero A records across the system resolver and two public recursive resolvers, causing TLS to fail at name resolution. Both CVEs were explicitly corrected to not_applicable, and a follow-up sweep of seven sibling dangling CNAMEs (including staging monitoring and cluster-management hostnames) proved all seven pointed to deleted hash-derived load balancers.

Second, two unauthenticated data-exposure candidates — per-trader order/trade reads on the gasless relay and a three-way cross-host trader join combining the relay, the loyalty service, and the on-chain indexer — were mechanically confirmed against live addresses, then subjected to an advisor-mandated impact diff. Every returned field was either a direct mirror of the public on-chain indexer or deterministically derived via formulas published in the same public API specification. Both were honestly closed as reviewed, not a vulnerability rather than inflated into data-leak findings.

Fig 03 · Refutation and self-correction: why two high-profile claims were closed
Fig 03 · Refutation and self-correction: why two high-profile claims were closed

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 Hardcoded HTTP Basic service credential in public bundles unlocks OHLC twinsHigh

In plain terms. The public trading application ships a hardcoded username-and-password pair (Authorization: Basic <redacted>) inside two frontend JavaScript chunks. That credential is not a harmless public identifier: it is actively verified by the historical price-feed backend and unlocks authenticated candle queries across two production hostnames (price-history.core.perp.example and history.perp.example).

What. Anonymous POST requests to the historical OHLC endpoint fail with HTTP 403 and {"message":"Please provide token"}. Replaying the Basic credential extracted from the public bundle succeeds with HTTP 201 and returns live historical price candles on both twins.

How we found it. Bundle inspection across the 105-chunk frontend mirror recovered the static credential in two modules (charting and portfolio). To prove the backend was performing real credential validation rather than checking header presence alone, the hunter wave ran a three-way control: no header (403 "Please provide token"), a neutral wrong-password Basic header (403 "Forbidden resource"), and the shipped credential (201 live candle payload).

Root cause. Embedding a shared backend service credential directly in client-side browser code (CWE-798), where every anonymous user can extract and replay it without per-client scoping or rate attribution.

Fig 05 · 3.1 Hardcoded HTTP Basic service credential in public bundles unlocks OHLC twins
Fig 05 · 3.1 Hardcoded HTTP Basic service credential in public bundles unlocks OHLC twins

Impact. Any external actor can invoke the authenticated historical price-feed API indefinitely using the protocol's own service identity, bypassing whatever client access control the 403 gate was intended to enforce. Wave-3 verification confirmed the credential's unique blast radius is strictly bounded to this OHLC route pair and does not unlock private user records.

Fix. Rotate the static credential immediately and remove it from frontend bundles. Either make the OHLC feed explicitly public with per-IP edge rate limiting, or proxy browser requests through a backend endpoint that injects server-side secrets without exposing them to clients.


3.2 Flapping authorization gate on the production market-volume metadata APIHigh

In plain terms. During initial scoping, the production market-volume endpoint on metadata.core.perp.example appeared gated: anonymous requests received an empty 404 from the load balancer while requests carrying the shipped Basic credential received 200 with live 24-hour trading volume data. On a subsequent verification pass, that gate vanished — anonymous requests returned the identical 200 JSON payload. Shortly after, control probes observed it gated (404) again, and a third-timestamp check roughly two hours later observed anonymous 200 responses three consecutive times.

What. An authorization gate on a production metadata endpoint intermittently drops and returns across deployment or replica boundaries (CWE-285), exposing the endpoint anonymously without authentication and producing inconsistent security posture over time.

How we found it. Instead of accepting the initial credential-replay success as static truth, Wave 3 re-ran full no-auth controls on every previously confirmed route. That control revealed the gate had dropped — immediately invalidating the earlier "estate-shared credential" narrative — and Wave 4 re-verified the route at a third timestamp to confirm the gate was actively flapping rather than permanently changed.

Root cause. Inconsistent authorization or load-balancer listener routing across deploys or backend replicas, rather than deterministic config-as-code enforcement at the application middleware or edge layer.

Fig 06 · 3.2 Flapping authorization gate on the production market-volume metadata API
Fig 06 · 3.2 Flapping authorization gate on the production market-volume metadata API

Impact. While 24-hour market volume is not private customer data, a production authorization gate that silently opens and closes within hours demonstrates uncontrolled access-policy drift. If the same deployment pattern governs sensitive routes, a routine rollout could silently strip authentication.

Fix. Enforce route-level authorization as version-controlled code (either explicitly public or uniformly authenticated across all replicas), remove environment-dependent load-balancer routing differences, and add automated deploy checks plus alerting for unexpected 200 responses on gated routes.


3.3 Direct load-balancer exposure and unhandled CORS preflight errors on the loyalty backendLow

In plain terms. The trader loyalty service (loyalty.core.perp.example) publishes direct public A records pointing straight to its cloud load balancer rather than routing exclusively through the edge CDN. In addition to bypassing edge controls, sending a standard browser CORS preflight (OPTIONS with Origin and Access-Control-Request-Method) to the direct origin triggers an unhandled 500 Express error, whereas a bare OPTIONS request returns 204.

What. Direct origin reachability allows callers to bypass CDN-level controls on the loyalty service, and a fourth unhandled response class (HTTP 500 on preflight OPTIONS, CWE-755) points to fragile CORS middleware error handling. Separate route mapping on the same service also confirmed unauthenticated access to a 1.2 MB trading standings leaderboard and per-wallet loyalty lookups keyed solely by wallet address.

How we found it. DNS inspection identified direct public cloud A records with no CDN CNAME. Structured differential probing on the direct load balancer compared bare OPTIONS (204) against preflight-header OPTIONS (500), while six direct GET requests returned identical 200 responses. (The engagement explicitly logged a test-harness labeling error on one GET comparison and relied on verified same-day CDN captures rather than overclaiming.)

Root cause. Public load-balancer ingress without CDN-egress restriction, combined with unhandled exception paths in the backend CORS middleware.

Fig 07 · 3.3 Direct load-balancer exposure and unhandled CORS preflight errors on the loyalty backend
Fig 07 · 3.3 Direct load-balancer exposure and unhandled CORS preflight errors on the loyalty backend

Impact. Any rate limiting, bot filtering, or access control placed on the edge CDN does not protect the loyalty origin. The unhandled 500 on standard preflight requests indicates middleware fragility that warrants hardening, and bulk per-wallet loyalty lookups can be walked without authentication.

Fix. Restrict the load balancer security group to accept traffic only from the edge CDN's egress ranges, fix the CORS preflight handler to return a clean 204 with explicit allow headers, and evaluate whether per-wallet loyalty records should require the same identity token already enforced on user-profile routes.


Also confirmed

FindingSeverityContent
Eight stale dangling CNAME records to deleted cloud ELBs (CWE-350)LowStaging GitOps, monitoring, cluster-management, and bot hostnames resolve to NXDOMAIN hash-derived ELBs; 0 of 8 claimable
Four incomplete distribution-CDN cleanups (CWE-459)LowTwo hosts return empty 404 CDN errors and two return 502 origin-unresolvable errors; safely behind the client's reverse proxy, 0 claimable
Gasless relay CORS reflection, verbose schemas, strip-mode, and stage-host disclosureLowArbitrary Origin reflected without credentials on read routes; 400 responses expose full typed intent schema and name relay.stage.core.perp.example when given a testnet chain ID; unknown intent fields stripped rather than rejected
Unauthenticated route breadth and code-existence oraclesLow14 newly mapped anonymous metadata/loyalty routes plus unauthenticated access-code (400) and referral-code (404) existence oracles
First-party telemetry proxy hygiene (CWE-1230 hardening note)InformationalPublic telemetry SDK key shipped in client JS; /ingest proxy forwards cross-site Set-Cookie headers and advertises X-Internal-API-Key in preflight headers; no unauthenticated read/write surface found

4. Kill chain summary

Fig 08 · 4. Kill chain summary
Fig 08 · 4. Kill chain summary
ChainReachedTerminated atData obtained
Shipped Basic credential -> OHLC twinsStage 5 (collection)Narrowed to OHLC route pair onlySample live OHLC candle payload
Flapping metadata gate -> volume APIStage 5 (collection)Public market-volume dataset onlySample 24h market volume JSON
Staging GitOps & dangling CNAMEsStage 2 (weaponize)Deleted ELB NXDOMAIN (0 claimable)None
Gasless relay allowlist & XFF bypassStage 3 (delivery)Pre-crypto 403 + source-IP limiterNone
GraphQL tenant isolationStage 2 (weaponize)37 issuer probes rejected; needs wallet tokenNone
First-party telemetry proxyStage 2 (weaponize)405 POST-only; write deferred per ROENone

5. What the shape of this engagement teaches

Re-running negative controls catches both drift and overclaiming. Without Wave 3's no-auth control re-check on the metadata service, the engagement would have overstated the shipped Basic credential as an estate-wide master key. Re-measuring revealed the gate was flapping — turning an overstated claim into a more accurate and more actionable operational finding.

Client-side bundles should never carry backend service credentials. Even when the underlying dataset is semi-public market data, shipping an HTTP Basic credential in public JavaScript creates an unrevocable shared identity with no per-client accountability. Sweeping all 105 chunks proved the mistake was isolated, giving engineering a clean, bounded fix.

Publicly derivable data is not a vulnerability. Mechanically confirming that an API returns per-trader positions or joins across hosts is only half the analysis. Diffing those fields against the public on-chain indexer proved every field was already public or formula-derived — keeping the report focused on real risk rather than noise.

Passive CVE matching fails without live reachability verification. Two high-profile control-plane CVEs vanished the moment live DNS checks proved the underlying cloud load balancer no longer existed. Verifying reachability before escalating saves engineering teams from chasing ghosts.

Documenting coverage gaps explicitly makes the remaining risk actionable. Seven concrete, non-refuted gaps — led by the wallet-authenticated GraphQL tenant-isolation lane — were preserved with exact unlock conditions so the client can test them on demand without repeating reconnaissance.

PriorityActionWhy firstEffort
1Rotate the hardcoded OHLC Basic credential and remove it from client bundlesActive credential exposed to every browser visitor across two production twinsLow
1Lock the metadata volume route's authorization policy as config-as-code with alertingGate flapped open and closed across live observations within ~2 hoursLow
2Restrict the loyalty load balancer to CDN egress IPs and fix the preflight 500 errorDirect origin access bypasses CDN controls; preflight crashes middlewareLow
2Run an authenticated follow-up on the GraphQL gateway with a test wallet sessionSole remaining operator-gated crown jewel; full auth chain already mappedMedium
3Remove the 8 stale ELB CNAME records and 4 dead CDN DNS entriesEliminates stale infrastructure debt and future takeover-monitor noiseLow
3Enable strict schema mode and generic error messages on the gasless order relayStops pre-auth disclosure of internal staging hostnames and unknown-field strippingLow
4Proxy-embed the telemetry SDK key and strip forwarded third-party cookies/internal headersCleans up minor proxy leakage on the /ingest endpointLow

Notices

Authorization

This was an authorized external security assessment conducted under written engagement terms. All testing remained within in-scope protocol hostnames and respected sequential rate limits and strict read-only rules of engagement. Zero state-changing requests were sent: relay probes used cryptographically invalid signatures, telemetry write endpoints were left unprobed by design, and no claim was attempted on any dangling DNS record.

Redaction

Every hostname, IP address, credential, wallet address, third-party vendor identifier, and timestamp in this document has been replaced with a placeholder or generalized.

What was removed:

  • All real domains, subdomains, internal cluster names, and staging hostnames
  • All IP addresses, load-balancer hostnames, CDN distribution IDs, and cloud regions
  • All hardcoded Basic credentials, SDK keys, wallet-auth app identifiers, and subgraph UUIDs
  • All wallet addresses, trade IDs, request IDs, and exact ETags
  • Organization, protocol, chain, and third-party vendor brand names
  • Exact calendar dates and UTC timestamps

What was kept, deliberately: vulnerability classes and CWE identifiers, HTTP status codes and error-differential mechanics, the 29-row hypothesis breakdown, the three-timestamp flapping sequence, the 21-request paired-burst rate-limit methodology, and the exact coverage-gap taxonomy. These are transferable engineering lessons and identify nobody.

Placeholders used throughout:

PlaceholderMeaning
perp.exampleProtocol primary domain and estate
price-history.core.perp.example / history.perp.exampleHistorical OHLC price-feed twin hosts
metadata.core.perp.exampleMarket-volume and user-metadata service
relay.core.perp.example / relay.stage.core.perp.exampleProduction and staging gasless order relay
loyalty.core.perp.exampleTrader standings and points backend
deploy-stage.perp.exampleDecommissioned staging GitOps CNAME
<redacted>Any credential, key, wallet address, or identifier

Data handling

No live trader identities, wallet addresses, private balances, or raw credentials are reproduced. Market-data responses are referenced solely to prove authorization deltas.

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 flapping authorization gate was observed across three live verification windows; its internal mechanism (deploy versus replica routing) was inferred externally and requires operator telemetry to confirm.

Three crown-jewel candidates are reported as refuted based on verbatim DNS, TLS, and HTTP control evidence; seven named coverage gaps remain explicitly open pending operator-supplied credentials or infrastructure.


Methodology and tooling by BlackBit. One service credential verified and bounded to its exact blast radius; one flapping authorization gate caught by disciplined negative controls; three apparent takeovers and bypasses refuted with evidence. Published with the client's permission.

More in Web3

← All case studies