Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Trail of Bits 6 min read Incident mediumAdept

State divergence enables unauthorized access

Provenance Blockchain's marker module let any account grant itself ACCESS_ADMIN, mint and withdraw rights on non-fixed-supply markers. The authorization check compared the caller's bank balance to a stale supply field on the marker struct that stays zero, so a caller holding nothing passed via 0 == 0. Two transactions were enough to mint arbitrary tokens or drain escrow, putting 82 mainnet markers and about $500,000 in escrowed nhash at risk. The fix reads live supply from the bank module and adds an explicit zero-supply guard, illustrating that an authorization predicate must never be satisfiable from an attacker's default state.

Assumes: Cosmos SDK modulesblockchain token accountsaccess control lists

Related posts

  • Building secure Uniswap v4 hooks

    Trail of Bits hardMaster

    Uniswap v4 hooks shift security responsibility onto application code: the PoolManager enforces swap math, callback sequencing and end-of-session settlement, but not a hook's authorization or internal accounting. Drawing on audits and incidents like Cork (~$12M) and Bunni ($8.4M), seven recurring failure patterns emerge: unchecked callers, trusting arbitrary PoolKeys, leaky custom accounting that still passes settlement, logic in the wrong callback, address permission bits out of sync with implemented callbacks, non-essential hook code blocking exits, and shared state mutating across nested callbacks. Fixes include BaseHook/SafeCallback caller checks, pool allowlists keyed by PoolId, separate balance buckets, try/catch for optional calls, and fuzzing adversarial scenarios with Echidna and Medusa, packaged as checklists for builders and auditors.

  • After Binance, check what your signing systems can approve

    Trail of Bits hardMaster

    Binance's October 2026 breach showed that attackers who compromise a service allowed to request signatures can misuse a protected key without ever extracting it. Here the attacker obtained a signed EIP-7702 delegation that persisted on-chain and enabled repeated drains, including of later deposits, with no further signatures. Signing policies and monitors that only watch transfers and ownership changes miss authority shifts via EIP-7702 authorizations, Safe modules, session keys and ERC-4337 UserOperations. A four-step checklist follows, each step with verification tests: inventory and isolate signing access, treat delegation as an admin privilege with separate approval and simulation, add custody limits the operational key cannot bypass, and alert on wallet authority changes.

  • Mutation testing comes to DAML

    Trail of Bits mediumAdept

    Mewt, Trail of Bits' open-source mutation-testing engine, now supports DAML, the smart-contract language for Canton Network, adding controller party swap and controller party removal mutations that target authorization bugs. DAML's built-in coverage only reports whether choices were exercised, so a happy-path test can show 100% coverage while a mutant that drops the buyer from a payment's controller list still passes. Mewt parses DAML via the tree-sitter-haskell grammar with error recovery. On OpenZeppelin's canton-stablecoin it found seven survivors among the highest-priority mutants: four genuine missing tests and three equivalent or unreachable ones. Because each campaign runs the suite once per mutant, nightly or weekly cadence is recommended.

  • Building Overexposed: understanding application exposure

    Shopify Engineering mediumAdept

    Overexposed is Shopify's scheduled scanner for finding GKE Ingresses and Cloud Run services reachable without authentication. An earlier version read Kubernetes config from the repo, and it produced false alarms, misses and blind spots. The rebuild pulls admitted resources and IAM policies from GCP Cloud Asset Inventory and probes each endpoint anonymously with HEAD-first requests and checked redirects. It maps each result to one of six verdicts (exposed, expected, protected, not found, unreachable, inconclusive) with recorded evidence. Key lessons cover how a status code means different things on different surfaces (a Cloud Run 404 can come from Google's front end), SSRF protection for the scanner itself by connecting to pre-validated IPs, replaying rule changes against saved scans (which cut inconclusive Ingress results by about 80%), and mutation testing and per-verdict canaries to verify AI-written tests.

  • Coding Agent Horror Stories: The CVE That Did Not Exist

    Docker mediumAdept

    A self-hosted, read-only AI code review bot running on Ollama answered a routine PostgreSQL 16.11→16.13 patch bump with a 1,500-word report alleging an "architectural takeover". The report cited a nonexistent CVE, named Kubernetes resources that did not exist and urged revoking all IAM access. Read-only permissions stopped the agent from acting, but its output could still push a human with real access into causing an outage, so agent output should be treated as untrusted input. The walkthrough moves the reviewer into a Docker Sandbox microVM with the repo mounted read-only, no credentials, and deny-all networking except the model port. It also adds a CI step that checks every cited CVE ID against the NVD API and flags the review when any ID is fake.

The quest for software engineering knowledge.

Look:
Layout: