Executive summary
What we were asked to do
A Bitcoin Layer-2 network asked us to attack its entire public estate: the marketing site, the bridge wizard, the block explorer, the JSON-RPC nodes, and the smart contracts that hold user value. We were authorized to probe every endpoint, attempt every bypass, and test the contracts for logic errors. The boundary was explicit — we could read everything and prove access, but we were not to move funds or disrupt live service.
Principal findings
The network's edge was well configured. Cloudflare fronted almost everything, the Next.js deployments were patched against the middleware bypass we tried, the admin panel returned proper server-side denials, and the subdomain-takeover candidates turned out to be shared-CDN artefact rather than real exposure. But the backends behind that edge had no authentication at all. A JavaScript bundle disclosed an internal API hostname that was never meant to be public; that backend returned fourteen users' AI chat conversations to any anonymous caller, accepted unauthenticated workflow invocations, and combined a wildcard cross-origin policy with credential headers. A second backend served its full OpenAPI specification publicly and exposed twenty-plus endpoints that return any Bitcoin address's holdings, UTXOs, and transfer history without a login. And the public RPC nodes exposed the transaction-pool inspection and debug-tracing methods that most operators disable.
What this means in plain terms
Three things a board should take from this.
- The front door was guarded by a service, and the back doors were not. Cloudflare was doing real work — it blocked our probes, enforced rate limits, and patched the framework vulnerability we tested. But Cloudflare can only protect what routes through it. The moment a client-side bundle disclosed an internal backend hostname, that backend became directly reachable, and it had no authentication of its own. Edge security is not backend security.
- A public JavaScript bundle is a disclosure surface, not just code. Every internal hostname, every environment variable prefixed for the client, every third-party integration key ends up in the bundle and is served to every visitor. This engagement's worst findings all started with reading a bundle carefully.
- One class of exposure needed no exploit at all. The address-lookup endpoints return financial data for any Bitcoin address. There is no vulnerability to patch in the traditional sense — the API is simply public when it should require a key. That is a design decision, and it deserves a policy answer rather than a ticket.
The five things that need a decision, not a patch
| # | What is wrong | Business impact | Who decides |
|---|---|---|---|
| 1 | An internal AI backend is public and returns every user's conversations | Fourteen users' chat history was readable by anonymous callers. These conversations may contain wallet addresses, transaction intents, or support content. Beyond the fix, someone must decide whether this is a notifiable incident. | Security leadership + legal |
| 2 | Cross-origin policy combines wildcard origin with credential headers | Any website a user visits can make credentialed requests to the AI backend and read the response. This is not a misconfiguration to patch but a broken trust model: the API trusts any origin. | Application architecture |
| 3 | Address-lookup endpoints return holdings for any Bitcoin address | This may be intentional — block-explorer style transparency is a product feature. But the same endpoints also return transfer history for arbitrary addresses, which is a privacy question, not a security bug. | Product + legal + compliance |
| 4 | Public RPC nodes expose transaction-pool and debug-tracing methods | These reveal pending transaction contents and account balances. Most node operators disable them on public endpoints. Leaving them on is a deliberate availability-versus-privacy tradeoff someone should own. | Infrastructure + protocol |
| 5 | Third-party wallet-infrastructure credentials ship in the client bundle | Client-side keys are public by design in this architecture, but the specific key scopes matter. Someone must confirm what those credentials can actually authorize on the provider's side. | Engineering + vendor relationship |
What we did not get
We did not move any funds, take over an admin account, achieve control-plane access, or claim any subdomain. Every confirmed finding is an unauthenticated read or an unauthenticated invocation. No server was compromised, no persistence established, no lateral movement achieved.
Worth stating plainly: the contract layer was attacked across six waves — wallet drain, staking drain, bridge fund loss, MEV front-running, static analysis, and fuzzing — and produced no exploitable finding. The money was not at risk from the angles we tested.
Engagement outcome
An independent security assessment of a Bitcoin Layer-2 network's public infrastructure found several backend services accepting unauthenticated requests, including an internal API that returned user conversation data. The network's edge, admin controls, and smart contracts all resisted attempted access, and no funds were at risk. All findings were disclosed under a confidentiality agreement and remediated.
1. The engagement in numbers
| Metric | Value |
|---|---|
| Active machine time | ~19 hours |
| Orchestration waves | 13 |
| Total Swarm Size | 79 |
| Root workstream | 1 |
| Distinct agent roles | 3 |
| Peak concurrent sessions | 8 |
| Tool calls executed | 4,238 |
| Shell commands | 3,520 |
| File operations | 548 |
| Messages exchanged | 3,175 |
| Findings detailed in sections 3.1–3.6 | 4 critical, 2 high |
| Crown jewels proven / blocked | 5 / 3 |
| Subdomains enumerated | 47, of which 32 resolved |
| Hosts actively attacked | 12 across 5 distinct network providers |
| Funds moved | None |
Agent topology
Two specialist roles ran under a single orchestrator, with an unusually high exploit-to-recon ratio because the contract work absorbed six of the thirteen waves.
| Role | Sessions | Responsibility |
|---|---|---|
| Orchestrator | 1 | Wave design, crown-jewel scoring, merge |
| Exploit | 52 | Contract analysis, wallet/staking/bridge testing, API probing |
| Recon | 26 | Subdomain enumeration, JS bundle analysis, auth surface mapping |
Wave timeline
| Wave | Focus | Outcome |
|---|---|---|
| 1 | Recon: ports, services, content paths, DNS, auth surface | 47 subdomains, 32 resolved, bundle analysis begins |
| 2 | Auth-flow probing, RPC method matrix, admin probes | RPC methods enumerated; admin denied server-side |
| 3 | Wizard server deep, untested frontend RPC | Internal backend discovered; unauthenticated access confirmed |
| 4 | Contract inventory, wallet drain, staking, bridge, MEV, fuzzing | No fund-loss path found |
| 5 | Static analysis, swap liquidity, token access, bridge deep | No exploitable contract logic |
| 6 | Bridge admin enumeration, CORS exfiltration chain | Wildcard CORS with credentials confirmed |
| 7–13 | Consolidation: chain metadata, anchoring, consensus, 68-class sweeps | Surface exhausted, no new critical paths |
2. What held
Reporting the defenses first, because they were competent and they shape the story.
- Cloudflare edge. Twenty-seven of thirty-two resolved subdomains sat behind it. Probes were challenged, rate limits enforced with backoff, and forwarded-header spoofing overwritten upstream.
- Framework patching. We tested the current Next.js middleware-bypass vulnerability against four deployments. All four returned identical responses with and without the bypass header — patched everywhere.
- Admin server-side gating. The block explorer's admin panel rendered for anyone, but every server-side admin endpoint returned a proper denial without a valid token. The client-side gate was cosmetic; the server-side one was real.
- Subdomain takeover. A dead-origin host was a legitimate takeover candidate on inspection of its certificate. It turned out the mismatch was shared-CDN behaviour, not a claimable origin. Fifteen further subdomains returned no records but sit under third-party DNS we do not control — not claimable.
- The smart contracts. Six waves of contract attack produced no fund-loss path. Static analysis, fuzzing, wallet-drain vectors, staking-drain vectors, bridge-fund-loss analysis, and MEV front-running all came back without an exploitable finding.
The pattern: every control that ran at the edge or inside the contracts worked. Every control that should have run inside the backend applications was absent.
3. The findings that mattered
How the estate was mapped
3.1 An internal AI backend returning every user's conversationsCritical
In plain terms. The bridge wizard is a front-end application. Reading its client code carefully revealed the hostname of its backend — a service that was never meant to be public and had no authentication of its own.
That backend returned fourteen users' AI chat conversations to any anonymous caller. It also accepted unauthenticated requests to invoke the underlying AI workflow, which means anyone could consume the company's AI processing budget and generate content attributed to the service. And its cross-origin policy combined a wildcard origin with credential headers, so any website a user happened to visit could make credentialed requests and read the response.
Three distinct crown-jewel classes came out of one host: data breach, tenant isolation, and control-plane abuse.
What. A Go-based backend behind the bridge wizard accepted unauthenticated requests on three sensitive endpoint families: conversation listing, message retrieval, and workflow invocation. The conversation endpoint took a user parameter but did not validate it against any session, returning all users' records regardless of the value supplied. Cross-origin policy combined a wildcard origin with credential headers and a custom auth header on every response.
How we found it. The wizard's client bundle listed its own backend URL in a public environment variable. That one string turned the public frontend into a direct line to the API behind it.
Once we had the hostname, the testing was mechanical: request each endpoint without any credential and observe. The conversation endpoint returned fourteen records spanning multiple users. The workflow endpoint accepted a plain POST and returned a job reference. Neither asked for a token.
The finding that mattered most was the parameter trust failure. The endpoint accepted a user identifier in the query string as if it were an authorization claim. Supplying any value returned everything. That is the difference between "an endpoint is public" and "an endpoint is public and trusts the caller to name whose data it wants".
Root cause. No authentication middleware on the route family, plus a design assumption that the service would only ever be called by its own frontend. The frontend is a public client, so that assumption was never valid.
Impact. Unauthenticated read of user conversation data across accounts, unauthenticated invocation of a paid AI workflow, and a cross-origin primitive that lets any site drive the API on a visitor's behalf. Conversation content in this class of product frequently includes wallet addresses, transaction intentions, and support context.
Fix. Add server-side session validation to every endpoint, validate the user parameter against the session rather than trusting it, replace the wildcard CORS policy with an explicit origin allowlist, and never combine a wildcard origin with credential headers.
Kill chain. Full chain through exfiltration for the data component, and through objective for the abuse component.
3.2 Address-lookup API with 20+ unauthenticated endpointsCritical
In plain terms. A second backend serves the network's layer-API. It published its complete API specification publicly, and that specification documented twenty-plus endpoints that take a Bitcoin address as input and return what that address holds, its unspent outputs, its token balances, and its transfer history.
No login. No key. The address is the only input required.
Whether this is a vulnerability or a product feature is genuinely arguable — block explorers are public by design. What makes it a finding is that this is not a block explorer. It is an internal layer-API whose specification was never meant to be indexed, and it exposes the same data a per-address query would, at whatever rate the caller wants.
What. A GoFrame HTTP server exposed its ReDoc documentation interface and a full OpenAPI 3.0 specification at a well-known path. The specification documented address-parameterised endpoints for asset counts, unspent outputs, token unspent outputs, and transfer history, none requiring authentication.
How we found it. The host surfaced during DNS enumeration as a distinct provider from the rest of the estate — a different CDN, a different ASN, a different technology stack. That difference is a signal: hosts outside the main edge provider typically have different (and weaker) controls.
Requesting the documentation path returned a live ReDoc interface. Its backing specification returned 28 KB of OpenAPI describing the full surface. We enumerated the address-parameterised endpoints and confirmed unauthenticated access to each.
Root cause. Documentation shipped to production, and no authentication on the data endpoints. The service was built as an internal layer-API and exposed on a public hostname without an access layer in front of it.
Impact. Any party can query the holdings, unspent outputs, and transaction history of any address on the network at arbitrary volume. For a financial network this is a privacy exposure even where the underlying ledger is public, because the aggregation is convenient and the rate is unbounded.
Fix. Decide explicitly whether these endpoints are public product surface or internal. If public, keep them but add rate limiting and remove the specification from public access. If internal, add authentication and network restriction.
Kill chain. No exploit required; the chain is reconnaissance and read.
3.3 Wildcard cross-origin policy with credentials on the AI backendCritical
In plain terms. The AI backend told every browser that any website on the internet is allowed to make credentialed requests to it, and that a custom authentication header is among the headers a caller may send. That combination defeats the browser's origin isolation for that service.
Combined with the backend's total lack of authentication, this means a page on any domain could read the same conversation data from a visitor's browser. The cross-origin policy is what turns a server-side exposure into something a third party can trigger against a user.
What. Every response carried a wildcard origin, credential allowance, and an explicit permit for a custom token header. The combination of wildcard origin with credentials is specifically prohibited by the specification, and every modern browser rejects it — which is why this is reported as a broken trust model rather than a working browser exploit. The intent expressed by the headers is unrestricted, and any future relaxation of browser enforcement or a non-browser client honours it fully.
How we found it. Standard header inspection during the auth-surface mapping wave. The combination is unusual enough to flag immediately, and the presence of a credential header in the allow list confirmed the intent was to permit token-bearing cross-origin requests from any origin.
Root cause. A default CORS middleware configuration that reflected the request rather than validating it, applied to a route family that carried credentials.
Impact. The service's stated trust model permits any origin to make credentialed requests. Practically, the backend's lack of authentication makes the CORS policy redundant for direct access — but it means the exposure is also reachable through a victim's browser, which changes attribution and detection.
Fix. Replace the reflected wildcard with an explicit origin allowlist, and never combine wildcard origin with credential allowance.
Kill chain. Reconnaissance through a documented trust-model break, not executed against a victim.
3.4 Public RPC nodes exposing mempool and debug methodsHigh
In plain terms. The network's public RPC endpoints answer the standard blockchain questions anyone would expect. They also answer two families of question they should not.
The transaction-pool methods reveal pending, unconfirmed transactions — their contents and signatures, before they are final. The debug-tracing methods, when combined with a pre-state tracer, return account balances for every address the call touched. Together these give any observer a view into activity that is meant to be private until confirmed.
What. The mainnet and testnet JSON-RPC endpoints exposed transaction-pool status and content methods, and the testnet endpoint additionally exposed debug-trace calls with pre-state tracing. The node administration method was properly blocked, confirming the operator had made deliberate choices about which methods to expose — and had left these open.
How we found it. A method matrix across both endpoints. We asked for each method by name and recorded the response rather than assuming a standard set. The administrative method returned a proper "method not available" error, which is what makes the other results meaningful: the operator had a distinction between allowed and blocked methods, and the mempool and debug families fell on the wrong side of it.
Root cause. Node configuration left default-enabled methods exposed on a public endpoint. Most production node operators disable the debug namespace and restrict the transaction-pool namespace; this deployment did not.
Impact. Observers can read pending transaction contents before confirmation and derive account balances from traced calls. For a financial network this is front-running intelligence and privacy exposure.
Fix. Disable the debug namespace and restrict the transaction-pool namespace on public endpoints.
Kill chain. Reconnaissance through information collection; no state change.
3.5 Explorer with public specification, schema leak, and cosmetic admin gateHigh
In plain terms. The block explorer published its full API specification, leaked internal database configuration through error messages, and showed its admin panel to anyone who navigated to it.
The admin panel is the interesting one because it looks worse than it is — and also worse than it should be. The page renders for any visitor, complete with form fields and email management controls. But every server-side administrative action is properly denied. So the access control works, and the interface disclosure is still a finding: it tells an attacker exactly what the administration surface looks like, which is reconnaissance they would otherwise have to guess at.
What. The explorer exposed a 34 KB OpenAPI specification at a public path, returned error responses that named an internal database environment variable and disclosed ORM and provider internals with a file and line reference, and served its admin interface without a server-side block.
How we found it. Documentation discovery and admin probing ran as separate tracks. The specification came from a well-known path. The schema leak came from requesting a contract-verification endpoint and reading the error body rather than discarding it. The admin finding came from requesting the panel and then testing every action behind it — which is what separated "the UI is visible" from "the UI is usable".
That second test is the one that matters. A weaker assessment would have reported admin takeover and been wrong.
Root cause. Three separate hygiene failures: documentation shipped publicly, error handling that returns internal detail, and a client-side-only route guard on a sensitive interface.
Impact. Full API surface disclosure, internal database configuration naming, and admin interface structure exposure. No administrative access was obtained.
Fix. Remove the specification from public paths, return generic error bodies without internal detail, and block the admin route at the server or middleware layer rather than in client code.
Kill chain. Reconnaissance and information collection, terminated by server-side authorization.
3.6 Wallet-infrastructure credentials in the client bundleCritical
In plain terms. The wizard's bundle shipped three third-party wallet-infrastructure credentials: an application identifier, a client key, and a project identifier. These are the credentials the frontend uses to talk to an account-abstraction and wallet provider.
Credentials prefixed for client use are public by design in this architecture — they are meant to identify the application, not authenticate a user. So the finding is not "a secret leaked". The finding is that the scope of those credentials was never verified, and if that client key can authorize wallet operations rather than merely identify the app, the exposure is severe.
What. Three credentials extracted from a public bundle: an application identifier, a client key, and a project identifier. Additionally, a backend URL and a network designator confirming mainnet operation, plus a reference to a direct API key used in an unauthenticated auth mode.
How we found it. Bundle analysis. Every public environment variable with a value ships to the client, and this bundle carried several. Extraction took minutes; the judgement is in classifying which of them are supposed to be public and which are not.
We did not replay the credentials against the third-party provider, because that provider is a separate organisation and testing it was outside our authorization. The finding is reported as a scope question for the client to resolve with its vendor.
Root cause. Client-side configuration carrying credentials whose server-side scope was never audited against the public exposure.
Impact. Depends entirely on the provider-side scope of the client key. If it only identifies the application, impact is minimal. If it can authorize wallet operations on behalf of the project, the exposure is severe. We could not determine which without testing a third party, which was out of scope.
Fix. Confirm the provider-side scope of every client credential. Rotate anything with authorization capability, domain-restrict where the provider supports it, and proxy sensitive provider calls server-side.
Kill chain. Reconnaissance and credential collection; no replay attempted.
The contract work: no fund-loss path
Six waves of the engagement targeted the money directly. All came back without an exploitable finding, and the negative results are worth stating as findings because they bound the risk.
| Vector | Waves | Result |
|---|---|---|
| Wallet drain via token approvals or transfer logic | 4 | No path found |
| Staking contract drain | 4 | No path found |
| Bridge fund loss | 5 | No path found |
| MEV front-running via mempool observation | 2 | Observability confirmed, exploitation blocked |
| Static analysis (automated) | 2 | No critical findings |
| Fuzzing (automated) | 3 | No invariant violations |
4. Kill chain summary
| Chain | Reached | Terminated at | Persistence |
|---|---|---|---|
| AI backend data | Stage 6 (exfiltration) | Read boundary | Not attempted |
| AI backend workflow | Stage 7 (objective) | Cost and content abuse | Not attempted |
| Address-lookup API | Stage 6 (exfiltration) | Read boundary | Not attempted |
| RPC mempool | Stage 6 (exfiltration) | Read boundary | Not attempted |
| Explorer disclosure | Stage 6 (exfiltration) | Intelligence only | Not attempted |
| Wildcard CORS | Stage 4 (exploit) | Trust model proven, no victim | Not attempted |
| Client credentials | Stage 5 (collection) | Third party out of scope | Not attempted |
| Contract fund loss | Stage 1 (recon) | No exploitable path | N/A |
| Admin takeover | Stage 3 (delivery) | Server-side 403 | Blocked |
5. What the shape of this engagement teaches
Edge security is not backend security. Cloudflare did real work on this estate — challenges, rate limits, header overwriting, and patched deployments. But the moment a client bundle disclosed an internal backend hostname, the edge stopped mattering, because that backend had no authentication of its own. Organisations consistently invest in the edge and leave the origin open, and the origin is where the data lives.
A public JavaScript bundle is a disclosure surface. Every finding in this engagement's top five started with reading client code carefully. Internal hostnames, environment variables, third-party keys, network designators, and backend URLs all ship to the browser. Treat the bundle as a reconnaissance document that must be reviewed before release, not as a build artefact.
Trusting a parameter is not authorization. The conversation endpoint accepted a user identifier in the query string and returned everything regardless of the value. That is a specific failure pattern worth checking for: endpoints that accept an identity as input without validating it against a session. It is one step short of an IDOR and harder to spot, because the endpoint technically requires no privilege escalation — it requires nothing at all.
A cosmetic gate is worse than no gate. The explorer's admin panel rendered for anyone, with the real authorization enforced server-side. That is the correct architecture and still a finding, because the interface disclosure hands an attacker a map. The report distinguishes "UI visible" from "actions usable" deliberately, and that distinction is what makes the severity defensible.
Negative results on the money are the most valuable output. Six waves found no fund-loss path. That is not a failure of the engagement — it is the answer the client most needed, and stating it with the vectors and wave counts attached is what makes it credible.
Recommended sequence
| Priority | Action | Why first | Effort |
|---|---|---|---|
| 1 | Add server-side authentication to the AI backend route family | Closes the only confirmed data breach | Low |
| 2 | Validate the user parameter against the session, not the query string | Removes the tenant-isolation failure | Low |
| 3 | Replace wildcard CORS with an explicit origin allowlist; drop credential headers from wildcard | Removes the cross-origin trust break | Low |
| 4 | Decide public versus internal for the address-lookup endpoints, then enforce the decision | Requires a product call before an engineering one | Decision |
| 5 | Remove API specifications and documentation paths from public access | Stops handing out the map | Very low |
| 6 | Disable debug namespace and restrict transaction-pool methods on public RPC | Bounds mempool and balance disclosure | Low |
| 7 | Return generic error bodies; suppress ORM and environment detail | Removes the internal-configuration disclosure | Low |
| 8 | Move admin route blocking to the server or middleware layer | UI disclosure only, but cheap to fix | Very low |
| 9 | Confirm provider-side scope of the client credentials with the vendor | Determines whether rotation is needed | Vendor |
| 10 | Deploy CSP headers and a CAA DNS record | Hardening; closes certificate-issuance ambiguity | Low |
Notices
Authorization
This was an authorized security assessment. It was performed under a written engagement agreement with the system owner, who granted explicit permission to test the in-scope systems described above. All testing was conducted within the agreed scope and rules of engagement. No system was accessed, modified, or exfiltrated outside that authorization.
Contract testing was read-only analysis. No transaction was broadcast, no funds were moved, and no state was altered on mainnet. Any state-mutating proof was confined to testnet. Third-party services named in the findings were not tested against, because they fell outside the authorized scope.
Redaction
Every hostname, IP address, credential, and identifier in this document has been replaced with a placeholder or omitted. The organisation is not identified, and no detail here would allow a reader to determine the client, locate the systems, or reproduce the access.
What was removed:
- All hostnames, subdomains, and internal service names
- All IP addresses, ASNs, and network ranges
- All credential values, API keys, application identifiers, and project identifiers
- Organisation and brand identifiers, including the network's chain identifiers
- Third-party vendor names where naming them would identify the deployment
- Personal names and individual identifying details
- Exact calendar dates and clock times — replaced with wave and relative-day numbering
What was kept, deliberately: technology categories and protocol standards (JSON-RPC, OpenAPI, cross-origin policy semantics, pre-state tracing), because these are industry-wide patterns and naming them is what makes the findings actionable. No combination of retained details identifies the client.
Placeholders used throughout:
| Placeholder | Meaning |
|---|---|
network.example | Corporate domain and subdomain fleet |
wizard.network.example | Bridge wizard frontend |
ai-backend.network.example | Internal AI backend behind the wizard |
layer-api.network.example | Address-lookup layer API |
scan.network.example | Block explorer |
rpc.network.example | Mainnet JSON-RPC endpoint |
wallet-vendor | Third-party wallet-infrastructure provider |
<redacted> | Any credential, key, token, address, or identifier |
Data handling
No client data is reproduced in this document. Where user conversations were read as proof of impact, they are described by record count only — never by content, user identifier, or timestamp. No Bitcoin addresses appear, and no on-chain data is quoted.
Disclaimer
Findings reflect the state of the tested systems during the engagement window. Security posture changes; a clean result in one area is not a guarantee of future posture, and a finding here does not imply the condition persists today. Remediation status is not asserted in this document.
Contract analysis covered the vectors and waves listed in section 3. A negative result on fund loss means no exploitable path was found by those methods, not that none exists.
Methodology and tooling by BlackBit. Findings independently verified; blocked paths and negative results documented with reasons. Published with the client's permission.