Skip to content

Case study · Web3 CEX

Cryptocurrency Copy-Trading and Derivatives Exchange

Server-side controls blocked all six declared crown jewels, while two waves confirmed 35+ findings including WAF-bypassed reflected XSS across 13 routes, Firebase auth abuse, CSWSH, and staging CORS.

Findings · 10
4 High3 Medium1 Low2 Other
FindingVulnerabilitySeverity
3.1Reflected XSS via WAF bypass across production and UAT SSR routesNuxt SSR templates (web-base-nuxt3, web-accounts-nuxt3, web-main-nuxt2) URL-decode path parameters and interpolate them unencoded into 2–18 hreflang, canonical, and og:url attributes per page.High
3.2Unauthenticated Firebase account minting, domain impersonation, and email enumerationClient JavaScript bundles ship a Firebase Web API key for the exchange's production and staging Firebase projects.High
3.3Cross-Site WebSocket Hijacking, Gson parser leakage, and frame-size asymmetryFive live WebSocket gateways power spot markets, derivatives, cswap, virtual test trading, and CeDeFi push feeds.High
3.4Exposed UAT/staging hosts, credentialed CORS reflection, and internal topology leakSix UAT/QA environments (uat, uat-m, uat-c2c, uat-fiat, uat-tg, qa) are live on the public internet with no login gate, mirroring production XSS and disclosing more than twenty internal backend hostnames.High
CloudFront WAF XSS filter bypass pattern setBlocks eval(, fetch(, prompt(, confirm(, document.write(, setTimeout(, setInterval( (403) but allows URL-encoded attribute breakout with inline event handlers, enabling §3.1.Medium
Permissive production Content-Security-Policyscript-src allows 'unsafe-inline' and 'unsafe-eval'; connect-src, frame-src (blob: *), img-src, font-src, and media-src use wildcards (object-src 'none' and restricted form-action are properly set).Medium
Wildcard CORS and pre-auth OAuth parameter acceptancelogin.copyex.example and oauth-server.copyex.example send Access-Control-Allow-Origin: * (no credentials) on 302 redirects and accept arbitrary redirect_uri or omitted/replayed state pre-auth…Medium
Blind POST acceptance on callback.copyex.exampleReturns {"code":0,"success":true} to empty JSON, garbage objects, and SQLi strings without signature or schema validation.Low
Branded short-link SSL certificate mismatchshort.copyex.example CNAMEs to a third-party URL shortener returning a mismatched CN certificate, indicating a lapsed or unconfigured custom domain.Info
TLS leaf certificate nearing renewal windowWildcard certificate (copyex.example, *.copyex.example) had fewer than 60 days validity remaining at assessment time.Info

Executive summary

What we were asked to do

A cryptocurrency exchange offering spot trading, perpetual derivatives, copy-trading, and CeDeFi features asked us to assess its external estate under black-box conditions. The footprint spanned localized server-side-rendered web applications, REST and OAuth gateways, real-time market and push WebSocket feeds, staging infrastructure, and client-integrated Firebase authentication services.

The assessment tested whether an unauthenticated external attacker could reach any of six declared crown jewels: customer PII theft, admin or control-plane takeover, tenant-isolation break, secret or key compromise, or Web3 wallet drain.

Principal findings

None of the six declared crown jewels were achieved — server-side controls held at every escalation boundary. Even so, testing confirmed 35+ weaknesses across two waves that form credible paths toward account takeover if paired with an active user session. Ten production routes and three UAT routes were vulnerable to reflected cross-site scripting (XSS) via an AWS CloudFront WAF bypass under an 'unsafe-inline' Content-Security-Policy. A client-side Firebase Web API key permitted unlimited unauthenticated account creation — minting valid RS256 JWTs for arbitrary exchange-domain emails such as admin@copyex.example — alongside email enumeration and single-request account deletion. All five WebSocket endpoints skipped `Origin` validation (CSWSH) and leaked Java Gson parser internals, while six public UAT hosts mirrored the XSS, disclosed 20+ internal backend hostnames, and sat beside an alternative staging API reflecting arbitrary origins with credentials.

What this means in plain terms

Four things a board should take from this.

  • Server-side gates stopped every breach path. An API timestamp gateway (code 100003) blocked unauthenticated API and OAuth replay, while strict Firestore (documentId == uid) and Realtime Database (401) rules prevented cross-tenant access even with freshly minted Firebase JWTs.
  • Client-side script execution worked on ten live production pages. URL-decoded path segments broke out of SEO attributes in Nuxt SSR templates, bypassed CloudFront WAF keyword rules, and executed under a permissive CSP. Against a logged-in trader, that is a direct session-hijacking vector.
  • Anyone could mint Firebase JWTs claiming an exchange corporate email. Open signUp issued valid tokens for admin@copyex.example without verification, and two endpoints leaked email existence. Whether any internal backend trusts those JWT claims requires code-level verification.
  • Staging and WebSocket hygiene lagged far behind the core API perimeter. Six unauthenticated UAT hosts sat on the public internet leaking internal topology, and all five WebSocket endpoints omitted cross-origin checks.

The five things that need a decision, not a patch

#What is wrongBusiness impactWho decides
1Reflected XSS on 10 production and 3 UAT routes under 'unsafe-inline' CSPTemplate encoding is quick; removing 'unsafe-inline'/'unsafe-eval' from Nuxt SSR frontends requires frontend architecture changes.Web platform engineering
2Open Firebase registration mints arbitrary-domain JWTs (admin@copyex.example) and leaks emailsRequires auditing which backend services trust Firebase JWT claims and deciding whether client-side Firebase registration should exist at all.Identity + appsec
3Six live UAT/staging hosts are internet-facing, leaking 20+ internal hostnames and staging CORSKeeping UAT and QA behind VPN or zero-trust access is an infrastructure boundary decision, not a single header fix.Infrastructure + release
4All five WebSocket endpoints accept arbitrary Origin headers with inconsistent size limitsEnforcing strict Origin allowlists and uniform frame limits across spot, swap, cswap, virtual, and CeDeFi gateways affects API integrators.Trading infra + API product
5Production CSP allowlists wildcard staging domains (*.alt-staging.example)Compromising staging weakens production browser isolation; separating staging trust from production headers needs deployment policy alignment.Security architecture

What we did not get

Zero of six crown jewels were achieved. No customer PII was extracted. No admin panel or control plane was reached. No cross-tenant read or write succeeded in Firestore or Realtime Database. No privileged secret, signing key, or custody credential was recovered. No Web3 wallet or on-chain contract was touched.

Every critical server boundary held: the API timestamp gateway (code 100003), Firebase database rules, Bearer authentication on plat-oauth.copyex.example, clean NXDOMAIN DNS hygiene across all 26 assessed unresolved subdomains, and edge WAF brute-force controls.

Engagement outcome

An authorized external security assessment of our cryptocurrency exchange verified that server-side controls prevented any unauthorized access to customer data, trading accounts, internal secrets, or funds. The assessment identified client-side and perimeter weaknesses — including reflected cross-site scripting on public web routes, permissive Firebase registration settings, missing WebSocket origin checks, and exposed staging hosts — none of which led to account takeover or data loss during testing. All confirmed findings were disclosed under a confidentiality agreement with prioritised remediation guidance.


1. The engagement in numbers

MetricValue
Root workstreams / Total Swarm Size1 / 28
Subdomains discovered (6 passive sources)66 (38 resolved, 28 unresolved NXDOMAIN)
Live hosts probed (second-pass httpx)38
Unique paths crawled (katana -d 3) / archive URLs1,624 / 368,816
API endpoints / WebSocket endpoints tested27 / 5 (4 public/market + 1 CeDeFi push)
Externally reachable UAT/staging hosts6 (uat, uat-m, uat-c2c, uat-fiat, uat-tg, qa)
Alternative / partner domains assessed15
Confirmed findings across 2 waves35+ (7 high-severity headline issues; multiple medium/low)
Subdomain takeover hypotheses refuted26 of 26 assessed unresolved hosts
Crown jewels achieved / customer accounts accessed0 of 6 / 0

Testing obeyed strict rules of engagement: no outbound email triggers to real users, no staff OSINT, no probing of out-of-scope KYC or SMS vendors, no authenticated fund-moving API calls, low-rate scanning, and neutral random hex canaries throughout.

Agent topology

RoleSessionsResponsibility
Orchestrator1Wave planning, ROE enforcement, final synthesis
Recon9Subdomain/DNS mapping, TLS/ports, crawl, WebSocket & Web3 threat model
Exploit12XSS/WAF bypass, Firebase auth/DB boundary, CSWSH, OAuth, CORS, takeovers
Advisor3Independent hypothesis review, false-positive filtering, escalation triage
Reporter3Evidence verification, deliverable synthesis
Fig 01 · Agent topology
Fig 01 · Agent topology

2. What held

Five core defensive controls held under active external probing.

  • API timestamp validation gateway (`code 100003`) held across core and alternative APIs. Unauthenticated /api/ requests, OAuth broker confirmation replays, and /debug//env probes on api-app.alt-api-1.example were rejected (100003 / 100004); api-app.alt-api-2.example returned 403 across probed paths.
  • Firebase Realtime Database and Firestore security rules held. Production and staging Realtime Database paths (/.json, /users.json, /accounts.json, /config.json) returned 401 Permission denied on both reads and canary writes. Firestore enforced documentId == uid, returning 403 on cross-user access even with freshly minted Firebase JWTs.
  • Edge perimeter, TLS posture, and API injection filters held. Only TCP ports 80 and 443 were open behind CloudFront/Cloudflare (998 of top 1,000 ports filtered). TLS 1.2/1.3 enforced forward secrecy, server-ordered ciphers, HSTS preload (365 days, includeSubDomains), and post-quantum hybrid KEMs (X25519MLKEM768, SecP256r1MLKEM768). CloudFront WAF blocked all 29,999 directory brute-force entries (403/429), and SQLi/CmdI probes on open-api.copyex.example were blocked.
  • OIDC platform endpoints enforced Bearer auth. All operational routes on plat-oauth.copyex.example returned 401 without a Bearer token.
  • Unresolved subdomain DNS hygiene held. All 26 assessed unresolved subdomains were pure NXDOMAIN with zero dangling CNAMEs.
Fig 02 · 2. What held
Fig 02 · 2. What held

Refuted, blocked, and unverified hypotheses

Separating confirmed flaws from refuted leads and unverified hypotheses keeps remediation anchored to verified evidence.

CategoryHypothesisEvidence & disposition
RefutedSubdomain takeover across 26 unresolved hosts (dev, demo, monitor, forum, cards, account, app, *.abtest, *.api-base)Multi-resolver dig, dnsx, and nuclei takeover sweeps across 44+ subdomains confirmed pure NXDOMAIN with no dangling CNAMEs (app.copyex.example held mail-only TXT/MX records).
Refuted14 client-side RUM telemetry tokens (trading, accounts, mobile, C2C, finance) as privileged secretsConfirmed public-by-design client ingestion identifiers; probing cloud log-ingestion endpoints returned 405 OLSInvalidMethod / 404 LogStoreNotExist with no read or privileged access.
RefutedOpen Firebase Realtime Database / Firestore data leakSensitive JSON paths and canary writes returned 401 Permission denied; Firestore returned 403 on cross-UID access.
BlockedOAuth broker confirm-auth replay and alternative API /debug exposureBlocked server-side by the API timestamp validation gateway (100003 / 100004).
BlockedWeb3 dApp wallet drain (7 recon threat candidates)No authenticated dApp session established; no exchange-owned on-chain contracts identified in scope.
UnverifiedBackend trust of forged Firebase JWT email claims (admin@copyex.example)Token minting confirmed; backend authorization trust requires internal code or authenticated review.
UnverifiedPrivate WebSocket channel access (spot.executionReport, ACCOUNT_UPDATE, order.*, position.*)Unauthenticated attempts returned parameter errors ("reqType or dataType missing" / "invalid params") rather than "unauthorized"; requires a valid listenKey to verify auth enforcement.
UnverifiedJava Gson RCE via WebSocket reqType type confusion (BEGIN_OBJECT)Parser state leakage confirmed; existence of an exploitable custom TypeAdapter gadget on the server classpath was not verifiable externally.
UnverifiedBranded short-link subdomain (short.copyex.example) takeover via lapsed shortener subscriptionCNAME to a third-party URL shortener with SSL CN mismatch confirmed; claimability was not attempted under ROE.

3. The findings that mattered

How the estate was mapped

Fig 03 · How the estate was mapped
Fig 03 · How the estate was mapped

3.1 Reflected XSS via WAF bypass across production and UAT SSR routesHigh

In plain terms. Ten public exchange pages — spanning spot markets, futures, copy-trading profiles, converters, and support articles — reflect part of the URL path raw into HTML metadata tags. AWS CloudFront WAF blocks standard JavaScript function names, but URL-encoded attribute closure with an inline onerror handler bypasses the WAF and executes because the CSP allows 'unsafe-inline'. Three UAT routes share the exact same bug.

What. Nuxt SSR templates (web-base-nuxt3, web-accounts-nuxt3, web-main-nuxt2) URL-decode path parameters and interpolate them unencoded into 2–18 hreflang, canonical, and og:url attributes per page. Confirmed production routes include /en/converter/{coin}/{fiat}, /en/spot/{SYMBOL}, /en/price/{coin}, /en/how-to-buy/{coin}, /en/futures/forward/{SYMBOL}, /en/learn/article/{slug}, /en/support/articles/{id}, and /en/CopyTrading/{traderId} (10 production routes total), plus 3 UAT routes on uat.copyex.example (spot, perpetual, CopyTrading — up to 18 reflections).

How we found it. Crawl and archive discovery enumerated parameterized SSR routes across 12 locales. Probing showed CloudFront WAF returned 403 on explicit call signatures (eval(, fetch(, prompt(, confirm(, document.write(, setTimeout(, setInterval() while passing URL-encoded > attribute breakout with an image onerror handler. Permissive CSP (script-src containing 'unsafe-inline' and 'unsafe-eval') allowed immediate script execution.

Root cause. Missing HTML entity encoding in SSR head-tag templates, absent strict route parameter allowlists (e.g., [A-Z]+-[A-Z]+ or [a-z0-9-]+), and an 'unsafe-inline'/'unsafe-eval' CSP.

Fig 04 · 3.1 Reflected XSS via WAF bypass across production and UAT SSR routes
Fig 04 · 3.1 Reflected XSS via WAF bypass across production and UAT SSR routes

Impact. Any logged-in trader or internal UAT user opening a crafted link executes attacker JavaScript in the exchange origin, enabling DOM tampering, phishing overlays, WebSocket hijacking, and exfiltration of non-HttpOnly tokens. No live user session was touched during testing.

Fix. HTML-encode all interpolated route parameters across every SSR <link>/<meta> attribute, validate route segments with strict regex allowlists at the router edge, and replace 'unsafe-inline' with per-request CSP nonces.


3.2 Unauthenticated Firebase account minting, domain impersonation, and email enumerationHigh

In plain terms. Client JavaScript bundles ship a Firebase Web API key for the exchange's production and staging Firebase projects. Because Identity Toolkit registration was left unrestricted, any external caller could mint unlimited valid RS256 JWTs for arbitrary email addresses — including admin@copyex.example — enumerate registered emails, and permanently delete a victim's Firebase account with a single request if an idToken were obtained via XSS.

What. Seven confirmed findings across two Firebase projects:

  1. Unrestricted `signUp`: Issues valid RS256 idToken JWTs (expiresIn: 3600) and rotating refreshToken credentials at no cost with no verification gate.
  2. Corporate email impersonation: signUp accepted admin@copyex.example, issuing a signed JWT carrying that unverified email claim.
  3. Dual-vector email enumeration: accounts:update returned 400 EMAIL_EXISTS for registered addresses, while login and accounts:sendOobCode (PASSWORD_RESET) distinguished INVALID_PASSWORD from EMAIL_NOT_FOUND.
  4. Single-request account deletion: Holding a victim idToken deletes the Firebase account without recent re-authentication or confirmation.
  5. Project config disclosure: Exposed the numeric project ID and authorized domains including localhost.

How we found it. Static bundle review recovered the Firebase Web API key. After confirming Realtime Database (401) and Firestore (403) rules held, we exercised signUp, accounts:update, token refresh, sendOobCode, and config retrieval using synthetic accounts.

Root cause. Shipping a client Firebase key without App Check, HTTP referrer/API restrictions, disabled self-service signUp, or Email Enumeration Protection.

Fig 05 · 3.2 Unauthenticated Firebase account minting, domain impersonation, and email enumeration
Fig 05 · 3.2 Unauthenticated Firebase account minting, domain impersonation, and email enumeration

Impact. Account spam, user email harvesting, permanent account deletion if paired with XSS-stolen tokens, and potential privilege confusion if any backend trusts unverified Firebase email claims. Database rules prevented cross-tenant data access.

Fix. Audit backend services for Firebase JWT trust (enforcing email_verified: true and server-side roles where used), enable Firebase App Check and Email Enumeration Protection, restrict the API key by referrer and API scope, disable open signUp if unneeded, remove localhost from production authorized domains, and require recent re-authentication before deletion.


3.3 Cross-Site WebSocket Hijacking, Gson parser leakage, and frame-size asymmetryHigh

In plain terms. Five live WebSocket gateways power spot markets, derivatives, cswap, virtual test trading, and CeDeFi push feeds. None check the Origin header during handshake, allowing arbitrary websites (or §3.1 XSS payloads) to open browser-context WebSocket sessions. Malformed JSON also leaks internal Java Gson parser errors, and frame-size limits differ sharply across gateways.

What. Six confirmed findings across five endpoints (open-api-ws.copyex.example/market, futures/swap, cswap, virtual/test, and prod-cedefi-push-ws.copyex.example):

  1. CSWSH across all 5 endpoints: Handshakes with an arbitrary untrusted Origin were accepted on every gateway, including Cloudflare-fronted CeDeFi push.
  2. Gson parser error leak & type-confusion surface: Malformed JSON and object-typed reqType frames leaked internal field paths ($.reqType, $.null) and parser state (Unterminated object at line ..., BEGIN_OBJECT).
  3. Unsanitized input reflection on cswap: Client fields were echoed verbatim.
  4. Asymmetric frame-size limits: A 10 KB frame closed swap connections with code 1009 (message too big), whereas cswap and CeDeFi accepted the same 10 KB frame without error.

How we found it. A Python websockets client tested untrusted Origin handshakes, oversized JSON payloads, private channel subscriptions (spot.executionReport, ACCOUNT_UPDATE, order.*, position.*), and malformed/object-typed JSON frames across all five live endpoints.

Root cause. Missing centralized WebSocket gateway policy enforcing Origin allowlists, uniform max frame sizes, strict primitive schema validation, and generic error handling around Java Gson parsers.

Fig 06 · 3.3 Cross-Site WebSocket Hijacking, Gson parser leakage, and frame-size asymmetry
Fig 06 · 3.3 Cross-Site WebSocket Hijacking, Gson parser leakage, and frame-size asymmetry

Impact. Cross-origin WebSocket sessions can leverage ambient browser state or chain with XSS to access authenticated streams or trading actions where browser sessions apply; inconsistent size caps expose cswap/CeDeFi to memory-exhaustion risk. Private channel bypass and Gson RCE gadgets were not proven.

Fix. Enforce strict Origin allowlists on all five gateways, authenticate private channels via explicit per-connection tokens (listenKey or signed headers), suppress raw Gson exceptions, validate reqType as a string, and apply a uniform maximum frame size (e.g., 64 KB) with clear 1009 closes.


3.4 Exposed UAT/staging hosts, credentialed CORS reflection, and internal topology leakHigh

In plain terms. Six UAT/QA environments (uat, uat-m, uat-c2c, uat-fiat, uat-tg, qa) are live on the public internet with no login gate, mirroring production XSS and disclosing more than twenty internal backend hostnames. Meanwhile, an alternative staging API echoes any Origin with Access-Control-Allow-Credentials: true, and production CSP allowlists that staging domain wildcard.

What. Three linked staging and boundary weaknesses:

  1. Six internet-facing UAT/QA hosts: Externally reachable without VPN/SSO; uat.copyex.example reproduced the §3.1 reflected XSS on 3 routes (up to 18 reflections).
  2. Internal backend topology disclosure: uat-fiat.copyex.example source and JS bundles disclosed internal hostnames including config-center.internal.example, fe-api.internal.example, and 20+ internal API and WebSocket origins (api-app, api-cswap-app, api-swap, ws-private, ws-cedefi, ws-market-swap, f-ws-private, and related hosts under *.internal-origin.example).
  3. Credentialed CORS reflection + CSP bridge: Across 15 alternative domains, api.alt-staging.example reflected arbitrary Origin headers with Access-Control-Allow-Credentials: true, while production CSP headers allowlisted *.alt-staging.example.

How we found it. Passive subdomain discovery, JS correlation, source inspection on uat-fiat.copyex.example, and cross-origin CORS probing across the 15 alternative domains.

Root cause. Deploying non-production environments on public CDN/DNS endpoints with permissive CORS middleware, unstripped internal host maps in SSR output, and staging wildcards left in production CSP.

Fig 07 · 3.4 Exposed UAT/staging hosts, credentialed CORS reflection, and internal topology leak
Fig 07 · 3.4 Exposed UAT/staging hosts, credentialed CORS reflection, and internal topology leak

Impact. Staff using UAT are exposed to credential theft via XSS and credentialed CORS reads, the 20+ leaked backend hostnames supply an immediate internal pivot map, and trusting *.alt-staging.example in production CSP lets a staging compromise erode production browser isolation.

Fix. Gate all six UAT/QA hosts behind VPN or zero-trust SSO, replace dynamic CORS reflection on api.alt-staging.example with a static allowlist, strip internal backend hostnames from client-rendered markup, and remove *.alt-staging.example from production CSP headers.


Also confirmed

FindingSeverityContent
CloudFront WAF XSS filter bypass pattern setMediumBlocks eval(, fetch(, prompt(, confirm(, document.write(, setTimeout(, setInterval( (403) but allows URL-encoded attribute breakout with inline event handlers, enabling §3.1.
Permissive production Content-Security-PolicyMediumscript-src allows 'unsafe-inline' and 'unsafe-eval'; connect-src, frame-src (blob: *), img-src, font-src, and media-src use wildcards (object-src 'none' and restricted form-action are properly set).
Wildcard CORS and pre-auth OAuth parameter acceptanceMedium / Lowlogin.copyex.example and oauth-server.copyex.example send Access-Control-Allow-Origin: * (no credentials) on 302 redirects and accept arbitrary redirect_uri or omitted/replayed state pre-auth; plat-oauth.copyex.example exposes OIDC discovery metadata (RS256, grant types) while enforcing 401 on operational routes.
Blind POST acceptance on callback.copyex.exampleLowReturns {"code":0,"success":true} to empty JSON, garbage objects, and SQLi strings without signature or schema validation.
Branded short-link SSL certificate mismatchInfo / Lowshort.copyex.example CNAMEs to a third-party URL shortener returning a mismatched CN certificate, indicating a lapsed or unconfigured custom domain.
TLS leaf certificate nearing renewal windowInformationalWildcard certificate (copyex.example, *.copyex.example) had fewer than 60 days validity remaining at assessment time.

4. Kill chain summary

Fig 08 · 4. Kill chain summary
Fig 08 · 4. Kill chain summary
ChainReachedTerminated atData obtained
Production & UAT reflected XSSStage 4 (exploit)JS execution proven; no live victim targetedNone (no victim session)
Firebase account minting & enumerationStage 4 (exploit)Firestore 403 / RTDB 401; backend JWT trust unverifiedEmail existence signals; project metadata
WebSocket CSWSH & Gson probingStage 4 (exploit)Private channels require listenKey; RCE gadgets unverifiedInternal JSON field paths ($.reqType)
Staging exposure & credentialed CORSStage 4 (exploit)No staff session targeted20+ internal backend hostnames
OAuth/SSO & API replayStage 3 (delivery)API timestamp gate (100003) / 401 Bearer authPublic OIDC discovery metadata only
Subdomain takeover (26 hosts)Stage 2 (recon)Pure NXDOMAIN, zero dangling CNAMEs (refuted)None
Web3 / CeDeFi wallet drainStage 2 (recon)No dApp session; no exchange-owned on-chain contractsNone

5. What the shape of this engagement teaches

A strong perimeter WAF does not compensate for unencoded SSR templates and permissive CSP. CloudFront WAF blocked 29,999 brute-force probes and standard JavaScript function names, yet 10 production pages still ran arbitrary script because URL-decoded paths landed raw inside HTML attributes under 'unsafe-inline'. Output encoding and nonce-based CSP eliminate the class; WAF rules only slow it down.

Server-side enforcement gates are why zero crown jewels fell. Client-side footholds were plentiful, but every escalation attempt hit a hard server check: the 100003 API timestamp gateway, Firestore's documentId == uid rule, Realtime Database 401 denials, and Bearer auth on plat-oauth.copyex.example.

Public staging environments quietly double the attack surface. Six internet-facing UAT hosts mirrored production XSS against staff browsers, leaked 20+ internal backend hostnames, and sat alongside a credentialed CORS reflection on an alternative staging domain trusted by production CSP.

Client-shipped Firebase keys need registration controls and a backend trust audit. Even when database rules hold, open signUp mints signed JWTs claiming admin@copyex.example and leaks registered emails. Any backend parsing Firebase tokens must require email_verified plus authoritative server-side roles.

WebSocket fleets need the same gateway discipline as REST APIs. Skipping Origin checks across all five endpoints, leaking raw Gson parser errors, and enforcing inconsistent 1009 size limits shows the gateways lack a unified security middleware layer.

PriorityActionWhy firstEffort
1HTML-encode path parameters and enforce route regexes across all Nuxt SSR templates (prod + UAT)Closes reflected XSS on 10 production and 3 UAT routesLow
1Audit backend Firebase JWT trust; enable App Check, disable open signUp, enable email enumeration protectionStops arbitrary admin@copyex.example JWT minting and email harvestingMedium
1Enforce strict Origin allowlists on all 5 WebSocket endpointsEliminates CSWSH across spot, swap, cswap, virtual, and CeDeFi gatewaysLow
2Move all 6 UAT/QA hosts behind VPN/SSO and fix credentialed CORS on api.alt-staging.exampleRemoves public staging XSS, credentialed cross-origin reads, and topology leaksLow–Medium
2Remove *.alt-staging.example from production CSP and migrate off 'unsafe-inline'/'unsafe-eval'Restores browser defense-in-depth and separates staging from production trustMedium
3Sanitize Gson errors and standardize WebSocket max frame sizes (1009) across all 5 endpointsCloses type-confusion diagnostics and asymmetric memory-exhaustion riskLow
3Validate pre-auth OAuth redirect_uri/state, drop wildcard OAuth CORS, and sign callback.copyex.exampleHardens OAuth hygiene and prevents blind callback POST acceptanceLow
4Reclaim or remove short.copyex.example CNAME, strip localhost from Firebase domains, automate TLS alertsCleans up residual DNS, auth-domain, and certificate hygieneVery low

Notices

Authorization

This was an authorized security assessment conducted under a written engagement agreement. Testing was confined to in-scope properties under explicit rules of engagement: no outbound email triggers to real users, no staff OSINT, no third-party KYC or SMS vendor probing, no authenticated fund-moving API calls, low-rate scanning, and neutral random hex canaries throughout.

Redaction

Every real hostname, IP address, certificate fingerprint, API key, user ID, telemetry token, project number, and calendar date has been replaced with a placeholder or generalised.

What was removed:

  • All real exchange brand names, legacy brand identifiers, and workspace/session IDs
  • All real hostnames, subdomains, alternative domains, and internal backend domain names
  • All IPv4/IPv6 addresses, CDN edge rDNS names, and TLS certificate serials/fingerprints
  • All Firebase Web API keys, numeric project IDs, local UIDs, refresh tokens, and JS bundle hashes
  • All client-side RUM telemetry tokens, cloud log-collector hostnames, and third-party vendor names
  • Exact calendar dates, clock times, and canary token values

What was kept, deliberately: vulnerability classes, HTTP and API error codes (100003, 100004, 1009, 401, 403), framework and parser mechanics (Nuxt SSR attribute reflection, CloudFront WAF keyword filters, Firebase Identity Toolkit endpoints, Java Gson parser diagnostics), aggregate coverage counts, and the explicit separation of confirmed, refuted, blocked, and unverified hypotheses.

Placeholders used throughout:

PlaceholderMeaning
copyex.examplePrimary exchange domain and estate
api.copyex.example / open-api.copyex.examplePublic and Open API hosts
app.copyex.exampleDecommissioned web subdomain (mail-only DNS records)
uat.copyex.example / uat-fiat.copyex.exampleExternally reachable UAT/staging hosts
open-api-ws.copyex.example / prod-cedefi-push-ws.copyex.exampleWebSocket market and CeDeFi push gateways
login.copyex.example / oauth-server.copyex.example / plat-oauth.copyex.exampleLogin, OAuth, and OIDC infrastructure
callback.copyex.example / short.copyex.exampleCallback endpoint and branded short-link subdomain
api.alt-staging.example / *.alt-staging.exampleAlternative staging domain with credentialed CORS reflection
api-app.alt-api-1.example / api-app.alt-api-2.exampleAlternative API origin domains
*.internal-origin.example / config-center.internal.exampleDisclosed internal backend hostnames
admin@copyex.examplePlaceholder administrative email under the redacted domain
<redacted>Any removed identifier, key, or value

Data handling

No customer PII, account credentials, session cookies, trading records, or live user emails were collected or reproduced. Synthetic Firebase test accounts were used solely to confirm token issuance and boundary behavior, with zero bulk extraction.

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.

Confirmed findings are strictly separated from refuted, blocked, and unverified hypotheses. Twenty-six unresolved subdomain takeover leads and client-side telemetry tokens are reported as refuted. Backend trust of forged Firebase JWTs, private WebSocket channel authorization, Gson deserialization gadget reachability, and third-party short-link claimability are marked unverified because confirming them exceeded black-box scope or ROE.


Methodology and tooling by BlackBit. Six declared crown jewels held behind server-side timestamp and database-rule gates, while two waves of black-box testing surfaced 35+ client-side, identity, WebSocket, and staging weaknesses. Published with the client's permission.

More in Web3 CEX

← All case studies