Protocols often appear secure in isolation. However, Web3 operates through layers of interconnection. Many security failures in 2025 originate not from contract-level bugs but from interactions between systems, including protocols, liquidity platforms, messaging bridges, and autonomous agents. This blog outlines why composability has become a key source of systemic risk and how organizations can mitigate it through composability-aware design.
The Composability Tradeoff
Composability is a foundational characteristic of Web3 architecture. It enables developers to construct systems by integrating functionality across protocols. However, this flexibility introduces risk:
- External dependencies can shift protocol behavior in unexpected ways
- Integration points often carry hidden assumptions and permissions
- Failures in one component can propagate across multiple systems
A protocol may function correctly within its own context but behave insecurely when composed with other systems that introduce incompatible logic or runtime conditions.
Composability-Induced Failures
Recent examples illustrate the consequences of insecure compositions:
- Governance token modifications affected multiple protocols using that token for decision logic, introducing unintended governance behavior
- Lending platforms integrating external oracles failed to account for delay or manipulation during market volatility, leading to liquidations based on stale prices
- Modular execution via delegatecall introduced vulnerabilities when contracts passed control to unverified external logic modules
- Message-passing bridges enabled cross-chain inconsistencies when assumptions about transaction ordering or finality failed
These incidents resulted from contract interactions that exposed vulnerabilities not visible during single-system audits.
Expanding Risk Modeling
Composability introduces risk dimensions that require security teams to move beyond isolated contract review. Risk modeling should include:
- Dependency Mapping: Identify all external contracts, tokens, or systems involved. Assess their mutability, governance structure, and upgrade paths.
- Behavioral Modeling: Map how the protocol interacts with real-world agents, including relayers, arbitrage bots, bridges, and frontends. Model behavior under both normal and adversarial conditions.
- Assumption Inventory: List assumptions about transaction sequencing, input validity, event propagation, or contract upgrade schedules. Evaluate where these assumptions may not hold during integrations.
- State Synchrony: When integrating with stateful contracts, ensure that the internal states of all interacting components remain synchronized and cannot drift out of sync in ways that could be exploited.
Architecture for Safe Composition
Protocol design should include mechanisms to minimize composability risks:
- Restrict interactions to contracts with defined, versioned interfaces
- Separate logic paths for internal and external calls
- Require explicit input validation that includes contextual parameters
- Avoid execution patterns that delegate logic to external unknown modules
- Publish integration documentation that includes security boundaries and failure expectations
- Use invariant testing that spans across contract compositions and integration paths
- Design the smart contract modules to be as cohesive as possible.” and “Document all the assumptions especially around entry points
Projects should assume that their contracts will be composed by others without coordination. This means designing each component to fail safely and enforce strong assumptions about input structure and calling context.
Composability Trends and Data
- Over 40% of critical smart contract exploits in 2025 originated from multi-contract or cross-system interactions that were not addressed during audits
- Bridge-related losses have exceeded $700 million this year, much of it stemming from asynchronous message handling and unverified assumptions about counterparties
- In a study of five lending protocol incidents, three involved logic errors introduced through integration with external contracts
- Protocols with published integration specifications and test suites had 38 percent fewer post-deployment issues, based on an analysis of 60 systems
The scale and frequency of these issues underline that composability is a primary risk vector. As ecosystems grow, integration complexity increases and previously isolated flaws gain new paths for exploitation.
Secure Development Practices
To improve resiliency, organizations should:
- Provide simulation environments or testnets for integrators to verify behavior
- Monitor dependencies for upgrades, permission changes, or governance alterations
- Include third-party integration reviews as part of formal threat modeling
- Add fallback mechanisms that isolate or pause external interactions during anomalies
- Use fuzzing and invariant tools that simulate known integration paths
- Explicitly document and test against shared governance mechanisms or cross-chain behavior
Conclusion
This post includes insights contributed by Allarious, Spearbit’s Lead Security Researcher specialized in composability risk and multi-contract threat modeling.
“When smart contracts are composed together, simplicity is key. Assumptions should be kept to a minimum, and external interactions should rely on as few conditions as possible. Keeping integrations simple helps prevent potential issues. When complexity is inevitable, every assumption around inputs, outputs, and state transitions should be documented. In such cases, redundancy in documentation is not a weakness but often a necessity. “
Composability adds complexity to every layer of protocol architecture. Security reviews that focus only on single contracts cannot capture the impact of external interaction. Secure composability requires a shift toward system-level thinking, where teams proactively define, simulate, and verify integration behavior.
Organizations building in Web3 should assume that contracts will be reused, adapted, or extended in contexts they did not design. Systems that enforce strict boundaries, model their integration paths, and monitor for drift will be significantly more resilient.
Spearbit provides protocol-level and integration-aware security audits to support organizations navigating these risks. Our approach identifies interaction patterns, maps composability dependencies, and helps teams secure their protocols within the broader Web3 ecosystem. Contact us to scope your next successful security engagement.
