Beyond the contract boundary: reviewing Web3 systems as a whole
On this page
In short
A contract can implement its local rules correctly and still fail because an oracle, bridge, relayer, frontend, API, or privileged operator violates an assumption the contract never checks. A system review makes those assumptions explicit, follows data and authority across each boundary, and tests what happens when an integrated component is delayed, compromised, misconfigured, or merely behaves differently from the happy path.
Why contract-only reasoning is incomplete
A smart contract review that stops at the contract boundary answers one question well: is this code internally consistent? It says very little about the questions attackers actually ask:
- What does this contract assume about the data it receives?
- Who is allowed to produce that data, and under what conditions?
- What happens when an upstream component behaves within spec, but not as expected?
Each of these lives at a seam — between the contract and an oracle, between the contract and a bridge, between on-chain logic and the off-chain infrastructure that operates it.
For example, a lending contract may correctly reject a price older than one hour. That check is not sufficient if the integrated oracle can report a fresh timestamp while the underlying market is halted, if the price uses a different decimal scale than the consumer expects, or if the fallback source is controlled by a role with unexpected powers. The arithmetic can be correct while the input model is wrong.
A boundary-by-boundary review method
We treat every external touchpoint as an untrusted boundary and enumerate what crosses it:
- Inputs. Every value that enters from outside — parameters, oracle reads, callback data, message payloads — gets traced to its source and stress-tested against the assumptions the code silently makes about it.
- Trust. For each boundary we ask who controls the other side, and what they can do within their legitimate powers that the contract did not anticipate.
- Timing. State that changes on one chain, or in one transaction, and is read somewhere else creates a window. We map those windows deliberately.
- Failure behavior. We ask whether the caller reverts, retries, uses stale state, continues with a default, or becomes permanently stuck when the other component is unavailable.
- Authority. We trace who can upgrade, configure, pause, relay, sign, or override the integrated component and whether those powers compose into a larger privilege.
This is consistent with the system-oriented approach in the OWASP Smart Contract Security Verification Standard, which includes architecture, business logic, access control, communications, and operational concerns rather than reducing review to isolated syntax bugs.
Concrete examples
Bridge message integrity
Suppose a receiver checks that a message came from an approved bridge contract. The next questions are whether it also authenticates the source chain and source sender, whether the same message can be replayed, and whether messages are safe when delivered out of order. The external call is trusted, but the payload still needs an application-level trust boundary.
Frontend transaction intent
A contract may enforce all on-chain permissions while a frontend constructs an approval for the wrong spender or displays values from an unauthenticated API. Reviewing the interface means comparing the action shown to the user with the network, target, calldata, typed-data domain, and amount they actually sign.
Relayer disagreement
An off-chain relayer might treat a transaction as final before the confirmation policy assumed by the backend. If a reorganization removes the event, the off-chain system may issue a second action or retain state that no longer matches the chain. Idempotency keys, confirmation rules, and reconciliation behavior are security controls here.
What changes in the report
Reviewing the whole system surfaces a different class of finding: not "this line is wrong," but "this contract is correct about a world that does not exist." Those findings should identify the boundary, the assumed behavior, the behavior an attacker or failure can produce, and the resulting on-chain or off-chain impact. The remediation may belong in either component—or require a new invariant across both.
Limitations
No review can model every third-party failure or future configuration. External services change, privileged keys can be compromised, deployments drift, and a valid scope may intentionally exclude components. The report must therefore name which integrations and environments were evaluated, the behavior assumed from the others, and the monitoring or incident controls needed when those assumptions fail.
Primary references
- OWASP Smart Contract Security Verification Standard
- NIST Secure Software Development Framework, SP 800-218
- EIP-712: Typed structured data hashing and signing