scrobble.life
#cybersecurity

🛡️ Bug Bounty Log #03 | The Quote Endpoint That Builds Transactions


bounty_3.jpg


🎯 The plan

  • Focus: Web & App bounty on a derivatives exchange (CEX with an on-chain settlement layer). The flow that caught my eye: non-USDT deposits get auto-converted to USDT through a DEX aggregator — an off-chain API deciding where swap output goes.
  • Time Spent: ~4 days across 7 sessions (recon → contract mining → probing → one primitive, zero filings)
  • Tools Used: subdomain/URL recon (gau, waymore, katana), JS bundle mining (144 API route bindings from a single file), mobile APK extraction, curl param probing, 20 lines of offline Python

NDA / ethics disclaimer: This was never filed — it stayed a primitive whose impact I could not prove end-to-end, and the program wound down before that could change. Even so, this log is fully generic: no exchange names, no domains, no verbatim endpoint paths, no live PoCs. Everything technical is reproducible in abstract form.


🧠 The finding: a quote API that hands you a transaction

Mapping the deposit auto-conversion flow, I found a public, unauthenticated GET endpoint that doesn't just quote the conversion — it builds the swap transaction. You pass chainId, src, dst, amount, slippage, from… and receiver.

It forwards the whole parameter set verbatim to a 1inch-style aggregator API and returns a complete, ready-to-sign transaction:

{
  "to":   "0x1111111254eeb25477b68fb85ed929f73a960582",
  "data": "0x12aa3caf…<your receiver, verbatim>…"
}

to = 1inch AggregationRouterV5 (public infrastructure, used by hundreds of integrations). Selector 0x12aa3caf = swap(). And the receiver I just typed into a URL parameter? Sitting in the calldata's output-recipient slot — the address that will receive the swap's proceeds.

The first hint came before any PoC. When I sent garbage parameters, the endpoint echoed the aggregator's own validation errors verbatim: "receiver must be an Ethereum address". That's an upstream error oracle — free proof that my parameters were being forwarded raw, before I'd spent a single crafted request on it.

🔬 Proving the primitive: a two-request calldata diff

The whole PoC was two GET requests, identical except for receiver:

# Request A: receiver = 0x0000000000000000000000000000000000000001
# Request B: receiver = 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 (USDC)
# src = ETH sentinel, dst = USDC, amount = 1 ETH, slippage = 1

Both came back quoting ~2463 USDC for 1 ETH, both targeted the same router with the same swap() selector. Decode the calldata and diff: the only 32 bytes that moved are the recipient slot. Same route, same amounts, same everything — my client-chosen receiver, injected verbatim.

The decode "script" is 20 lines of Python, runs offline on the captured responses, touches no network and no chain. This is the cheapest PoC I've ever built: zero RPC cost, zero forks, zero on-chain state, pure read-only public endpoints.

Then the design-intent oracle: the exchange's sibling endpoint — the pure price quote, same conversion flow — exposes no receiver parameter at all. The quote variant knows the output goes to the deposit pipeline. Only the transaction-building variant accepts a free-form recipient. That contrast is your "this is not by design" argument, delivered by the target's own API surface.

⚖️ Why this is (probably) a bug

A deposit-conversion flow has exactly one legitimate recipient for swap output: the exchange's own vault or the user's deposit account. A builder for that transaction must pin receiver server-side. Accepting a client-supplied one gives every caller an output-redirection primitive: swap proceeds → wherever I say.

The unholy trinity was complete: public (no auth), state-mutating (builds a real transaction, not a price read), client-chosen beneficiary (receiver).

If that built transaction propagates into the private deposit execution path, a user's deposit swap quietly pays out to an attacker address. That's "direct theft of user funds" territory.

🧗 The honest limitation: primitive ≠ finding

That last sentence has an if in it, and the if is where the finding died.

The quote→transaction builder I could reach as an anonymous researcher proves the injection primitive. But proving theft requires showing the built transaction actually reaches the deposit execution path — and that path lives behind authenticated private endpoints. The session requires full account onboarding: embedded-wallet setup on a live exchange, likely KYC, on an account that can hold real funds.

Without that, "the output can be redirected" is a hypothesis about how a server I can't see consumes data I can control. My submission gate has one rule for impact claims: end-to-end propagation, or it doesn't ship. An unproven Critical is a reputation risk wearing a report template. So the primitive went into the archive with an honest label: proven mechanism, unproven consequence — and the program wound down before an authenticated pass was ever possible.

💡 What worked, what didn't

  • What paid off:
    • The upstream error oracle: verbatim third-party validation errors = param-forwarding confirmed before writing any PoC. The backend had already documented the aggregator's API for me.
    • The sibling-endpoint comparison: pure-quote vs tx-builder is a design-intent differential test that costs one extra request.
    • The calldata diff: the entire evidence package was 2 requests + 20 lines of Python. No fork, no chain state, no cost.
  • What tripped me up:
    • Everything valuable was walled behind auth — the IDOR candidates on private endpoints were untestable without onboarding, and onboarding means a real account on a real exchange.
    • The rest of the session died loudly and instructively: "unauthenticated" endpoints that turn out to panic before acting (reachable, but no logic executes); an SSRF-shaped proxy surface whose backend isn't deployed in production (routes registered, handlers absent); an XSS on content only the operator can write (trusted editorial pipeline — not a finding).
    • Session tally: 18 leads opened, each killed or walled with a documented reason. Zero reports.

📈 By the numbers

  • Leads opened: 18 → proven primitives: 1 → filed: 0
  • API route bindings extracted: 144 (from one JS bundle) · mobile APK paths: ~92
  • PoC cost: 2 GET requests + 20 lines of offline Python
  • On-chain transactions executed: 0 · chain state touched: none (read-only public quotes)
  • Funds impact proven: $0 · funds impact hypothesized: any deposit that auto-converts

✅ Final takeaways

  • A quote endpoint that builds transactions is not a quote endpoint. Any public API that assembles state-mutating transactions gets probed for every output-recipient parameter it accepts: receiver, from, to, recipient. If the client can set who gets paid, the server forgot who it works for.
  • Upstream error messages are free API documentation. When a proxy echoes the third party's validation errors, your parameters are forwarded verbatim — you've found the injection seam before writing a single line of PoC.
  • A primitive is a hypothesis about impact. Mechanism proven ≠ consequence proven. The submission bar is end-to-end propagation: show where the built transaction is consumed, or label the work a primitive and move on without regret.
  • The sibling endpoint is your design-intent oracle. If the pure-quote variant exposes no recipient parameter, the transaction-builder accepting one is the outlier — "not by design," argued from the target's own surface.

Your move: map your target's deposit and withdrawal flows and find the exact seam where a quote becomes a transaction. Diff the calldata — it takes two requests. And redact everything, even for findings you never file: no names, no domains, no verbatim paths.

Next Target: this probe is now a permanent line in my recon checklist — receiver/beneficiary parameters on every public swap or deposit tx-builder — logged into the hunting framework's adoption queue as a validated-primitive technique.


**Note:** For this post, I used AI tools to format the text, add emoticons and make corrections.

Comments

No comments yet — be the first.