All storiesSecurity

Web3 security tool selection: match resources to failure classes

Select complementary testing, deployment, monitoring, and incident resources using contract risk and accountable evidence.

Web3 security tool selection: match resources to failure classes: Asset threats, Invariant tests, Authority graph, Deployment checks.
Security / Office SDK

Choose Web3 security resources by the failure classes your application must withstand: incorrect accounting, unauthorized authority, unsafe upgrades, dependency failures, and delayed incident response. Use complementary tests and review methods. A clean scan or a long tool list cannot establish that the application's business assumptions are safe.

Model assets and authority

Identify the assets the application controls and the accounts or contracts able to change their behavior. Draw upgrade authority, administrative roles, oracle dependencies, and transaction pathways. Record assumptions about external components and chain behavior. Prioritize failure classes such as unauthorized withdrawals, incorrect accounting, unsafe upgrades, and dependency manipulation. Security resources should then be selected for those classes. A static analyzer, invariant test framework, formal method, audit, and monitoring service answer different questions. Verify current support and limitations for the language, chain, and contract patterns actually used instead of relying on broad coverage claims.

Failure-class matrix linking accounting, authority, dependencies, and release to evidence.
Figure 1. Each resource should answer a different concrete risk question.

Combine complementary test methods

Use deterministic tests for known cases, property or invariant testing for behavior across sequences, and targeted analysis for suspicious patterns. Human review remains useful for business assumptions that tools cannot infer. Keep compiler versions and dependencies fixed during comparison so findings are reproducible. Triage each finding with an explanation and a test or documented rationale. A clean scan is not proof of safety, especially when a tool does not understand economic incentives or an external oracle. Give unresolved findings owners and release consequences rather than burying them among irrelevant automated warnings.

Write the invariant before picking the tool

An invariant expresses a property that should hold across permitted action sequences. For a hypothetical vault, one useful starting point is that withdrawals cannot exceed the assets a caller is entitled to receive under the intended accounting rules. That statement still needs refinement for fees, rounding, transfers, and external dependencies.

Given an approved starting state:
  run deposits, transfers, and withdrawals
  vary callers, amounts, and order
  assert the specified asset and authority properties

This is test-design pseudocode, not a complete financial specification or an implementation recommendation. The team responsible for the contract must define the exact property. A tool can search for counterexamples only within its supported model and test setup.

Keep an authority table alongside the accounting invariants. List who can upgrade the contract, change an oracle, modify limits, or invoke an emergency action. Test unexpected callers and permitted role transitions. An application can satisfy an arithmetic property while remaining unsafe because an administrator has broader authority than users understand. Conversely, a role check can be correct while accounting fails through a sequence of otherwise authorized actions. Selecting resources from both models gives the release review stronger evidence than repeatedly testing one happy path.

Exercise a vault accounting example

Consider a hypothetical vault accepting deposits and issuing shares. Define an invariant linking tracked assets, share supply, and approved withdrawals under the intended rounding rules. Generate sequences of deposit, withdrawal, transfer, and administrative actions with small and large values. Include adversarial account behavior and changed dependency responses in a controlled test environment. Independently inspect who can upgrade the implementation or alter limits. This example demonstrates why unit tests for one happy deposit path are insufficient: the risk emerges from sequences, rounding, permissions, and external assumptions that several complementary methods must examine.

Extend security beyond release

Verify deployment parameters, privileged addresses, bytecode or build provenance where applicable, and the approved change process. Document how monitoring distinguishes expected activity from harmful deviations in the chosen system. Define incident owners, communication paths, and any pause or recovery mechanism actually present in the contracts. Do not promise reversibility for transactions or controls that were never implemented. Rehearse with a test incident before launch. Keep relevant resources available to responders, including dependency contacts and a plain description of authority, because tool output is useful only when someone can interpret it and act.

Build, deployment review, live observation, and available incident action.
Figure 2. Do not promise reversal for transactions or controls the system does not have.

Release evidence

  • Map each selected tool or service to a concrete failure class.
  • Retain reproducible findings and rationales for dismissed alerts.
  • Test invariants and administrative authority across action sequences.
  • Verify deployment configuration and approved upgrade procedures.
  • Rehearse monitoring and response using the controls the system truly has.

Further reading

Back to all stories

Keep reading.

All stories