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 wrong | Business impact | Who decides |
|---|---|---|---|
| 1 | A static HTTP Basic credential ships in public JavaScript and unlocks historical OHLC feeds | Secrets 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 |
| 2 | A production market-volume route's access gate flaps between 404 and anonymous 200 | The 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 |
| 3 | Eight stale CNAME records and four dead CDN entries remain published in production DNS | None 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 |
| 4 | A loyalty backend is directly reachable at its cloud load balancer, bypassing the edge CDN | Because 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 |
| 5 | Authenticated GraphQL tenant isolation remains untested without a live wallet session | Public 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
| Metric | Value |
|---|---|
| Root workstreams | 1 |
| Total Swarm Size | 229 |
| Protocol hostnames in scope | 33 |
| Dead origins monitored for revival | 13 (0 revived) |
| Frontend JS chunks audited | 105 |
| Hypotheses tracked | 29 (17 confirmed, 9 rejected, 1 unverified, 2 not a vulnerability) |
| Crown jewels achieved | 1 of 5 (3 refuted, 1 operator-gated) |
| Distinct high-severity issues | 2 (hardcoded OHLC credential; flapping metadata auth gate) |
| State-changing requests sent | 0 (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
| Role | Sessions | Responsibility |
|---|---|---|
| Recon | 151 | OSINT, DNS, port scanning, HTTP triage, per-host depth across two cycles |
| Advisor | 41 | Phase gates, evidence critiques, convergence audits |
| Scout | 25 | Surface promotion, credential blast-radius scoping, initial door checks |
| Hunter | 9 | Multi-wave verification, differential testing, negative controls |
| Synthesis verify | 2 | Cross-artifact completeness and evidence integrity checks |
| Orchestrator | 1 | Wave planning, budget control, board convergence |
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 alternatingX-Forwarded-Forvalues 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-byte403responses, closing the unauthenticated membership-oracle branch. - Per-user metadata and GraphQL authentication rejected forged tokens. User profile, username, and referral endpoints returned
401on 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 with401 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
NXDOMAINacross 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.
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.
3. The findings that mattered
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.
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.
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.
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
| Finding | Severity | Content |
|---|---|---|
Eight stale dangling CNAME records to deleted cloud ELBs (CWE-350) | Low | Staging GitOps, monitoring, cluster-management, and bot hostnames resolve to NXDOMAIN hash-derived ELBs; 0 of 8 claimable |
Four incomplete distribution-CDN cleanups (CWE-459) | Low | Two 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 disclosure | Low | Arbitrary 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 oracles | Low | 14 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) | Informational | Public 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
| Chain | Reached | Terminated at | Data obtained |
|---|---|---|---|
| Shipped Basic credential -> OHLC twins | Stage 5 (collection) | Narrowed to OHLC route pair only | Sample live OHLC candle payload |
| Flapping metadata gate -> volume API | Stage 5 (collection) | Public market-volume dataset only | Sample 24h market volume JSON |
| Staging GitOps & dangling CNAMEs | Stage 2 (weaponize) | Deleted ELB NXDOMAIN (0 claimable) | None |
| Gasless relay allowlist & XFF bypass | Stage 3 (delivery) | Pre-crypto 403 + source-IP limiter | None |
| GraphQL tenant isolation | Stage 2 (weaponize) | 37 issuer probes rejected; needs wallet token | None |
| First-party telemetry proxy | Stage 2 (weaponize) | 405 POST-only; write deferred per ROE | None |
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.
Recommended sequence
| Priority | Action | Why first | Effort |
|---|---|---|---|
| 1 | Rotate the hardcoded OHLC Basic credential and remove it from client bundles | Active credential exposed to every browser visitor across two production twins | Low |
| 1 | Lock the metadata volume route's authorization policy as config-as-code with alerting | Gate flapped open and closed across live observations within ~2 hours | Low |
| 2 | Restrict the loyalty load balancer to CDN egress IPs and fix the preflight 500 error | Direct origin access bypasses CDN controls; preflight crashes middleware | Low |
| 2 | Run an authenticated follow-up on the GraphQL gateway with a test wallet session | Sole remaining operator-gated crown jewel; full auth chain already mapped | Medium |
| 3 | Remove the 8 stale ELB CNAME records and 4 dead CDN DNS entries | Eliminates stale infrastructure debt and future takeover-monitor noise | Low |
| 3 | Enable strict schema mode and generic error messages on the gasless order relay | Stops pre-auth disclosure of internal staging hostnames and unknown-field stripping | Low |
| 4 | Proxy-embed the telemetry SDK key and strip forwarded third-party cookies/internal headers | Cleans up minor proxy leakage on the /ingest endpoint | Low |
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:
| Placeholder | Meaning |
|---|---|
perp.example | Protocol primary domain and estate |
price-history.core.perp.example / history.perp.example | Historical OHLC price-feed twin hosts |
metadata.core.perp.example | Market-volume and user-metadata service |
relay.core.perp.example / relay.stage.core.perp.example | Production and staging gasless order relay |
loyalty.core.perp.example | Trader standings and points backend |
deploy-stage.perp.example | Decommissioned 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
- Mobile-First Social Crypto Trading App
- On-Chain Automated Liquidity, Borrowing, and Leverage Protocol
- Decentralised Stablecoin and Institutional Yield Protocol
- Web3 Token Distribution, Vesting, and Cap-Table Platform
- Digital Asset Investment Management and Web3 Advisory Firm
- Web3 Gaming Ecosystem and Digital Asset Platform
- View all 33 Web3 case studies