Skip to content

Case study · Web3

On-Chain Peer-to-Peer DeFi Lending and Vault Protocol

While immutable core lending contracts held, 776 of 1,000 scanned vaults had zero timelocks — including $5.04M in single-EOA TVL — and unauthenticated GraphQL, REST, and MCP APIs exposed 441,199 positions and unsigned calldata crafting.

Findings · 12
2 Critical3 High7 Medium
FindingVulnerabilitySeverity
3.1Systemic zero-timelock vaults with single-key EOA curatorsCompromising any curator EOA private key (via phishing, workstation compromise, or insider action) allows instant redirection of vault deposits to an attacker-controlled adapter in a single transaction, leaving depositor shares backed by zero real assets.Critical
3.2Atomic multicall delegatecall collapses the timelock windowmulticall() executes batched calls via delegatecall to address(this), preserving msg.sender.High
3.3Unauthenticated mass financial surveillance across GraphQL and REST APIsBoth api.lending.example/graphql and the 38-endpoint Consumer REST API (/consumer/*) require zero authentication and enforce zero effective rate limiting.Critical
3.4Unauthenticated MCP server with cross-chain reads and transaction preparationThe protocol operates a Model Context Protocol (MCP) server at mcp.lending.example exposing 15 tools for AI agents.High
3.5Development GraphQL endpoint missing complexity cap (confirmed 502 crash)Comparing response extensions revealed maximumComplexity: 1000000 on production and no maximumComplexity field on development.High
GraphQL batch-alias bulk extraction & depth gap5,000+ records per HTTP request via aliased queries; 5-level cyclic nesting accepted with low computed complexityMedium
Vault governance & multisig metadata enumeration1,355 vault curator/owner/guardian/pending-owner addresses and multisig signer thresholds enumerable via single GraphQL callMedium
REST API zero rate limiting38 /consumer/* endpoints served 60 rapid sequential requests with zero throttlingMedium
Wildcard CORS on private API gatewaysprivate.api.lending.example echoes wildcard origin alongside Authorization headersMedium
Dangling DNS CNAME to deleted load balancerlb.services.lending.example points to a decommissioned cloud load balancer returning NXDOMAINMedium
Cross-tenant TLS certificate sharingCampaign host shares a multi-SAN TLS certificate and IP with three unrelated third-party domainsMedium
Latent permissionless forceDeallocate griefingNo caller check on forceDeallocate(); zero loss today while penalty is 0, activates if curator sets penalty > 0MediumLatent

Executive summary

What we were asked to do

A DeFi protocol operating an immutable peer-to-peer lending core and a curated ERC-4626 vault layer across 14 blockchains asked for a full-scope external assessment of its public application, APIs, agent-integration endpoints, and deployed smart contracts. The goal was to test whether an external attacker could drain vault funds, enumerate user financial records at scale, extract backend secrets, or seize control-plane infrastructure.

The engagement surfaced a sharp architectural split: the immutable core lending contracts and web perimeter held cleanly, while vault-configuration hygiene and unauthenticated data and agent APIs created two systemic exposures.

Principal findings

776 of 1,000 scanned curated vaults had all-zero timelocks across every privileged function, and eight high-TVL vaults among them were controlled by single-key externally owned accounts (EOAs) holding $5.04M in combined TVL (including one EOA controlling three vaults worth $4.77M across two chains), while five more zero-timelock vaults held over $11.3M behind multisig contracts with zero withdrawal delay once a threshold signs; paired with a multicall delegatecall pattern that executes submit() and execution in the same block, any compromised EOA curator key enables an instant, single-transaction vault drain. Separately, the GraphQL API, a 38-endpoint REST API, and a 15-tool MCP server required no authentication and no effective rate limiting, allowing arbitrary-address portfolio lookup (verified against a $307.5M single-address position), bulk extraction of 441,199 market positions and 1,355 vault governance configurations, and unauthenticated generation of unsigned transaction calldata for any address; meanwhile, an uncapped development GraphQL endpoint crashed with HTTP 502 under a single 50KB nested query. Core lending contracts across all reachable chains, the transaction bundler, the hardened frontend, private IAM-gated gateways, CDN storage, and wallet-relay cryptography all held, and suspected frontend secret leaks were refuted as public telemetry tokens and bundler hashes.

What this means in plain terms

Four things leadership should take from this.

  • Timelocks are the safety rail for curated vaults, and 77.6% of scanned vaults had them set to zero. When a vault curator is a single private key with zero timelock, a phishing attack or key leak drains deposited funds in one transaction before any depositor can withdraw.
  • Unauthenticated APIs and an open MCP server turn public chain state into instant mass surveillance and transaction-crafting infrastructure. Although base ledger activity is public on-chain, the protocol's APIs index, enrich with USD valuations, aggregate historical PnL, expose 1,355 vault admin configs, and craft unsigned calldata for any address with zero authentication or throttling.
  • Production and development drifted on a single security guard, and dev fell over. Production capped GraphQL complexity at 1,000,000 and rejected an abusive query cleanly; development omitted the cap and crashed on a single 50KB request.
  • The protocol's core smart contracts and web perimeter are genuinely strong. Every reachable core lending deployment was owned by a 5-of-9 multisig, the bundler's controlled reentrancy held, all seven frontend injection vectors failed, and no backend credentials or admin panels were compromised.

The five things that need a decision, not a patch

#What is wrongBusiness impactWho decides
1776 of 1,000 vaults run with zero timelocks; 8 EOA-curated vaults hold $5.04M and 5 contract-curated vaults hold $11.3M+Curators are independent or partner operators, not just internal teams. Deciding whether the frontend enforces minimum timelock and multisig standards for listed vaults is a product and risk-policy decision.Protocol governance + risk
2GraphQL, 38 REST endpoints, and a 15-tool MCP server have zero authentication and zero rate limitingPublic DeFi APIs often default to open access for ecosystem integrators. Requiring API keys, tiered throttling, or authenticated sessions changes developer experience.Product + API engineering
3multicall allows same-block submit() plus execution whenever a timelock is zeroRequiring a strict timestamp inequality or minimum floor alters vault contract semantics for future deployments and curator tooling.Smart-contract engineering
4A $1.02M vault delegates all funds to an unverified liquidity adapter with zero timelocks on skim and burnSharesRound 2 bytecode inspection showed skimRecipient is unset and no unprivileged exploit exists, but listing vaults backed by unverified bytecode is a transparency and curation-policy call.Risk + curation partners
5Development GraphQL lacks production's complexity cap and crashed on a single 50KB query, while a dangling DNS CNAME points to a deleted load balancerEnvironment parity and DNS hygiene require release-gate policy, not one-off hotfixes.Infrastructure + SRE

What we did not get

No funds were moved. No private keys, signing keys, or cloud credentials were recovered. No control-plane or admin panel was compromised. No code or CI/CD supply-chain write access was achieved.

All vault-drain proofs were executed strictly via read-only on-chain cast state inspection and local fork simulations in Foundry; zero mainnet state mutations were sent.

Engagement outcome

An authorized external security assessment of a multi-chain DeFi lending and vault protocol confirmed that its core lending contracts, transaction bundler, web application perimeter, and private backend gateways enforced their security controls, with no funds moved and no credentials or admin systems compromised. The assessment identified configuration and access-policy gaps in third-party-curated vault timelocks, an unauthenticated public API and agent-tooling layer, and a missing complexity limit on a development endpoint. All findings, on-chain simulations, and prioritized remediation steps were delivered privately under a confidentiality agreement.


1. The engagement in numbers

MetricValue
Root workstreams1
Total Swarm Size32
Subdomains enumerated93 primary (+9 dev), 55 live hosts probed
Blockchains with core deployments14 (6 core multisigs verified live; 1 RPC unavailable)
Vaults scanned for timelock posture1,000 across 14 chains
Vaults with all-zero timelocks776 (77.6%)
Significant-TVL EOA zero-timelock vaults8 ($5.04M TVL; single EOA controls $4.77M across 3 vaults)
Significant-TVL contract zero-timelock vaults5 ($11.34M+ TVL; largest $11.0M on 3-of-N multisig)
Market positions enumerable without auth441,199 (plus 2.48M vault positions, 1,355 vault admin configs)
API / agent surfaces tested39 GraphQL fields, 38 REST endpoints, 15 MCP tools
Confirmed findings24 (2 critical, 4 high, 8 medium, 10 low/info)
Mainnet state mutations / funds moved0 (read-only queries + local Foundry fork PoCs)

Agent topology

RoleSessionsResponsibility
Orchestrator (blackbit)1Cycle design, scope gating, cross-workstream synthesis
Recon (blackbit-recon)15Subdomain/host inventory, GraphQL/Swagger schema capture, source & bundler audit
Exploit (blackbit-exploit)16Vault timelock scan, Foundry PoCs, bytecode analysis, API/MCP/dev/web probing
Fig 01 · Agent topology
Fig 01 · Agent topology

2. What held

A disciplined assessment records what resisted attack with the same rigor as what broke. Six major defensive layers held across web, cloud, cryptography, and smart contracts.

  • Core lending contracts across reachable chains are governed by 5-of-9 multisigs. All six reachable chain deployments returned multisig contract owners with a 5-of-9 threshold sharing nine active signers — zero EOA owners. Core lending logic is immutable (no upgrade proxy) and all rounding directions favor the protocol.
  • Bundler and general adapter contracts held. Both contracts were source-verified. Transient-storage reenterHash enforces strict callback commitment, initiator tracking resets after execution, and state-changing adapter calls are gated behind onlyBundler3.
  • The web application perimeter rejected all seven tested web-vulnerability classes. On app.lending.example, reflected search parameters were Unicode-escaped in React Server Component payloads, reinforced by a strict nonce-based CSP (script-src 'self' 'nonce-...' 'strict-dynamic'). XSS, SSTI, path traversal, SSRF, source-map exposure, the Next.js middleware subrequest bypass CVE, and prototype pollution were all rejected.
  • Private API gateways and cloud storage enforced authentication. services.lending.example required AWS Signature Version 4 IAM authentication across 177 fuzzed paths; private.api.lending.example gated traffic behind an edge function and custom authorizer (whitelisting only /health). The CDN bucket at cdn.lending.example returned 403 AccessDenied on listing, subresource queries, and writes.
  • Wallet-relay infrastructure held across six attack vectors. Session injection attempts (missing JWT, fake HS256 JWT, forged project identifiers) all returned 401, payloads used X25519 + ChaCha20-Poly1305 end-to-end encryption, session topics used 256-bit random identifiers, and attestation CSRF tokens validated signatures properly.
  • Identity edge filtering blocked automated probing. auth.lending.example enforced TLS JA3 fingerprinting at the edge, dropping all non-browser automated clients at the handshake layer.
Fig 02 · 2. What held
Fig 02 · 2. What held

Refuted, blocked, and unverified hypotheses

Separating confirmed vulnerabilities from refuted false positives, bounded operational risks, and environment-blocked items prevents wasted remediation cycles.

HypothesisVerdictTechnical reason
Hardcoded frontend secrets (telemetry token + AWS key fragment)RefutedThe telemetry token is a public-by-design client ingest identifier (NEXT_PUBLIC_*); the apparent AWS key string in the 5.4MB JS bundle was a webpack module hash, not a credential. Static secret scanning on the core Solidity repo returned zero hits.
Nonce-griefing via setAuthorizationWithSigRefutedAlthough nonce[authorizer]++ executes before signature verification, Solidity reverts atomically roll back state when ecrecover validation fails; invalid signatures never consume a user's nonce.
Unprivileged drain of the unverified liquidity adapterRefuted / BoundedRound 2 manual bytecode analysis of all 27 selectors showed a two-tier authority model (curator submits, parent vault executes) and skimRecipient set to the zero address (0x0), causing unconfigured skim() transfers to revert. No unprivileged external drain path exists; the finding remains an opacity and zero-timelock operational risk.
Reentrancy via unverified adapter during vault enter()UnverifiedThe vault invokes adapter.allocate() after updating _totalAssets without a nonReentrant guard, relying on adapter trust. Because adapter source is unverified, callback behavior could not be confirmed.
Permissionless forceDeallocate() griefingUnverified (latent)forceDeallocate() has no caller restriction, so anyone can force-deallocate on behalf of another user. With forceDeallocatePenalty = 0 on-chain, no loss occurs today; loss activates only if a curator raises the penalty (up to 2%).
Identity-provider OIDC discovery, dynamic client registration, and user enumerationBlockedEdge TLS JA3 fingerprinting terminated all non-browser clients (curl, Python, Node, curl_cffi, OpenSSL) with handshake alert 40; testing requires a browser-grade TLS stack.
Direct origin bypass via lb.services.lending.exampleBlocked (NXDOMAIN)The target load balancer no longer exists (NXDOMAIN), turning a suspected WAF bypass into a dangling-CNAME DNS hygiene finding instead.
Vaults & UI repository static scans; one secondary chainCoverage gapOnly the core lending repository was present for static analysis (vault and UI repos were not cloned, partially mitigated by live 5.4MB bundle review); one of seven targeted core chains had an unavailable public RPC.

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 Systemic zero-timelock vaults with single-key EOA curatorsCritical

In plain terms. The protocol's curated ERC-4626 vault layer relies on per-function timelocks to give depositors a "rage-quit" window to exit before a curator activates a new liquidity adapter, changes the adapter registry, or raises fees. Across 1,000 vaults queried via GraphQL and verified on-chain via `cast`, 776 vaults (77.6%) had every single privileged timelock set to zero.

Thirteen of those zero-timelock vaults held significant TVL (over $10,000 each):

  • 8 vaults ($5.04M combined TVL across 4 chains) had externally owned accounts (EOAs) as curators — confirmed via cast code returning 0x. A single EOA address controlled three vaults totaling $4.77M across two blockchains with zero timelock delay and no multisig threshold.
  • 5 vaults ($11.34M+ combined TVL) used smart-contract curators (including one $11.0M vault governed by a 3-of-N multisig and one $111K vault on a 2-of-N multisig). Multisigs mitigate single-key compromise, but zero timelocks still eliminate the depositor exit window the instant a threshold signs.
  • Separately, a deep-profiled $1.02M mainnet stablecoin vault combined an EOA curator, all-zero timelocks, multicall batching, and an unverified liquidity adapter holding 100% of its deposited USDC.

What. Compromising any curator EOA private key (via phishing, workstation compromise, or insider action) allows instant redirection of vault deposits to an attacker-controlled adapter in a single transaction, leaving depositor shares backed by zero real assets.

How we found it. We first audited a single $1.02M mainnet vault, verified its zero timelocks and EOA curator on-chain, and built a local Foundry fork PoC demonstrating full balance drain. We then scaled the hypothesis across 1,000 vaults across 14 chains, filtering for zero timelocks and verifying curator bytecode (0x vs contract) and selector timelocks directly via RPC.

Root cause. Vault deployment defaults permit zero timelocks and single-key EOA curators without a protocol-level minimum delay or mandatory listing gate on the web frontend.

Fig 04 · 3.1 Systemic zero-timelock vaults with single-key EOA curators
Fig 04 · 3.1 Systemic zero-timelock vaults with single-key EOA curators

Impact. Immediate, unrecoverable loss of $5.04M+ across the eight EOA-curated vaults (plus the profiled $1.02M vault) upon a single key compromise, and zero depositor reaction window across an additional $11.34M+ in multisig-curated zero-timelock vaults.

Fix. Increase timelocks to at least 7 days (604,800 seconds) via increaseTimelock(selector, duration) for addAdapter, setAdapterRegistry, setCurator, setPerformanceFee, setManagementFee, and setForceDeallocatePenalty. Migrate all EOA curators to M-of-N multisigs (threshold >= 2), starting with the single EOA controlling $4.77M. Enforce minimum timelock policies or prominent risk warnings on listed vaults in app.lending.example, and deploy automated on-chain monitoring for zero-timelock configurations.


3.2 Atomic multicall delegatecall collapses the timelock windowHigh

In plain terms. Even when a vault requires a two-step submit(data) then execute flow, the vault's multicall() helper lets a caller batch both calls in one transaction. When a selector's timelock is zero, the timestamp check passes immediately in the same block — removing even a one-block monitoring window.

What. multicall() executes batched calls via delegatecall to address(this), preserving msg.sender. submit(data) writes executableAt[data] = block.timestamp + timelock[selector], and the guarded function checks block.timestamp >= executableAt[msg.data] (non-strict >=). With timelock == 0, submit(data) and execution succeed atomically in one transaction.

How we found it. Source review of the vault's timelock guard combined with a Foundry fork test batching submit(setAdapterRegistry(0)), setAdapterRegistry(0), submit(addAdapter(evil)), and addAdapter(evil) inside a single multicall invocation.

Root cause. Non-strict timestamp comparison (>=) combined with delegatecall-based multicall batching and zero-value timelocks.

Fig 05 · 3.2 Atomic `multicall` `delegatecall` collapses the timelock window
Fig 05 · 3.2 Atomic `multicall` `delegatecall` collapses the timelock window

Impact. Transforms a two-step governance pattern into a single-transaction atomic takeover whenever timelocks are unset, defeating off-chain mempool or block-by-block alerting and front-running defenses.

Fix. Set non-zero timelocks on all privileged selectors, and enforce a strict inequality check (executableAt[data] < block.timestamp) in future vault implementations so submit() and execution can never settle in the same block even when timelock is configured to zero.


3.3 Unauthenticated mass financial surveillance across GraphQL and REST APIsCritical

In plain terms. Both api.lending.example/graphql and the 38-endpoint Consumer REST API (/consumer/*) require zero authentication and enforce zero effective rate limiting. Any unauthenticated caller can supply any wallet address and retrieve a complete, USD-enriched portfolio, health factor, PnL, liquidation history, and transaction log — or scrape the entire user base in minutes.

What.

  • GraphQL (`api.lending.example/graphql`): Introspection is enabled (305 types, 39 query fields). Queries including userByAddress, marketPosition, vaultPosition, vaultV2PositionByAddress, marketPositions, and marketTransactions return complete financial profiles for any address. 441,199 market positions (and 2,481,082 vault positions) are enumerable. Batch alias queries pull 5,000+ records per HTTP request (up to 20,000 across aliased pages) while remaining inside the production complexity ceiling of 1,000,000.
  • *REST (`api.lending.example/consumer/):** The OpenAPI 3.0 specification explicitly defines security: [] and securitySchemes: {} across all 38 GET endpoints, with wildcard CORS (Access-Control-Allow-Origin: *`) and zero rate limiting confirmed across 60 rapid sequential requests.
  • Governance mapping: A single unauthenticated vaults(first: 1000) query returns curator, guardian, owner, fee recipient, pending owner, timelock, and multisig signer metadata across 1,355 vaults.

How we found it. By retrieving the OpenAPI spec and GraphQL introspection schema, validating arbitrary address lookup against a $307.5M single-address position on a Layer-2 network without credentials, and benchmarking batch-alias pagination and sequential request throttling. All testing was strictly read-only (non-GET REST methods returned 404; GraphQL exposes zero mutations).

Architectural nuance. Underlying blockchain balances and transactions are public on-chain by design. The security risk here is not that on-chain state exists, but that the protocol's managed APIs provide unauthenticated, unthrottled, pre-indexed aggregation, USD enrichment, historical PnL, and multisig-signer reconnaissance at database-dump speed — directly feeding targeted phishing and whale-tracking campaigns.

Fig 06 · 3.3 Unauthenticated mass financial surveillance across GraphQL and REST APIs
Fig 06 · 3.3 Unauthenticated mass financial surveillance across GraphQL and REST APIs

Impact. Complete, low-cost financial profiling of every protocol user and complete governance-target mapping of vault curators, owners, and multisig signers, with zero audit trail or abuse throttling.

Fix. Require API keys (or wallet-signed session tokens for user-specific views) on GraphQL and REST endpoints, enforce per-key and per-IP rate limits at the edge WAF, cap alias counts and pagination depth, and restrict raw admin-address and multisig-signer metadata from anonymous queries.


3.4 Unauthenticated MCP server with cross-chain reads and transaction preparationHigh

In plain terms. The protocol operates a Model Context Protocol (MCP) server at mcp.lending.example exposing 15 tools for AI agents. Anyone on the internet can invoke every tool directly without authentication, without rate limiting, and without even completing the MCP initialize handshake.

What.

  • Read tools (get_positions, get_token_balance, query_vaults, query_markets) query any address's positions across 11 blockchains, token balances, ERC-20 allowances, and the full catalog of 891 vaults and 1,634 markets. Unauthenticated calls returned the $307.5M whale position and a prominent public wallet's stablecoin balance.
  • Eight write-preparation tools (prepare_deposit, prepare_withdraw, prepare_borrow, prepare_repay, prepare_supply, prepare_supply_collateral, prepare_withdraw_collateral, prepare_claim_rewards) generate complete unsigned transaction calldata for any arbitrary caller-supplied address.
  • Error disclosure: Malformed tool calls leaked underlying Web3 client library versions and internal contract addresses.

How we found it. Direct JSON-RPC tools/list and tools/call POST requests without an initialize session, Authorization header, or API key.

Root cause. The MCP server was exposed as a public utility endpoint without session binding, client authentication, or edge rate limiting.

Fig 07 · 3.4 Unauthenticated MCP server with cross-chain reads and transaction preparation
Fig 07 · 3.4 Unauthenticated MCP server with cross-chain reads and transaction preparation

Impact. Provides an unmonitored, unthrottled financial surveillance channel and an authoritative calldata-generation oracle usable in phishing, wallet-draining lures, or prompt-injected agent workflows.

Fix. Require API-key or OAuth authentication for all tools/call invocations, enforce the MCP initialize lifecycle with session tokens, apply per-client rate limiting, and sanitize error payloads.


3.5 Development GraphQL endpoint missing complexity cap (confirmed 502 crash)High

In plain terms. Production's GraphQL server enforces a query complexity cap of 1,000,000 and cleanly blocked a deeply nested abusive query with HTTP 403. The development GraphQL server at api.dev.lending.example/graphql omitted that cap entirely — and crashed with HTTP 502 on a single 50KB request.

What. Comparing response extensions revealed maximumComplexity: 1000000 on production and no maximumComplexity field on development. A single 50KB POST query using 30 aliases (the allowed alias ceiling) against vaults(first: 1000) with deeply nested historical state, admin events, and metadata reached a computed complexity of 5,597,550,000 (5,597x over production's cap). Production rejected it with 403; development processed for ~7.8 seconds and crashed with 502.

How we found it. Diffing GraphQL introspection and response extensions between production and development environments, then sending one bounded test query within the 30-alias ceiling.

Root cause. Configuration drift: the complexity cost analyzer cap was enabled in production but disabled or left unset in development, with no independent query-depth limit.

Fig 08 · 3.5 Development GraphQL endpoint missing complexity cap (confirmed 502 crash)
Fig 08 · 3.5 Development GraphQL endpoint missing complexity cap (confirmed 502 crash)

Impact. Any unauthenticated remote actor can sustain a denial-of-service outage against the development API stack using trivial single-request bandwidth, disrupting engineering and staging pipelines.

Fix. Enforce the identical maximumComplexity: 1,000,000 configuration on development, add a strict query depth limit (e.g., max depth 10) across all environments, and add edge rate limiting.


Also confirmed

FindingSeveritySummary
Unverified liquidity adapter with zero timelocksMediumManages $1.02M in a profiled vault; bytecode unverified, zero timelocks on skim, setSkimRecipient, burnShares (bounded in Round 2 by skimRecipient = 0x0 and two-tier authority)
GraphQL batch-alias bulk extraction & depth gapMedium5,000+ records per HTTP request via aliased queries; 5-level cyclic nesting accepted with low computed complexity
Vault governance & multisig metadata enumerationMedium1,355 vault curator/owner/guardian/pending-owner addresses and multisig signer thresholds enumerable via single GraphQL call
REST API zero rate limitingMedium38 /consumer/* endpoints served 60 rapid sequential requests with zero throttling
Wildcard CORS on private API gatewaysMediumprivate.api.lending.example echoes wildcard origin alongside Authorization headers
Dangling DNS CNAME to deleted load balancerMediumlb.services.lending.example points to a decommissioned cloud load balancer returning NXDOMAIN
Cross-tenant TLS certificate sharingMediumCampaign host shares a multi-SAN TLS certificate and IP with three unrelated third-party domains
Latent permissionless forceDeallocate griefingMedium (latent)No caller check on forceDeallocate(); zero loss today while penalty is 0, activates if curator sets penalty > 0

Ten additional Low / Informational findings were documented: GraphQL introspection exposing 305 types, internal API path disclosure in 502 responses, error-tracker trace leakage on persisted-query 500 errors, verbose MCP error details, Sig V4 authorizer scheme/region disclosure, CDN edge /health auth whitelisting on private gateways, 300-user enumeration and moderator listing on forum.lending.example, identity-provider tenant identifier exposure via DNS CNAME, an expired TLS certificate on the legacy blog redirect, and wallet-relay health metadata exposure.


4. Kill chain summary

Fig 09 · 4. Kill chain summary
Fig 09 · 4. Kill chain summary
ChainReachedTerminated atData / proof obtained
Zero-timelock EOA vaults + multicallStage 4 (exploit — local fork)Read-only RPC + Foundry fork PoCOn-chain zero-timelock proof across 8 EOA + 5 contract vaults
GraphQL + REST API mass enumerationStage 5 (collection)Bounded proof samples onlySchema, $307.5M whale sample, 1,355 vault configs (no full DB harvest)
Unauthenticated MCP serverStage 5 (collection)Read proofs + dummy-address calldataWhale position, public balance, unsigned deposit calldata
Dev GraphQL complexity DoSStage 4 (exploit)Single 502 confirmationHTTP 502 crash trace (no sustained outage)
Unverified liquidity adapterStage 3 (analysis)Bytecode audit (skimRecipient = 0x0)27 selectors decoded; no unprivileged drain path
Core contracts / Bundler / Web / Private APIsStage 2 (blocked)Multisig, reenterHash, CSP, IAM, JA3Zero bypasses

5. What the shape of this engagement teaches

Immutable core contracts do not protect a mutable curation layer. The protocol's core lending singleton and transaction bundler passed every check — 5-of-9 multisig ownership, immutable logic, strict transient reentrancy guards. Yet 77.6% of scanned vaults sitting directly above that core disabled their primary depositor safety rail by running with zero timelocks. In layered DeFi architectures, risk migrates to the configuration boundary.

Same-block `multicall` turns zero timelocks from a bad default into an instant-drain primitive. A two-step submit() and execute workflow looks defensive in documentation, but non-strict timestamp checks paired with delegatecall batching collapse the reaction window to zero seconds. Strict block-boundary inequality (< instead of <=) and mandatory non-zero minimums belong in the contract or listing gate.

"The data is on-chain anyway" is not a security policy for managed APIs and MCP servers. On-chain state requires RPC indexing and correlation; an unauthenticated, unthrottled GraphQL/REST/MCP stack hands out enriched USD portfolios, historical PnL, 1,355 multisig-signer maps, and ready-to-sign calldata at arbitrary speed with zero visibility into who is querying.

Security controls must be enforced by code parity across dev and prod. Production's complexity cap worked exactly as designed. Development dropped that single setting and went down on one 50KB payload. Every API gateway policy should ship from shared configuration templates.

Round-two verification turns scary hypotheses into accurate risk ratings. The unverified liquidity adapter looked like an immediate external drain vector in Round 1; bytecode inspection in Round 2 proved skimRecipient was unset and no unprivileged exploit existed, downgrading panic into a clean operational action item. Likewise, separating a webpack hash from an AWS credential saved the team a pointless key rotation.

PriorityActionWhy firstEffort
1Increase timelocks to >= 7 days on all 8 EOA-curated vaults and migrate EOA curators to M-of-N multisigs (start with the $4.77M single-EOA curator)Directly closes $5.04M+ instant single-key drain riskLow (curator ops)
1Add authentication, MCP initialize enforcement, and per-client rate limiting to mcp.lending.exampleCloses unauthenticated surveillance + arbitrary calldata craftingLow
1Require API keys and edge rate limits on api.lending.example (GraphQL + 38 REST endpoints) and restrict raw admin-address metadataStops unthrottled bulk scraping of 441K positions and 1,355 vault configsMedium
2Enable maximumComplexity: 1,000,000 and a query depth cap on api.dev.lending.example/graphqlEliminates confirmed single-request 502 DoSVery low
2Source-verify the $1.02M vault's liquidity adapter and set non-zero timelocks (or abdicate skim / burnShares)Removes bytecode opacity and latent privilege riskLow
2Deploy automated on-chain monitoring alerting on zero-timelock vaults and enforce UI listing gates / risk badgesPrevents future vaults from drifting into zero-timelock configurationsMedium
3Add strict executableAt[data] < block.timestamp enforcement in next vault contract versionPrevents same-block multicall submit+execute even if timelock is zeroMedium
3Remove dangling CNAME lb.services.lending.example, restrict private-gateway CORS, and isolate shared campaign TLS certsCloses DNS takeover, cross-origin, and cross-tenant hygiene gapsLow

Notices

Authorization

This was an authorized security assessment conducted under a written engagement agreement covering the protocol's public web estate, APIs, agent tooling, and deployed smart contracts.

Strict read-only and non-destructive discipline was enforced throughout: on-chain vault takeover proofs were executed exclusively against local Foundry forks using public read-only RPC state (cast call / cast code), never on mainnet; API enumeration was bounded to minimal proof samples rather than full dataset harvesting; and the development GraphQL crash was verified with a single request and immediately halted without sustained denial-of-service traffic.

Redaction

Every client identifier, vault name, curator name, contract address, wallet address, IP address, hostname, token, and calendar date in this document has been removed or replaced with a neutral placeholder.

What was removed:

  • The protocol name, vault-layer brand name, and all third-party curator and vault display names
  • All real domains, subdomains, DNS targets, CDN distributions, and load-balancer hostnames
  • All on-chain contract addresses, curator/signer/whale wallet addresses, ENS names, and transaction hashes
  • All IP addresses, telemetry ingest tokens, webpack hashes, and identity-provider tenant identifiers
  • Third-party infrastructure, hosting, analytics, and managed-service vendor names where identifying
  • Exact calendar dates, block timestamps, and session identifiers

What was kept, deliberately: vulnerability classes, smart-contract mechanics (multicall delegatecall, non-strict timelock timestamp checks, two-tier adapter authority, transient reenterHash), aggregate counts and USD TVL magnitudes, HTTP status codes and complexity limits, and the full refuted/unverified/blocked ledger. These details are operationally transferable and identify nobody.

Placeholders used throughout:

PlaceholderMeaning
lending.exampleProtocol primary domain and estate
app.lending.exampleFlagship web frontend application
api.lending.exampleProduction GraphQL and Consumer REST API
api.dev.lending.exampleDevelopment GraphQL API
mcp.lending.examplePublic Model Context Protocol (MCP) server
private.api.lending.examplePrivate edge-authenticated API gateways
services.lending.exampleIAM-authenticated backend API gateway
lb.services.lending.exampleDangling DNS CNAME target
auth.lending.exampleManaged identity-provider custom domain
cdn.lending.exampleStatic-asset CDN distribution and storage bucket
forum.lending.exampleCommunity governance forum
<redacted>Any wallet address, contract address, key, or identifier

Data handling

No individual user wallet addresses, transaction hashes, private balances linked to identifiable owners, or forum user records are reproduced. Financial exposure is reported strictly by aggregate counts and anonymized TVL magnitudes.

Disclaimer

Findings reflect the state of the tested systems and on-chain vault configurations during the engagement window. Smart-contract configurations, timelocks, and API controls evolve; inclusion here does not imply a condition persists today.

Refuted and unverified hypotheses are explicitly separated from confirmed findings. Frontend credential alerts and setAuthorizationWithSig nonce-griefing were refuted; adapter reentrancy and latent forceDeallocate griefing remain unverified; and identity-provider endpoints blocked by edge TLS fingerprinting are recorded as untested coverage boundaries rather than clean passes.


Methodology and tooling by BlackBit. Core lending contracts and web defenses verified intact; systemic zero-timelock vault exposure proven via read-only RPC inspection and local fork simulations without moving funds. Published with the client's permission.

More in Web3

← All case studies